Linux(Ubuntu)
默認情況下,linux上apache使用的
默認文檔目錄是:/var/www
默認端口是:80
如果想發布自己的一個系統資源目錄,可以使用下面的方法,執行如下命令:
(1)添加監聽端口
#cd /etc/apache2
#vim ports.conf
文件添加:
NameVirtualHost *:8000
Listen 8000
(2)配置虛擬目錄
#cd /etc/apache2/sites-available
#cp default default-me
#vim default-me
文件內容如下:
<VirtualHost *:
8000>
ServerAdmin webmaster@localhost
DocumentRoot
/wwwroot
<Directory
/>
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory
/wwwroot/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
粗體部分是關鍵點。
(3)發布站點
# ln -s /etc/apache2/sites-available/default-me /etc/apache2/sites-enabled/001-default
(4)重啟服務
#/etc/init.d/apache2 restart
(5)測試
http://localhost:8000/
如果能夠正常訪問就說明配置正確了。
|----------------------------------------------------------------------------------------|
版權聲明 版權所有 @zhyiwww
引用請注明來源 http://www.tkk7.com/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2010-05-24 16:50
zhyiwww 閱讀(3078)
評論(0) 編輯 收藏 所屬分類:
j2ee 、
linux