您当前位置:知识库 >网站相关 >网站运营 >浏览文章

apache常见的错误

来源:不详 日期:2019/1/5 17:03:04 阅读量:(0)

1.重启apche(service httpd restart)的时候提示:

正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

解决方法:vi /etc/httpd/conf/httpd.conf,找到#ServerName www.feedoo.cn:80,修改为:ServerName localhost:80即可。

补充说明:平时在安装二进制文件的时候会提示说填写一个域名和端口,就是配置的这里。

 

2.thinkphp采用URL_MODEL=2,即采用rewrite的时候,发现http://www.feedoo.cn/list?cid=3打不开网页。提示404.

解决方法:打开手册查看的了下URL重写部分,发现是apache配置问题。打开vi /etc/httpd/conf/httpd.conf,修改:AllowOverride None 将None改为 All。

 

3.在apache配置文件httpd.conf中想配置多个域名指向一个目录(即一个网站)的时候,重启apache出现错误:

ServerName takes one argument, The hostname and port of the server

解决方法:将修改为ServerAlias,或者是再添加一个 ServerAlias。

方法1
NameVirtualHost *:80
<VirtualHost *:80>
  ServerAlias www.feedoo.cn feedoo.cn
  DocumentRoot "/var/www/feedoo.cn"
</VirtualHost>
方法2
NameVirtualHost *:80

<VirtualHost *:80>
  ServerName feedoo.cn

  ServerAlias www.feedoo.cn 
  DocumentRoot "/var/www/feedoo.cn"
</VirtualHost>


关键字:
声明:我公司网站部分信息和资讯来自于网络,若涉及版权相关问题请致电(63937922)或在线提交留言告知,我们会第一时间屏蔽删除。
有价值
0% (0)
无价值
0% (10)

分享转发:

发表评论请先登录后发表评论。愿您的每句评论,都能给大家的生活添色彩,带来共鸣,带来思索,带来快乐。