linux php 端口配置,linux环境apache多端口配置虚拟主机的方法深入介绍_php技巧

block.

#

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

Options FollowSymLinks

#Deny from all

Allow from all

ServerAdmin jsw7001@hotmail.com

DocumentRoot D:/AppServ/www-chinaec

ServerName www.dede.com

DirectoryIndex index.php index.html

ErrorLog D:/AppServ/www-chinaec/errornongjiale.log

CustomLog logs/dummy-host2.appservnetwork.com-access_log common

ServerAdmin jsw7001@hotmail.com

DocumentRoot D:/AppServ/www/www-05110

ServerName www.dede.com

ErrorLog D:/AppServ/www/www-05110/errornong05110.log

CustomLog logs/dummy-host2.appservnetwork.com-access_log common

ServerAdmin jsw7001@hotmail.com

DocumentRoot D:/AppServ/www/wordpress

ServerName www.dede.com

ErrorLog D:/AppServ/www/wordpress/errornongwordpress.log

CustomLog logs/dummy-host2.appservnetwork.com-access_log common

ServerAdmin jsw7001@hotmail.com

DocumentRoot D:/AppServ/www/magento

ServerName www.dede.com

ErrorLog D:/AppServ/www/magento/errormagento.log

CustomLog logs/dummy-host2.appservnetwork.com-access_log common

ServerAdmin jsw7001@hotmail.com

DocumentRoot D:/AppServ/www/magento1322

ServerName www.dede.com

ErrorLog D:/AppServ/www/magento1322/errormagento1322.log

CustomLog logs/dummy-host2.appservnetwork.com-access_log common

ServerAdmin jsw7001@hotmail.com

DocumentRoot D:/AppServ/www/www-nongjiale

ServerName www.dede.com

ErrorLog D:/AppServ/www/www-nongjiale/errornongjiale.log

CustomLog logs/dummy-host2.appservnetwork.com-access_log common

ServerAdmin webmaster@dummy-host2.x

DocumentRoot "C:/Apache2.2/docs/dummy-host2.x"

ServerName dummy-host2.x

ErrorLog "logs/dummy-host2.x-error.log"

CustomLog "logs/dummy-host2.x-access.log" common

1、单域名单端口设置如:www.abc.com 默认用80访问

特别说明,apache的配置默认都在安装目录下的conf目录里面

或者是/etc/apache2

不过一定要注意,listen.conf文件中端口监听是否开启

如下图,表示已经开启80端口监听

直接默认

1、单域名单端口设置如:www.abc.com 默认用80访问

特别说明,apache的配置默认都在安装目录下的conf目录里面

或者是/etc/apache2

不过一定要注意,listen.conf文件中端口监听是否开启

如下图,表示已经开启80端口监听

直接默认修改default-server.conf

这个配置最好简单安装好了,之后,默认已经能够使用了,只是要把它修改成你需要的域名及访问路径罢了。

给一个标准配置吧

代码如下:

DocumentRoot "/srv/www/htdocs"

#

# Configure the DocumentRoot

#

# Possible values for the Options directive are "None", "All",

# or any combination of:

# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

#

# Note that "MultiViews" must be named *explicitly* --- "Options All"

# doesn't give it to you.

#

# The Options directive is both complicated and important. Please see

# http://httpd.apache.org/docs-2.2/mod/core.html#options

# for more information.

Options None

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

# Options FileInfo AuthConfig Limit

AllowOverride None

# Controls who can get stuff from this server.

Order allow,deny

Allow from all

2、单域名多端口设置 代码如下:

Options None

AllowOverride None

Order allow,deny

Allow from all

Options None

AllowOverride None

Order allow,deny

Allow from all

NameVirtualHost *:80

NameVirtualHost *:81

DirectoryIndex index.html index.php

ServerName "www.abc.com "

DocumentRoot "/srv/www/htdocs/"

DirectoryIndex index.php

ServerName "www.abc.com:81 "

DocumentRoot "/srv/www/htdocs/bbs/"

3、多域名多端口设置 代码如下:

Options None

AllowOverride None

Order allow,deny

Allow from all

Options None

AllowOverride None

Order allow,deny

Allow from all

Options None

AllowOverride None

Order allow,deny

Allow from all

NameVirtualHost *:80

NameVirtualHost *:81

DirectoryIndex index.html index.php

ServerName "www.abc.com "

DocumentRoot "/srv/www/htdocs/"

DirectoryIndex index.html index.php

ServerName "www.btc.com "

DocumentRoot "/srv/www/htdocs/btc"

DirectoryIndex index.php

ServerName "www.abc.com:81 "

DocumentRoot "/srv/www/htdocs/bbs/"

需要注意的问题是,多端口监听,一定要注意listen.conf文件,是否开启了相应端口。

1428d0e076c3959ab11d28a39bc84fab.png

5268f80b9b1e01f982625ef6fac83ca1.png

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:php中文网

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值