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
https://forums.phpfreaks.com/topic/208766-internal-server-error/
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/).

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.