?
Solved

mod_rewrite, probably a server setup problem - 500 points

Posted on 2006-10-28
13
Medium Priority
?
258 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
12 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

829 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