欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

CentOS配置虛擬主機(jī)virtualhost使服務(wù)器支持多網(wǎng)站多域名的方法

 更新時(shí)間:2016年10月26日 14:12:23   作者:一個(gè)人的天空@  
這篇文章主要介紹了CentOS配置虛擬主機(jī)virtualhost使服務(wù)器支持多網(wǎng)站多域名的方法,涉及CentOS環(huán)境下Apache服務(wù)器虛擬主機(jī)設(shè)置技巧,需要的朋友可以參考下

本文實(shí)例講述了CentOS配置虛擬主機(jī)virtualhost使服務(wù)器支持多網(wǎng)站多域名的方法。分享給大家供大家參考,具體如下:

如何讓centos(redhat)配置虛擬主機(jī),讓服務(wù)器支持多個(gè)網(wǎng)站,針對(duì)Apache,只需要你修改apache配置文件/etc/httpd/conf/httpd.conf即可。

里面有個(gè)example文件,你只要對(duì)應(yīng)配置即可。

#<VirtualHost *:80>
#  ServerAdmin webmaster@dummy-host.example.com
#  DocumentRoot /www/docs/dummy-host.example.com
#  ServerName dummy-host.example.com
#  ErrorLog logs/dummy-host.example.com-error_log
#  CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHos>

你可以參照我的配置,在httpd.conf最底部添加:

NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html
ServerName www.yourweb.com
#ErrorLog /var/log/httpd/yourweb/error_log
#注意,這里我設(shè)置了以天為單位生產(chǎn)日志
ErrorLog "|rotatelogs /var/log/httpd/yourweb/error_log%Y_%m_%d.log 86400 480"
#CustomLog /var/log/httpd/yourweb/access_log common
CustomLog "|rotatelogs /var/log/httpd/yourweb/access_log%Y_%m_%d.log 86400 480" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/blog
ServerName blog.yourweb.com
ErrorLog /var/log/httpd/blog/error_log
CustomLog /var/log/httpd/blog/access_log common
</VirtualHost>

如上我配置了兩臺(tái)虛擬主機(jī):域名分別為www.yourweb.com  blog.yourweb.com

注意,重啟apache后才生效(service httpd restart)

希望本文所述對(duì)大家CentOS服務(wù)器管理有所幫助。

相關(guān)文章

最新評(píng)論