国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > Apache > 正文

linux環(huán)境apache多端口配置虛擬主機(jī)的方法深入介紹

2024-08-27 18:25:28
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
默認(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)容如下:
復(fù)制代碼 代碼如下:
<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)鍵點(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ō)明配置正確了。
復(fù)制代碼 代碼如下:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/ >
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:81
NameVirtualHost *:82
NameVirtualHost *:83
NameVirtualHost *:84
NameVirtualHost *:85
NameVirtualHost *:86
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:81>
ServerAdmin jsw7001@hotmail.com
DocumentRoot D:/AppServ/www/www-nongye
ServerName www.dede.com
ErrorLog D:/AppServ/www/www-nongye/errornongye.log
CustomLog logs/dummy-host2.appservnetwork.com-access_log common
</VirtualHost>
<VirtualHost *:82>
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿合奇县| 微山县| 瑞昌市| 双流县| 江永县| 封开县| 吐鲁番市| 长顺县| 泸溪县| 东乌珠穆沁旗| 吉首市| 新疆| 冀州市| 佛山市| 府谷县| 莎车县| 深州市| 读书| 新巴尔虎左旗| 新化县| 吉安市| 霍林郭勒市| 水城县| 宿松县| 沿河| 长寿区| 淄博市| 吉木乃县| 静宁县| 浦城县| 疏附县| 乌兰浩特市| 凤城市| 万州区| 鲜城| 酒泉市| 绥阳县| 永丰县| 舟山市| 吐鲁番市| 曲松县|