1 2 3 4 5 6 7 8 9 10 11 12 13
|
# # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for requests without a known # server name. # #<VirtualHost *:80> # ServerAdmin [email protected] # DocumentRoot /www/docs/dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common #</VirtualHost>
|
1 2 3 4 5 6 7 8 9 10 11
|
# # DocumentRoot 是网站文件存放的根目录 # ServerName 是网站域名, 需要跟 DNS 指向的域名一致 # <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/httpdocs/demo_aliluna_com ServerName demo.aliluna.com ErrorLog logs/demo.aliluna.com-error.log CustomLog logs/demo.aliluna.com-access.log common </VirtualHost>
|
1 2 3 4 5 6 7 8 9 10 11
|
# # DocumentRoot 是网站文件存放的根目录 # ServerName 是网站域名, 需要跟 DNS 指向的域名一致 # <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/httpdocs/demo_aliluna_com ServerName demo.aliluna.com ErrorLog ${APACHE_LOG_DIR}/demo.aliluna.com-error.log CustomLog ${APACHE_LOG_DIR}/demo.aliluna.com-access.log combined </VirtualHost>
|
1
|
sudo a2ensite demo.aliluna.com
|
1
|
sudo a2dissite demo.aliluna.com
|
1
|
sudo /etc/init.d/apache2 restart
|
1 2 3 4 5 6 7 8 9 10 11
|
# # DocumentRoot 是网站文件存放的根目录 # ServerName 是网站域名, 需要跟 DNS 指向的域名一致 # <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "D:/workspace/php/demo_aliluna_com" ServerName demo.aliluna.com ErrorLog "logs/demo.aliluna.com-error.log" CustomLog "logs/demo.aliluna.com-access.log" common </VirtualHost>
|
1 2 |
# Virtual hosts Include conf/extra/httpd-vhosts.conf
|