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.example.com:80,修改為:ServerName localhost:80即可。
補充說明:平時在安裝二進制文件的時候會提示說填寫一個域名和端口,就是配置的這里。
2.thinkphp采用URL_MODEL=2,即采用rewrite的時候,發現http://xxx.com/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
解決方法:將ServerName修改為ServerAlias 。
NameVirtualHost *:80
<VirtualHost *:80>
ServerAlias www.domain.com domain.com
DocumentRoot "/var/www/domain.com"
</VirtualHost>