1 頁 (共 1 頁)

How to set up Virtual Hosts in Apache on Mac OSX 10.10 Yosem

發表於 : 2016-05-28 15:09:20
yehlu
https://coolestguidesontheplanet.com/se ... -yosemite/

Open the httpd.conf

sudo nano /etc/apache2/httpd.conf
Search for ‘vhosts‘ and uncomment the include line

# Virtual hosts

代碼: 選擇全部

Include /private/etc/apache2/extra/httpd-vhosts.conf
Also allow another module to run by uncommenting:

代碼: 選擇全部

LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so

代碼: 選擇全部

sudo nano /etc/apache2/extra/httpd-vhosts.conf

代碼: 選擇全部

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/usr/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
</VirtualHost>

代碼: 選擇全部

sudo apachectl restart
/usr/local/bin/apachectl stop
sudo /usr/sbin/apachectl stop