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
代碼: 選擇全部
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