Linux(Ubuntu)
默認(rèn)情況下,linux上apache使用的
默認(rèn)文檔目錄是:/var/www
默認(rèn)端口是:80
如果想發(fā)布自己的一個系統(tǒng)資源目錄,可以使用下面的方法,執(zhí)行如下命令:
(1)添加監(jiān)聽端口
#cd /etc/apache2
#vim ports.conf
文件添加:
NameVirtualHost *:8000
Listen 8000
(2)配置虛擬目錄
#cd /etc/apache2/sites-available
#cp default default-me
#vim default-me
文件內(nèi)容如下:
<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>
粗體部分是關(guān)鍵點。
(3)發(fā)布站點
# ln -s /etc/apache2/sites-available/default-me /etc/apache2/sites-enabled/001-default
(4)重啟服務(wù)
#/etc/init.d/apache2 restart
(5)測試
http://localhost:8000/
如果能夠正常訪問就說明配置正確了。
|----------------------------------------------------------------------------------------|
版權(quán)聲明 版權(quán)所有 @zhyiwww
引用請注明來源 http://www.aygfsteel.com/zhyiwww
|----------------------------------------------------------------------------------------|