ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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

user-image
تم إضافة السؤال من قبل Ahmed Sabra , Integration Support Engineer- Fintech , Saudi Financial Technology Company
تاريخ النشر: 2015/08/27
Ahmed Sabra
من قبل 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>

المزيد من الأسئلة المماثلة