Solved

mod_rewrite, probably a server setup problem - 500 points

Posted on 2006-10-28
13
249 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

840 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