Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How to use <VirtualHost> directive to easily create multiple local hosts in Apache2 server?

user-image
Question ajoutée par Ahmed Sabra , Integration Support Engineer- Fintech , Saudi Financial Technology Company
Date de publication: 2015/08/27
Ahmed Sabra
par Ahmed Sabra , Integration Support Engineer- Fintech , Saudi Financial Technology Company

I solved it, but i will put it here maybe it helps someone:

Add the following to your Apache config file, typically its name is: httpd.conf

<VirtualHost *:80>

ServerAdmin webmaster@localhost

DocumentRoot "D:/MAMP/htdocs"

ServerName localhost

ServerAlias localhost

ErrorLog "logs/localhost-error.log"

CustomLog "logs/localhost-access.log" common

</VirtualHost>

 

<VirtualHost *:80>

ServerAdmin webmaster@newlocal

DocumentRoot "D:/MAMP/htdocs/new"

ServerName newlocal

ServerAlias newlocal

ErrorLog "logs/newlocal-error.log"

CustomLog "logs/newlocal-access.log" common

</VirtualHost>

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?