Solved

mod_rewrite, probably a server setup problem - 500 points

Posted on 2006-10-28
13
251 Views
Last Modified: 2013-12-15
I've tried everything and can't get it to work.  Running PHP5 on Apache/2.2.0 (Fedora)

I have the mod_rewrite module loaded in Apache, checked with phpinfo()
I am using a  .htaccess file, which has full permissions 777 set, with a simple bit of code:

Options +FollowSymLinks
RewriteEngine On

This creates an Internal Server 500 error.  Have also tried it without the, Options +FollowSymLinks. So just:

RewriteEngine On

Still creates a 500. There are no spaces in .htaccess file.  I have tried a set of rules too, but thought I would try with the very least amount of data to start with.

I have edited httpd.conf - uncommenting:

LoadModule rewrite_module modules/mod_rewrite.so

Did try adding AddModule mod_rewrite.c but crashed the whole server, later found out that's for Apache 1x not 2x, doh.

Have gone through httpd.conf and changed all instances of:

AllowOverride None
to
AllowOverride All

Have restarted httpd and rebooted-restarted the server.

Still no joy, don't know what else to try, if I look at another mod_rewrite tutorial explaining the same steps I'm going to crack, lol.

So then, for an aptly assigned 500 points, can you help me get mod_rewrite working?

Cheers.
0
Comment
Question by:1979dan
13 Comments
 
LVL 15

Expert Comment

by:periwinkle
ID: 17827469
With the 500 error, are there any additional pieces of information in the error_log and/or access_log?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17828133
> I am using a  .htaccess file, which has full permissions 777 set, with a simple bit of code:
It can't have full permissions! chmod 0600 .htaccess

Check the error log as well.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17828137
A, ee. Better do: chmod 0644 .htaccess # apache have to be able to read it ;)
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:1979dan
ID: 17828300
Hi all,

Can you tell I'm new to Linux? lol

Well, I looked in /var/log/httpd - there's a warning in one of the error logs but it doesn't have any bearing on this problem (I think, but is something else I will need to fix):

PHP Warning:  Module 'mysql' already loaded in Unknown on line 0


To try and take the .htaccess out of the equation I moved the rules into the httpd.conf file but still no luck.

ravenpl, not sure I understand the last part of your comment, can you elaborate?

Cheers.


0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17828454
> ravenpl, not sure I understand the last part of your comment, can you elaborate?
If .htaccess is world writeable (by anyone), then apache reports this as an error. I suggested You to change permissions so only owner can write .htaccess file.

But if You removed the .htaccess file and there's still error - some other misconfiguration must exist.
0
 

Author Comment

by:1979dan
ID: 17828474
Indeed.  

The module must be enabled because it shows up in a test phpinfo() page - I don't know what other config it requires.

I really am stumped :(

0
 

Author Comment

by:1979dan
ID: 17829960
I've fixed the problem - it was down to the  vhost.conf required each domain to have a AllowOverride All.

Sorry, can't award any points because I had to do it myself.  Only fair - thansk for the input.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17832149
> But if You removed the .htaccess file and there's still error - some other misconfiguration must exist.
Well You said 'indeed' - I understood that You have removed .htaccess - aparently You havent - You just needed more AllowOverride.
0
 

Author Comment

by:1979dan
ID: 17832752
Indeed, as in it's bloomin' obvious that "some other misconfig" is at fault, you really are clutching at straws if you think that saying "some other misconfig" is going to get any points, come off it!
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17832793
No, i'm not going for any points. I have enought.
Just saying You were not clear enought - just for future questions...
0
 

Author Comment

by:1979dan
ID: 17832922
I wasn't holding back any information I knew about at the time of writing.

Sorry, if I seemed blunt, cheers 4 your input, Dan.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18023752
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question