Solved

mod_rewrite, probably a server setup problem - 500 points

Posted on 2006-10-28
13
248 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
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 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.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

770 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