昨天 localhost 仍在工作,但今天早上 localhost 出现 500 内部服务器错误。
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
这里是日志:
/var/log/apache2/error.log
[Tue Dec 17 11:44:36 2013] [alert] [client 127.0.0.1] /.htaccess: Invalid command 'disable', perhaps misspelled or defined by a module not included in the server configuration
access.log
127.0.0.1 - - [17/Dec/2013:11:44:36 +0700] "GET /favicon.ico HTTP/1.1" 500 630 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36"
我的/etc/hosts
:
127.0.0.1 localhost
127.0.1.1 asus
127.0.1.1 kd.com
127.0.1.1 www.kd.com
127.0.1.1 angga.net
127.0.1.1 www.angga.net
127.0.1.1 www.dok.com
127.0.1.1 dok.com
我尝试过这个:
root ~ # a2enmod rewrite
Module rewrite already enabled
root ~ # a2enmod
Your choices are: actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authnz_ldap authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta cgi cgid charset_lite dav dav_fs dav_lock dbd deflate dir disk_cache dump_io env expires ext_filter file_cache filter headers ident imagemap include info ldap log_forensic mem_cache mime mime_magic negotiation php5 proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi reqtimeout rewrite setenvif speling ssl status substitute suexec unique_id userdir usertrack version vhost_alias
Which module(s) do you want to enable (wildcards ok)?
rewrite
Module rewrite already enabled
这是我的规格:
root ~ # uname -a
Linux asus 3.8.0-35-generic #50~precise1-Ubuntu SMP Wed Dec 4 17:25:51 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
root ~ # php -v
PHP 5.3.10-1ubuntu3.9 with Suhosin-Patch (cli) (built: Dec 12 2013 04:27:25)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
root ~ # apache2 -v
Server version: Apache/2.2.22 (Ubuntu)
Server built: Jul 12 2013 13:37:10
root ~ # mysql --version
mysql Ver 15.1 Distrib 5.5.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.1
.htaccess
编辑我:我的目录中没有/var/www/
。
编辑2:
这是我的 apache2.conf
http://www.heypasteit.com/clip/13G7
这里是 ls -al /var/www
答案1
解决了。今天我尝试了所有方法来解决这个问题,最后我删除了 apache2,然后重新安装。但是当我编辑000-default
文件时,我在/
根目录中看到了 .htaccess,所以我重命名了文件,然后恢复了我的虚拟 TLD 域,它就可以正常工作了。谢谢 adv。