系統(tǒng):Ubuntu 10.10試驗(yàn)使用12.04.1
Apache:2.2.16
【修正于 http://blog.sina.com.cn/s/blog_6452c6b40100qq3a.html】
###################################################################
修改 /etc/apache2/httpd.conf 為:
ServerName 127.0.0.1
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
ServerName localhost
ErrorLog "|/usr/sbin/rotatelogs ${APACHE_LOG_DIR}/error-80-%Y-%m-%d.log 86400"
CustomLog "|/usr/sbin/rotatelogs ${APACHE_LOG_DIR}/access-80-%Y-%m-%d.log 86400" combined
</VirtualHost>
<VirtualHost *:6666>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/zuitu
ServerName 127.0.0.1
ErrorLog "|/usr/sbin/rotatelogs ${APACHE_LOG_DIR}/error-6666-%Y-%m-%d.log 86400"
CustomLog "|/usr/sbin/rotatelogs ${APACHE_LOG_DIR}/access-6666-%Y-%m-%d.log 86400" combined
</VirtualHost>
<VirtualHost *:7777>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/tiantian
ServerName 127.0.0.1
ErrorLog "|/usr/sbin/rotatelogs ${APACHE_LOG_DIR}/error-7777-%Y-%m-%d.log 86400"
CustomLog "|/usr/sbin/rotatelogs ${APACHE_LOG_DIR}/access-7777-%Y-%m-%d.log 86400" combined
</VirtualHost> ********************************************************************************
###################################################################
修改
NameVirtualHost *:80
Listen 80
NameVirtualHost *:6666
Listen 6666
NameVirtualHost *:7777
Listen 7777 ********************************************************************************
###################################################################
把 /etc/apache2/sites-available/default 復(fù)制為default2 和 default3 并修改對(duì)應(yīng)的端口及網(wǎng)站文件路徑:
default3內(nèi)容,,粗體部分是需要改動(dòng)的,。log日志文件我改為每天一個(gè),避免過(guò)大:
<VirtualHost *:7777>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/tiantian
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/tiantian/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog "|/usr/sbin/rotatelogs ${APACHE_LOG_DIR}/error-7777-%Y-%m-%d.log 86400"
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog "|/usr/sbin/rotatelogs ${APACHE_LOG_DIR}/access-7777-%Y-%m-%d.log 86400" combined
</VirtualHost> ###################################################################
保存后重啟apache服務(wù):
sudo /etc/init.d/apache2 restart
備注我的系統(tǒng)上使用apache開(kāi)了3個(gè)端口82,、6666,、7777
另外還有l(wèi)ighthttpd使用81端口,,可以使用lsof -i:端口號(hào)查看 |
|
來(lái)自: antyoung > 《我的圖書(shū)館》