#ServerName new.host.name:80 改为 ServerName server (去掉了前面的#号,我的主机名称是server)
#NameVirtualHost *:80 改为 NameVirtualHost *: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 commmon
#
(在这下面添加了以下内容)
ServerAdmin xxx@gmail.com
DocumentRoot /var/www/html
ServerName www.xxx.us
ErrorLog logs/error_log
CustomLog logs/access_log combined
然后重启HTTP服务,/etc/rc.d/init.d/httpd restart
但是用域名或者用IP都无法无法打开网站,请懂的朋友帮忙看一下需要怎么设置,最好详细一点,我是新手,正在学习linux,所以不是很了解linux各方面。
看见有的文章说要修改linux下的/etc/hosts文件,我这里hosts文件是这样的,请帮忙看一下这样需要修改什么不:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 server localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
堕落kiss 于 2011-02-01 22:32:46发表:
你的iptable打开80端口了吗?设置的话可以下文档 http://www.phpchina.com/manual/apache/vhosts/index.html
weatny 于 2011-01-30 14:07:39发表:
深奥的问题 呵呵