apache常見的錯(cuò)誤
1.重啟apche(service httpd restart)的時(shí)候提示:
正在啟動(dòng) 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.tjdsmy.cn:80,修改為:ServerName localhost:80即可。
補(bǔ)充說明:平時(shí)在安裝二進(jìn)制文件的時(shí)候會(huì)提示說填寫一個(gè)域名和端口,就是配置的這里。
2.thinkphp采用URL_MODEL=2,即采用rewrite的時(shí)候,發(fā)現(xiàn)http://www.tjdsmy.cn/list?cid=3打不開網(wǎng)頁。提示404.
解決方法:打開手冊查看的了下URL重寫部分,發(fā)現(xiàn)是apache配置問題。打開vi /etc/httpd/conf/httpd.conf,修改:AllowOverride None 將None改為 All。
3.在apache配置文件httpd.conf中想配置多個(gè)域名指向一個(gè)目錄(即一個(gè)網(wǎng)站)的時(shí)候,重啟apache出現(xiàn)錯(cuò)誤:
ServerName takes one argument, The hostname and port of the server
解決方法:將修改為ServerAlias,或者是再添加一個(gè) ServerAlias。
方法1
NameVirtualHost *:80
<VirtualHost *:80>
ServerAlias www.tjdsmy.cn landui.com
DocumentRoot "/var/www/landui.com"
</VirtualHost>
方法2
NameVirtualHost *:80
<VirtualHost *:80>
ServerName landui.com
ServerAlias www.tjdsmy.cn
DocumentRoot "/var/www/landui.com"
</VirtualHost>
會(huì)員登錄
賬號(hào)登錄還沒有賬號(hào)?立即注冊