Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Virtual Host (Detailed Guide) #197

Open
veslorens opened this issue May 7, 2022 · 7 comments
Open

Creating Virtual Host (Detailed Guide) #197

veslorens opened this issue May 7, 2022 · 7 comments
Assignees

Comments

@veslorens
Copy link

Kindly assist me on how to create a virtual host, a detailed guide please?
I am using port 82 with my Apache, accessing the project by (http://localhost:82)

@alainseys
Copy link

Hello @veslorens ,

  1. Open default.conf
  2. create your entry like project1.dev:80
  3. Safe your file
  4. open on your local machine a shell and edit /etc/hosts and add project1.dev to 127.0.0.1, safe the file

@sebastienbages
Copy link

Can you give an example, please?

@alainseys
Copy link

Can you give an example, please?

@sebastienbages see my sample this is required to get this to work for a dev env environment i have proposed to add dns mask so you can use an extension as testing environment i am still waiting on feedback for this.

@veslorens
Copy link
Author

@alainseys
Hi, got it working in the dev environment. Thank you!
But I need to append the port 82 in the domain, eg. project1.dev:82
How can we make it work without appending the port 82?

@alainseys
Copy link

@veslorens this wil work if port 80 is not in use.
If not you will need to use dnsmasq i have made a PR if this comes trough the validation you can use this.

@alainseys
Copy link

@veslorens do you need more information about this ?

@maxi032
Copy link

maxi032 commented Jun 18, 2024

I also need some help :)
Inside config/vhosts/default.conf I've added

		ServerAdmin [email protected]
		DocumentRoot ${APACHE_VHOSTS_DOCUMENT_ROOT}/exampletest/
		ServerName example.test
		ServerAlias www.example.test
		<Directory ${APACHE_VHOSTS_DOCUMENT_ROOT}/exampletest>
			AllowOverride all
		</Directory>
</VirtualHost>

and in www folder I've added a folder exampletest with an index.php in it containing Inside example.test
When I access http://example.test I see the default LAMP STACK page.
After docker compose up I can see in the terminal: AH00112: Warning: DocumentRoot [/var/www/vhosts/exampletest] does not exist
I am working on ubuntu 22.04.4 LTS and docker v26.1.4
Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants