Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can !
Moderator: General Moderators
jaoudestudios
DevNet Resident
Posts: 1483 Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey
Post
by jaoudestudios » Wed Jan 14, 2009 1:08 pm
Ah hah, half way down the httpd.conf file....Nope it does not
. Spot on
pytrin
I recommend backing up your current httpd.conf file and then make changes - that way you can always go back to the original.
Currently you have this in your httpd.conf file...
Code: Select all
<Directory />
Options SymLinksIfOwnerMatch
AllowOverride None
</Directory>
But you need this...
Code: Select all
<Directory />
Options SymLinksIfOwnerMatch
AllowOverride All
</Directory>
Eran
DevNet Master
Posts: 3549 Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME
Post
by Eran » Wed Jan 14, 2009 1:14 pm
Better not to change the global setting - create an .htaccess file in the directory you want this to perform, or create a directory container for that specific directory in the httpd.conf file:
Code: Select all
<Directory "/path/to/specific/directory" />
AllowOverride All
</Directory>
jaoudestudios
DevNet Resident
Posts: 1483 Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey
Post
by jaoudestudios » Wed Jan 14, 2009 1:18 pm
You will need to restart apache after any config changes.
jaoudestudios
DevNet Resident
Posts: 1483 Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey
Post
by jaoudestudios » Wed Jan 14, 2009 1:19 pm
Graceful might be enough.
Code: Select all
# graceful restart
apachectl graceful
or
# full restart
service httpd restart
EDIT: typo
Last edited by
jaoudestudios on Wed Jan 14, 2009 1:20 pm, edited 1 time in total.
Jordi
Forum Newbie
Posts: 20 Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain
Post
by Jordi » Wed Jan 14, 2009 1:19 pm
my .htaccess file now is:
Code: Select all
<Directory "/var/www/flightschool/" />
AllowOverride All
</Directory>
ErrorDocument 404 http://jordiserres.homeip.net/flightschool/error.php
jaoudestudios
DevNet Resident
Posts: 1483 Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey
Post
by jaoudestudios » Wed Jan 14, 2009 1:20 pm
The <directory "/var..... goes in the httpd.conf file not in the .htaccess file.
Jordi
Forum Newbie
Posts: 20 Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain
Post
by Jordi » Wed Jan 14, 2009 1:24 pm
Sorry guys, but still crazy. I did restart the server after applying the changes, without success.
The current version of the .htaccess file follows, and the http.conf file is now unaltered.
Code: Select all
<Directory "/flightschool" />
AllowOverride All
</Directory>
ErrorDocument 404 http://jordiserres.homeip.net/flightschool/error.php
jaoudestudios
DevNet Resident
Posts: 1483 Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey
Post
by jaoudestudios » Wed Jan 14, 2009 1:35 pm
Jordi wrote:
Code: Select all
<Directory "/flightschool" />
AllowOverride All
</Directory>
ErrorDocument 404 http://jordiserres.homeip.net/flightschool/error.php
Your htaccess file should only contain 1 line...
Code: Select all
ErrorDocument 404 http://jordiserres.homeip.net/flightschool/error.php
Your httpd.conf file should contain...
Code: Select all
<Directory "/var/www/flightschool" />
AllowOverride All
</Directory>
Jordi
Forum Newbie
Posts: 20 Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain
Post
by Jordi » Wed Jan 14, 2009 1:50 pm
No luck. I set the httpd.conf and .htaccess files as you suggested, restarted the server and.. everything is performing with no changes.
It's getting late for me, and I guess for you too. I'll try to fix it tomorrow and I'll let you know if I succeed.
Thank you so much for your help!
jaoudestudios
DevNet Resident
Posts: 1483 Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey
Post
by jaoudestudios » Wed Jan 14, 2009 1:58 pm
No problem. Sorry we did not manage to fix it yet.
jaoudestudios
DevNet Resident
Posts: 1483 Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey
Post
by jaoudestudios » Thu Jan 15, 2009 4:16 pm
OK OK OK. I think I have it!!?!?!!??!
I manage to get it working the other day when we were chatting, however, I was doing it all on my linux server. I just tried to do the same, i.e. create the .httaccess file on my windows machine and copy it over to my linux server and I got an internal server error. So i opened the file on the command line and some characters were corrupted. I re-wrote the file on the command line and all works fine.
Hope that helps!
Jordi
Forum Newbie
Posts: 20 Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain
Post
by Jordi » Thu Jan 15, 2009 4:19 pm
Thanks, jaoudestudios.
I couldn't carry on with this issue today, so I'll give it a try tomorrow and I'll let you know.
Jordi
Forum Newbie
Posts: 20 Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain
Post
by Jordi » Tue Jan 20, 2009 12:45 pm
Hi again!
After several tests, the issue is fixed now:
The problem was within these lines, formerly uncommented, that seem to apply an unwanted translation to each requested url within the site.
Code: Select all
#<Directory /var/www/>
# RewriteEngine on
# RewriteBase /
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
#</Directory>
At least, after commenting these lines, the apache server shows the expected behaviour when trying to access a non-existing page: it shows either the standard "404: page not found" error or redirects to the file in the .htaccess file.
Thank you guys!
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Tue Jan 20, 2009 1:18 pm
As pytrin pointed out, this looks like an issue with your AllowOverride variable set to low.
I took a quick look at your httpd.conf and it appeared you are setting AllowOverride to the lowest permission ( AllowOverride None).