2

I installed Ubuntu 11.04, then installed apache2 and php5. The problem is, it gives me 500 even for phpinfo(); script. The CLI version works fine, by the way. What could be wrong?

And another question: how do I run apache in debug mode from its init.d script or just run it with the correct environment variables?

UPD: in the errors.log it writes:
[Mon May 30 23:41:40 2011] [alert] [client 127.0.0.1] /www/phpmyadmin/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

The content of the .htaccess is this:

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]

It is default .htaccess shipped with PHPMyAdmin, and it worked fine on my F14 system (I tarred the whole thing when I had had enough of GNOME 3). Strangely enough, the test page does work without any .htaccess file. What can be the reason for this error then? Does RewriteEngine come in separate package now?

3
  • 500 is a fairly broad error code. Anything in the error log that would help narrow it down?
    – Alex
    May 30, 2011 at 16:02
  • Try to increase error level "LogLevel warn" in httpd.conf (it may be debug, info, notice, warn, error, crit, alert, emerg) Begin with "info" and look for something abnormal in the error log. Try to post it here.
    – HUB
    May 30, 2011 at 16:16
  • There is this thing: [Mon May 30 23:41:40 2011] [alert] [client 127.0.0.1] /www/phpmyadmin/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration May 30, 2011 at 16:43

2 Answers 2

3

Are you sure you have mod_rewrite enabled?

Try issuing:

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

and see if the problem persists.

1
  • Yep, that was it. Crazy defaults, if you ask me :D May 30, 2011 at 17:34
1

From your error, the problem is with a configuration in your .htaccess file located in the phpmyadmin folder. You can either rename this file to make sure apache does not take it into account as htaccess, or post it here for review.

Please note: this error you posted is for a particular directory. If you try phpinfo() outside of the phpmyadmin folder it should still work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .