澳门游戏平台大全 电子游戏平台 Apache配置多网站多域名,大器晚成台apache服务器上配备八个类别的apache配置

Apache配置多网站多域名,大器晚成台apache服务器上配备八个类别的apache配置

Linux:一台apache服务器上部署多个项目的apache配置,linuxapache

第一步:

将代码取到/var/www/html目录下(此为默认目录,具体看apache的设置);该目录下可以放多个项目,如:

[[email protected]
html]# pwd
/var/www/html
[[email protected]
html]# ls
bossmail.cn  bossq.cn  oem  ydj.org  yzhantong 

第二步:

vim /usr/local/apache/conf/extra/httpd-vhosts.conf

<VirtualHost *:80>
    DocumentRoot “/var/www/html/bossq.cn”
    ServerName test.bossq.cn
    ServerAlias bqapi.bossq.cn
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot “/var/www/html/ydj.org”
   ServerName ydj.org
   ServerAlias www.ydj.org
   ErrorLog “logs/ydj.org-error_log”
电子游戏平台,  CustomLog “logs/ydj.org-access_log” common
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot “/var/www/html/oem”
   ServerName yzt241.com
   ServerAlias www.yzt241.com
   ErrorLog “logs/oem-error_log”
  CustomLog “logs/oem-access_log” common
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot “/var/www/html/yzhantong”
   ServerName cnh.cn
   ServerAlias www.cnh.cn
   ErrorLog “logs/cnh.cn-error_log”
  CustomLog “logs/cnh.cn-access_log” common
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot “/var/www/html/bossmail.cn”
   ServerName bossmail.cn
   ServerAlias test.bossmail.cn
   ErrorLog “logs/cnh.cn-error_log”
  CustomLog “logs/cnh.cn-access_log” common
</VirtualHost>

第三步:

本地电脑的hosts文件添加解析,如:

192.168.148.18 test.bossmail.cn

 

打开浏览器输入:test.bossmail.cn或者bossmail.cn即可访问

第一步:
将代码取到/var/www/html目录下(此为默认目录,具体看apache的设置);…

# ServerAdmin admin@centoscn.com

# # VirtualHost example:

# The first VirtualHost section is used for all requests that do not

把以下虚拟机的配置加在 httpd.conf 文件末尾即可

打开Apache配置文件httpd.conf,如默认情况下为
/etc/httpd/conf/httpd.conf
# vi /etc/httpd/conf/httpd.conf

NameVirtualHost *:80 //注意:这行默认是有#号的,记得要去掉

<VirtualHost *:80>
ServerAdmin admin@centoscn.com
DocumentRoot /var/www/html/centos
ServerName www.centoscn.com
ServerAlias www.centoscn.com
ErrorLog logs/centoscn.com-error_log
CustomLog log/centoscn.com-access_log common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin
[email protected]
DocumentRoot/var/www/html/gamekey.com.cn
ServerName www.gamekey.com.cn
ServerAlias www.gamekey.com.cn
ErrorLog logs/gamekey.com.cn-error_log
CustomLog logs/gamekey.com.cn-access_log common
</VirtualHost>

# Almost any Apache directive may go into a VirtualHost container.

/etc/httpd/conf/httpd.conf # vi /etc/httpd/conf/httpd.conf
把以下虚拟机的配置加在 httpd.conf 文件末尾即可…

# match a ServerName or ServerAlias in any block.

标签:

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图