Solved

mod_rewrite, probably a server setup problem - 500 points

Posted on 2006-10-28
13
246 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
Comment Utility
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
Comment Utility
> 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
Comment Utility
A, ee. Better do: chmod 0644 .htaccess # apache have to be able to read it ;)
0
 

Author Comment

by:1979dan
Comment Utility
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
Comment Utility
> 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
Comment Utility
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
Backup Your Microsoft Windows Server®

Backup 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
Comment Utility
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
Comment Utility
> 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

763 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now