Grandioso Posted July 24, 2010 Share Posted July 24, 2010 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> Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 24, 2010 Share Posted July 24, 2010 Is the - LoadModule rewrite_module modules/mod_rewrite.so line in your httpd.conf uncommented? Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/#findComment-1090651 Share on other sites More sharing options...
Grandioso Posted July 25, 2010 Author Share Posted July 25, 2010 My /etc/apache2/httpd.conf file is empty... so I pasted the line you suggested in it, but it still doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/#findComment-1090860 Share on other sites More sharing options...
wildteen88 Posted July 25, 2010 Share Posted July 25, 2010 My /etc/apache2/httpd.conf file is empty... so I pasted the line you suggested in it, but it still doesn't work. You seem to be using a linux on your server. What distribution are you using? Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/#findComment-1090863 Share on other sites More sharing options...
Grandioso Posted July 25, 2010 Author Share Posted July 25, 2010 Yep, I forgot to mention.. i run Ubuntu 10.04. Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/#findComment-1091034 Share on other sites More sharing options...
cags Posted July 26, 2010 Share Posted July 26, 2010 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/). Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/#findComment-1091171 Share on other sites More sharing options...
Grandioso Posted July 26, 2010 Author Share Posted July 26, 2010 It works now. I had to restart the computer (I usually only put it to sleep). Thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/#findComment-1091237 Share on other sites More sharing options...
cags Posted July 26, 2010 Share Posted July 26, 2010 You probably only needed to restart Apache. It is always necessary to restart to make configurations take effect. Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/#findComment-1091244 Share on other sites More sharing options...
wildteen88 Posted July 26, 2010 Share Posted July 26, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/208766-internal-server-error/#findComment-1091363 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.