Ubuntu 11.04 中的 apache+PHP 给了我 500

Ubuntu 11.04 中的 apache+PHP 给了我 500

我安装了 Ubuntu 11.04,然后安装了 apache2 和 php5。问题是,即使是 phpinfo(); 脚本也给我 500。顺便说一句,CLI 版本运行良好。可能出了什么问题?

还有一个问题:如何从其 init.d 脚本以调试模式运行 apache,或者仅使用正确的环境变量运行它?

更新型多巴胺:在 errors.log 中,它写道:
[2011 年 5 月 30 日星期一 23:41:40] [警报] [客户端 127.0.0.1] /www/phpmyadmin/.htaccess: 无效命令“RewriteEngine”,可能是拼写错误或由服务器配置中未包含的模块定义

.htaccess的内容如下:

RewriteEngine on

# Allow only GET and POST verbs
RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR]

# Ban Typical Vulnerability Scanners and others
# Kick out Script Kiddies
RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|wkito|pikto|scan|acunetix).* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR]

# Ban Search Engines, Crawlers to your administrative panel
# No reasons to access from bots
# Ultimately Better than the useless robots.txt
# Did google respect robots.txt?
# Try google: intitle:phpMyAdmin intext:"Welcome to phpMyAdmin *.*.*" intext:"Log in" -wiki -forum -forums -questions intext:"Cookies must be enabled"
RewriteCond %{HTTP_USER_AGENT} ^.*(AdsBot-Google|ia_archiver|Scooter|Ask.Jeeves|Baiduspider|Exabot|FAST.Enterprise.Crawler|FAST-WebCrawler|www\.neomo\.de|Gigabot|Mediapartners-Google|Google.Desktop|Feedfetcher-Google|Googlebot|heise-IT-Markt-Crawler|heritrix|ibm.com\cs/crawler|ICCrawler|ichiro|MJ12bot|MetagerBot|msnbot-NewsBlogs|msnbot|msnbot-media|NG-Search|lucene.apache.org|NutchCVS|OmniExplorer_Bot|online.link.validator|psbot0|Seekbot|Sensis.Web.Crawler|SEO.search.Crawler|Seoma.\[SEO.Crawler\]|SEOsearch|Snappy|www.urltrends.com|www.tkl.iis.u-tokyo.ac.jp/~crawler|SynooBot|[email protected]|TurnitinBot|voyager|W3.SiteSearch.Crawler|W3C-checklink|W3C_Validator|www.WISEnutbot.com|yacybot|Yahoo-MMCrawler|Yahoo\!.DE.Slurp|Yahoo\!.Slurp|YahooSeeker).* [NC]
RewriteRule .* - [F]

它是 PHPMyAdmin 附带的默认 .htaccess,在我的 F14 系统上运行良好(当我厌倦了 GNOME 3 时,我将整个东西打包了)。奇怪的是,测试页面在没有任何 .htaccess 文件的情况下也能工作。那么这个错误的原因是什么?RewriteEngine 现在包含在单独的包中吗?

答案1

您确定已经mod_rewrite启用吗?

尝试发出:

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

看看问题是否仍然存在。

答案2

从您的错误来看,问题出在位于 phpmyadmin 文件夹中的 .htaccess 文件中的配置。您可以重命名此文件以确保 apache 不会将其视为 htaccess,也可以将其发布在此处以供审核。

请注意:您发布的这个错误是针对特定目录的。如果您在 phpmyadmin 文件夹外尝试 phpinfo(),它应该仍然有效。

相关内容