TurnKey Linux Virtual Appliance Library

Internal Server Error

Hi,

 

I have just downloaded and installed a TurnKey LAMP server on to VMWare Server a Windows Home Server box on my home network. I have done this so that I can run a test bed version of a public joomla website that I own in order to test new functionality. Unfortunately, when I installed the site from a backup I received an Internal Server Error. I describe below the steps that I took:

  • Installed the LAMP server from the vmdk file that you provide (performed two days ago).
  • Installed SAMBA and modified the smb.conf file with a net bios command to enable my windows workgroup PCs on the network to identify the LAMP server with the imaginative name "lamp". I was particularly proud of that.
  • I created a directory /var/www/mysite and copied an Akeeba backup and kickstart.php file to that location.
  • I also of course created a new mysql database for this site. I did not add any further users to this database.
  • I typed lamp/mysite/kickstart.php into a web browser and then went through the Akeeba installation process. For the mysql parameters, I used my new database with username root and a blank password.
  • At the end of the Akeeba installation, I clicked its button to clean up installation files (thus deleting the kickstart.php file and the joomla installation directory).
  • When I tried to navigate to /lamp/mysite, I received a "500 Internal Server Error".
  • I then retrieved the following entry from the /var/log/apache2/error.log file:
    		
    
    		/var/www/mlpa/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

 

I am now stuck and would really appreciate some assistance. By way of background, while I am technically competent, I have little LINUX or server experience (I was a UNIX/C programmer 20 years back, but that no longer really counts). Everything I have done is culled only from a number of Google searches, and therefore I have probably made a bit of a schoolboy error somewhere along the way. I have attached a copy of what is in the .htaccess file.

Regards,      Simon

Attached: 

enable mod_rewrite

Go into Webmin and enable mod_rewrite under the Apache config.  I don't think it is enabled by default.

Already enabled

Thanks Dan, however it is already enabled. Any further ideas?

Cheers,    Simon


Your .htaccess file looks

Your .htaccess file looks good to me, I still suspect it has something to do with mod_rewrite.  Have you restarted the apache service?

Maybe try something like this.  If your module is not enabled it shouldn't throw an error, but fancy url's wouldn't work either.

	Options +FollowSymLinks


<IfModule mod_rewrite.c>
	RewriteEngine On

	RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
	RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
	RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
	RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
	RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
	RewriteRule ^(.*)$ index.php [F,L]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_URI} !^/index.php
	RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
	RewriteRule (.*) index.php

	RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

Enabling 'rewrite' module worked for me.

I had the same issue, after enabling 'rewrite' module (Servers > Apache Webserver > Global Configuration > Configure Apache Modules) and restart apache -by webmin- everything worked. Thanks Dan!

Stopping and starting the server fixed the issue

Hi Dan,

You'd think the old "turn off and on again" trick would have been obvious to me - but embarrassingly it wasn't. This of course fixed the problem. Can you hear the sound of my palm slapping my forehead across the Atlantic?

Thanks for the help, Simon


Jeremy's picture

Glad you got it working

For your info, you don't actually need to restart your whole server (although obviously it doesn't do any harm). In the current TKL stable release (based on Ubuntu 8.04) you can restart apache like this:

/etc/init.d/apache2 restart

The command can be used with other services - just replace apache2 with the service name, eg samba / mysql. You can also start and stop services too (replace restart with stop or start as desired). Some (most?) services also respond to reload which will reload config files without restarting the service itself (not sure which ones off the top of my head, you'll have to have a play).

As a heads up, things will be different in the next TKL release (based on Ubuntu 10.04/Lucid) because it uses a new system called upstart for many services, but you won't need to worry about that for a while. If you're curious, Liraz posted some info about it over here.

Hopefully that info is of some use to you.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)