服务器设置_服务器设置查察下令「服务器查询配置命令」

  1.打开httpd.conf文件(/etc/httpd/conf)

服务器配置_服务器配置查看命令 服务器设置
_服务器设置
查察

下令
「服务器查询配置命令」 行业资讯

  2.找到#Includeconf/extra/httpd-vhosts.conf这句,将之前的#号去掉,开启假造主机设置。假如没有找到#Includeconf/extra/httpd-vhosts.conf这句,则找到假造主机设置文件路径,在httpd.conf中添加”Include假造主机设置文件路径”。

  3.编辑假造主机设置文件(/usr/share/doc/httpd-2.4/httpd-vhosts.conf)

VirtualHost*:80ServerAdminwebmaster@dummy-host1.example.comDocumentRoot"/Apache24/docs/dummy-host1.example.com"ServerNamedummy-host1.example.comServerAliaswww.dummy-host1.example.comErrorLog"logs/dummy-host1.example.com-error.log"CustomLog"logs/dummy-host1.example.com-access.log"common/VirtualHostVirtualHost*:80ServerAdminwebmaster@dummy-host2.example.comDocumentRoot"/Apache24/docs/dummy-host2.example.com"ServerNamedummy-host2.example.comServerAliaswww.dummy-host2.example.comErrorLog"logs/dummy-host2.example.com-error.log"CustomLog"logs/dummy-host2.example.com-access.log"common/VirtualHost

  4.编辑hosts文件(/etc/hosts)

在hosts文件中添加以下内容:127.0.0.1ser1.com127.0.0.1ser2.com

  5.重启服务器:servicehttpdrestart到此多站点设置完成

服务器配置_服务器配置查看命令 服务器设置
_服务器设置
查察

下令
「服务器查询配置命令」 行业资讯

  泉源:lonelyworld.cn

你可能想看:

客户评论

我要评论