#1  
Old 16th June 2007, 00:15
Liac Liac is offline
Junior Member
 
Join Date: Jun 2007
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Question .htaccess

Hello all.

First of all, I hope this is the right forum. Like the title suggests, this thread is all about .htaccess and the headache it causes for me.

To put it simply: it doesn't work. I have spent almost 2 hours trying to figure out why, googled trying to find a solution, but to no avail.

Here's my simple .htaccess:
Code:
ErrorDocument 404 custom404.php
My server is running on a local machine. I'm using Ubuntu Linux Server 7.04 with auto-configured Apache, PHP and MySQL. I must say, this is my first try with Linux ever (!), so if you give a Linux-specific answer, I'd appreciate if you explain it for a newbie .

In /etc/apache2/ I have created a link in "mods-enabled" to rewrite.load in "mods-available". I hope that this has loaded the module (and it apparently has since loading it again with "LoadModule rewrite_module modules/mod_rewrite.so" in apache2.conf issues a warning, that it has already been loaded).

In my apache2.conf, there are also these lines:
Code:
AccessFileName .htaccess
(And at the end...):
Code:
<directory />
AllowOverride All
Options All
</directory>
When I specify the contents of the .htaccess file ("ErrorDocument 404 custom404.php") directly in apache2.conf, it works perfectly. So I guess I have configured something wrong, so that .htaccess files are just ignored.

So, how to make .htaccess files work?

Any help would be really appreciated

Thanks in advance,
Liac
Reply With Quote
Sponsored Links
  #2  
Old 16th June 2007, 01:03
bschultz bschultz is offline
Senior Member
 
Join Date: Jul 2006
Posts: 224
Thanks: 11
Thanked 10 Times in 10 Posts
Default

Add this:

Code:
<Directory "/var/www/web1/web">
	Options FollowSymLinks
	AllowOverride All
</Directory>
To your Apache Directives field in the ISPConfig Control Panel. Of course, change the location of your website directories appropriately...mine are for Debian...not sure where Ubuntu puts it.
Reply With Quote
  #3  
Old 16th June 2007, 02:32
Liac Liac is offline
Junior Member
 
Join Date: Jun 2007
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by bschultz
Add this:

Code:
<Directory "/var/www/web1/web">
	Options FollowSymLinks
	AllowOverride All
</Directory>
To your Apache Directives field in the ISPConfig Control Panel. Of course, change the location of your website directories appropriately...mine are for Debian...not sure where Ubuntu puts it.
Thank you for your reply! I just did that, still doesn't work... I have added
Code:
<Directory "/var/www/">
	Options FollowSymLinks
	AllowOverride All
</Directory>
/var/www/ is where I have my HTTP root. .htaccess files are still ignored.
Reply With Quote
  #4  
Old 16th June 2007, 03:04
bschultz bschultz is offline
Senior Member
 
Join Date: Jul 2006
Posts: 224
Thanks: 11
Thanked 10 Times in 10 Posts
Default

I'm not positive, but I think you have to have the correct document root listed for the domain you are working on. So in the ISPConfig panel for the domain in question, put the correct directory path (including the web1, web2, etc.). If that doesn't work, there is a thread about this topic here:

http://www.howtoforge.com/forums/sho...ight=.htaccess
Reply With Quote
  #5  
Old 16th June 2007, 03:50
Liac Liac is offline
Junior Member
 
Join Date: Jun 2007
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks again for your quick reply.

The point is, I don't have ISPconfig installed. I haven't even forwarded the HTTP port in my router settings, because I only access the server on my LAN. I want to use it as a "playground" to get familiar with Linux and develop my website, so that I can start right away when I'm renting a web server.

So the only document root I have is /var/www/. I have put there every file I need (php files, html files) and I can access them perfectly. Yet, .htaccess does not work.

I hope the problem gets clearer now
Reply With Quote
  #6  
Old 16th June 2007, 07:03
bschultz bschultz is offline
Senior Member
 
Join Date: Jul 2006
Posts: 224
Thanks: 11
Thanked 10 Times in 10 Posts
Default

Place this (after the spot in your first post about apache2.conf):

Code:
<Directory "/var/www/">
	Options FollowSymLinks
	AllowOverride All
</Directory>
under this:

Code:
<directory />
AllowOverride All
Options All
</directory>
Reply With Quote
  #7  
Old 16th June 2007, 17:15
Liac Liac is offline
Junior Member
 
Join Date: Jun 2007
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Still doesn't work

I followed your link to the other thread. I commented

Code:
#<Files ~ "^\.ht">
#    Order allow,deny
#    Deny from all
#</Files>
out and added

Code:
<directory />
AllowOverride All
Options All
</directory>

<Directory "/var/www/">
	Options FollowSymLinks
	AllowOverride All
</Directory>
to my apache2.conf, restarted the server, but it still does not work. It's frustrating. I tried to play around with my settings, even re-installed the server, but to no avail.

Hopefully you or someone else still has an idea on what to do?
Reply With Quote
  #8  
Old 16th June 2007, 18:08
bschultz bschultz is offline
Senior Member
 
Join Date: Jul 2006
Posts: 224
Thanks: 11
Thanked 10 Times in 10 Posts
Default

I'm reaching here....but what are the permissions (and ownership) of your .htaccess file?

Also, run this

Code:
httpd -t
as root from command line. That will check the syntax of the apache config file and tell us what (if any) errors there are.

Last edited by bschultz; 16th June 2007 at 18:12.
Reply With Quote
  #9  
Old 16th June 2007, 18:23
Liac Liac is offline
Junior Member
 
Join Date: Jun 2007
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default

The permissions of the .htaccess file are 777 (read and write for owner, group and others) and the owner is a user I called "stduser". It's the only activated user (in Ubuntu, the root account is disabled by default. But you can still execute commands that require root access. If you are interested how this works, look here: https://help.ubuntu.com/community/RootSudo).

Code:
httpd -t
didn't work. It said "command not found". Instead I tried the following:
Code:
apache2 -t
and it said: "Syntax OK". I hope this helps.
Reply With Quote
  #10  
Old 16th June 2007, 18:30
bschultz bschultz is offline
Senior Member
 
Join Date: Jul 2006
Posts: 224
Thanks: 11
Thanked 10 Times in 10 Posts
 
Default

Then I'm out of ideas...Falko, can you shed some light on this please?
Reply With Quote
The Following User Says Thank You to bschultz For This Useful Post:
Liac (16th June 2007)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
wordpress MU and ISPconfig .htaccess isues palkat General 4 18th October 2006 12:57
ISPConfig and .htaccess ionut89 Feature Requests 1 17th October 2006 18:45
.htaccess login challenge broken with mod_rewrite ozonblue Installation/Configuration 2 13th September 2006 11:09
.htaccess never executed galmiche Server Operation 2 4th June 2006 22:44
No .htaccess in automatic backup? tron Installation/Configuration 3 22nd March 2006 19:03


All times are GMT +2. The time now is 10:13.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.