#LoadModule vhost_alias_module modules/mod_vhost_alias.so 这是虚拟主机的模块,要打开 # Include conf/extra/httpd-vhosts.conf 这是虚拟主机的配置文件,你看的教程太老了,新版的配置文件都分开了井号都去掉,虚拟主机设置写在conf/extra/httpd-vhosts.conf里面就行了
#LoadModule vhost_alias_module modules/mod_vhost_alias.so # Include conf/extra/httpd-vhosts.conf LS你好,我看了在http.conf里没有这两行,我去掉#号自己添加了,保存后重启apache 还是提示那个错误,貌似模块没有加载成功
谢谢两位的回答,已经没报错了,只是还有点小问题 服务器上有两个网站,输入第二个网址还是会跳到第一个站上,呵呵 NameVirtualHost *:80# # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot D:/EmpireServer/web ServerName gamesdiy.com ServerAlias www.gamesdiy.com ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/ ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800" CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined </VirtualHost><VirtualHost *:80> ServerAdmin [email protected] DocumentRoot D:/EmpireServer/web/www ServerName game123gogogo.com ServerAlias www.game123gogogo.com ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/ ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800" CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined </VirtualHost>
嗯 我照你的方法做了 重启apache后没有报错 不过网站域名设置貌似有点问题,两个网站不管输入那个网址都是进入第一个网站 麻烦你帮我看下是不是这里设置错误了,我是照网上的方法改的 conf/extra/httpd-vhosts.conf文件: NameVirtualHost *:80 # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot D:/EmpireServer/web ServerName gamesdiy.com ServerAlias www.gamesdiy.com ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/ ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800" CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot D:/EmpireServer/web/www ServerName game123gogogo.com ServerAlias www.game123gogogo.com ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/ ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800" CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined </VirtualHost>
是不是httpd-vhosts的模块未定义?
因为一些问题不能重新安装PHP,APACHE,MYSQL,所以调起来很麻烦,配置估计都不和你的一样
谢谢你的热心解答 httpd.conf文件挺大的 你看下吧http://202.173.255.24/http.txt
我分不多,不好意思
这是虚拟主机的模块,要打开
# Include conf/extra/httpd-vhosts.conf
这是虚拟主机的配置文件,你看的教程太老了,新版的配置文件都分开了井号都去掉,虚拟主机设置写在conf/extra/httpd-vhosts.conf里面就行了
# Include conf/extra/httpd-vhosts.conf
LS你好,我看了在http.conf里没有这两行,我去掉#号自己添加了,保存后重启apache
还是提示那个错误,貌似模块没有加载成功
服务器上有两个网站,输入第二个网址还是会跳到第一个站上,呵呵
NameVirtualHost *:80#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot D:/EmpireServer/web
ServerName gamesdiy.com
ServerAlias www.gamesdiy.com
ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/
ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800"
CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined
</VirtualHost><VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot D:/EmpireServer/web/www
ServerName game123gogogo.com
ServerAlias www.game123gogogo.com
ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/
ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800"
CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined
</VirtualHost>
怎么第二站的域名总跳到第一个站的内容上
修改这种设置后要重启apache
不过网站域名设置貌似有点问题,两个网站不管输入那个网址都是进入第一个网站
麻烦你帮我看下是不是这里设置错误了,我是照网上的方法改的 conf/extra/httpd-vhosts.conf文件:
NameVirtualHost *:80 #
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot D:/EmpireServer/web
ServerName gamesdiy.com
ServerAlias www.gamesdiy.com
ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/
ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800"
CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined
</VirtualHost> <VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot D:/EmpireServer/web/www
ServerName game123gogogo.com
ServerAlias www.game123gogogo.com
ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/
ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800"
CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined
</VirtualHost>