Linux(Ubuntu)
默認(rèn)情況下闻丑,linux上apache使用的
默認(rèn)文檔目錄是:/var/www
默認(rèn)端口是:80
如果想發(fā)布自己的一個(gè)系統(tǒng)資源目錄,可以使用下面的方法,執(zhí)行如下命令:
(1)添加監(jiān)聽(tīng)端口
#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)容如下:
8000>
ServerAdmin webmaster@localhost
DocumentRoot/wwwroot
/>
Options FollowSymLinks
AllowOverride None
/wwwroot/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
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
粗體部分是關(guān)鍵點(diǎn)。
(3)發(fā)布站點(diǎn)
# ln -s /etc/apache2/sites-available/default-me /etc/apache2/sites-enabled/001-default
(4)重啟服務(wù)
#/etc/init.d/apache2 restart
(5)測(cè)試
http://localhost:8000/
如果能夠正常訪問(wèn)就說(shuō)明配置正確了像街。