Apache

for Linux

sudo service apache2 restart
sudo /etc/init.d/apache2 restart

for Windows

启用虚拟主机,让单台服务器上支持多台虚拟主机。

%APACHE_HOME%/httpd.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

<Directory "D:\workbench\demo\htdocs\htdocs\images">
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

%APACHE_HOME%/extra/httpd-vhost.conf

<VirtualHost *:8888>
    ServerName static.dss.alipay.net
    DocumentRoot D:\workbench\demo\htdocs\htdocs\static
    DirectoryIndex index.htm index.html index.jsp default.html defautl.htm default.jsp
    ErrorLog logs/static-error_log
    CustomLog logs/static-access_log common
</VirtualHost>