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

首頁(yè) > 服務(wù)器 > Web服務(wù)器 > 正文

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

2024-09-01 13:48:45
字體:
供稿:網(wǎng)友

本文實(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.comDocumentRoot /var/www/htmlServerName 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 commonCustomLog "|rotatelogs /var/log/httpd/yourweb/access_log%Y_%m_%d.log 86400 480" common</VirtualHost><VirtualHost *:80>ServerAdmin admin@example.comDocumentRoot /var/www/html/blogServerName blog.yourweb.comErrorLog /var/log/httpd/blog/error_logCustomLog /var/log/httpd/blog/access_log common</VirtualHost>

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

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

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


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 新田县| 高尔夫| 铜川市| 凌海市| 乳山市| 南雄市| 墨江| 南郑县| 厦门市| 伊宁县| 彰武县| 喀喇沁旗| 奎屯市| 和田县| 新宁县| 谷城县| 南木林县| 乌兰县| 名山县| 青州市| 安丘市| 连州市| 呼伦贝尔市| 元阳县| 东宁县| 鄢陵县| 鄂伦春自治旗| 仙居县| 桂林市| 阿坝县| 南江县| 广汉市| 株洲县| 淳安县| 鸡东县| 郴州市| 布拖县| 高碑店市| 射洪县| 象州县| 白朗县|