Jump to content

Internal Server Error


Grandioso

Recommended Posts

Hey guys.

 

I'm trying to make .htaccess run on my local server, but I'm getting a 500 Internal Server Error if I write anything in the file.

 

The .htaccess file is simple :

RewriteEngine On
RewriteRule ^([a-z]*)$ /index.php?content=$1

 

and here's my etc/apache2/sites-available/default file

 

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
	Options FollowSymLinks
	AllowOverride all
</Directory>
<Directory /var/www/>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride all
	Order allow,deny
	allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
	AllowOverride All
	Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
	Order allow,deny
	Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride All
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

Link to comment
Share on other sites

The fact that your httpd.conf file is completely empty means that your settings are stored elsewhere. Exactly where will depend on how your server was set-up. On my VPS which is set-up with Parallels and Plesk, the settings for each vhost are within the vhost folder (which in my case can be located at /var/www/vhosts/<hostname>/conf/).

Link to comment
Share on other sites

It works now. I had to restart the computer (I usually only put it to sleep).

 

Thanks anyway :)

Just so you know with Ubuntu the Apache repos comes with some tools, which are a2enmod and a2dismod for enabling/disabling Apache modules. For example if you want to enable mod_rewrite you'll run the following command

sudo a2enmod rewrite

 

Apaches configuration file on Ubuntu is apache2.conf rather than httpd.conf for some reason. However httpd.conf can still be used.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.