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

首頁 > 網站 > Apache > 正文

linux環境apache多端口配置虛擬主機的方法深入介紹

2024-08-27 18:22:59
字體:
來源:轉載
供稿:網友
本篇文章是對linux環境apache多端口配置虛擬主機的方法進行了詳細的分析介紹,需要的朋友參考下 默認情況下,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/
如果能夠正常訪問就說明配置正確了。
復制代碼 代碼如下:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 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.
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 英吉沙县| 阿拉善盟| 宝清县| 五家渠市| 北碚区| 上思县| 徐水县| 余庆县| 舒兰市| 寻乌县| 博爱县| 平远县| 临沂市| 沂水县| 寿阳县| 渝北区| 万荣县| 元朗区| 新闻| 澳门| 衢州市| 项城市| 东平县| 忻城县| 河北区| 历史| 常州市| 萝北县| 新津县| 昌吉市| 临洮县| 北海市| 大田县| 阿尔山市| 石景山区| 额敏县| 高邑县| 新余市| 云梦县| 阿拉善盟| 平乡县|