国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 甘谷县| 子洲县| 广水市| 朝阳区| 巩义市| 黄石市| 海门市| 新龙县| 合川市| 明水县| 永德县| 班戈县| 遂宁市| 蕉岭县| 凤阳县| 安新县| 万源市| 安仁县| 双辽市| 红河县| 民和| 金门县| 盐津县| 喜德县| 都昌县| 凤山县| 新蔡县| 青冈县| 许昌县| 临武县| 枣阳市| 南乐县| 建宁县| 慈溪市| 高碑店市| 枣强县| 秭归县| 灵台县| 昌黎县| 锡林郭勒盟| 栾城县|