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

Apple OS
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

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

文章 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
回覆文章

回到「Mac OS X」