Web Hosting Talk







View Full Version : access.conf/.htaccess


Lmax
10-05-2001, 08:12 PM
Can someone find something wrong in this access.conf since my .htaccess isn't working.
Thanks


##
## access.conf -- Apache HTTP server configuration file
##

# access.conf: Global access configuration
# Online docs at http://www.apache.org/

# This file defines server settings which affect which types of services
# are allowed, and in what circumstances.

# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).

# Originally by Rob McCool

# First, we configure the "default" to be a very restrictive set of
# permissions.

<Directory />
Options None
AllowOverride All
AuthFailDelay 2000000
</Directory>

# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.

# This should be changed to whatever you set DocumentRoot to.

<Directory /home/sites/>

# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".

# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.

Options Indexes FollowSymLinks Includes MultiViews
#Options -Indexes SymLinksIfOwnerMatch MultiViews

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"

AllowOverride All

# ignore .ht*
<Files ".ht*">
deny from all
</Files>

# Controls who can get stuff from this server.

order allow,deny
allow from all

AuthFailDelay 2000000
</Directory>

# be more restrictive within a site
<Directory /home/sites/*/>
#Options Indexes FollowSymLinks Includes MultiViews
Options -FollowSymLinks +SymLinksIfOwnerMatch
</Directory>


# @@ServerRoot@@/cgi-bin should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.

#<Directory /home/httpd/cgi-bin>
#AllowOverride None
#Options ExecCGI
#</Directory>

# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your_domain.com" to match your domain to enable.

#<Location /server-status>
#SetHandler server-status

#order deny,allow
#deny from all
#allow from .your_domain.com
#</Location>

# There have been reports of people trying to abuse an old bug from pre-1.1
# days. This bug involved a CGI script distributed as a part of Apache.
# By uncommenting these lines you can redirect these attacks to a logging
# script on phf.apache.org. Or, you can record them yourself, using the script
# support/phf_abuse_log.cgi.

#<Location /cgi-bin/phf*>
#deny from all
#ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi
#</Location>

# You may place any other directories or locations you wish to have
# access information for after this one.

freakysid
10-05-2001, 08:20 PM
From the bin directory inside your apache directory you should run the following from bash:

apachectl configtest

This will then tell you which line the error occurs on.

davidb
10-05-2001, 09:45 PM
AllowOverride All <<<<good

# ignore .ht*
<Files ".ht*">
deny from all << bad
</Files>



remove that files part

freakysid
10-05-2001, 10:19 PM
Actually, if you want to use a regular expression inside a <Files> directive shouldn't you use the ~ character?

<Files ~ "\.ht">

or use <FilesMatch "\.ht"> for versions of apache 1.2 and above ???

Also, note my regex. you have to escape the '.' character. Also, I don't know if its a good idea to be puting in the * at the end like that - the way you have done it. But mind you - I'm pretty bad at regex.

Otherwise, I don't see what is illegal about having Deny from all inside the Files tags? Very strange though - because it is saying deny files including .html .htm

Tim Greer
10-06-2001, 04:46 AM
The "deny all" for .ht* files is not a bad thing at all, in fact, you WANT that... otherwise, people could view your .htaccess and .htpasswd files from their web browser.

What you want for that (to deny viewing of such files), is this:

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

As for the problems you're having... What is or is not working, exactly? What have you tried to test it or not? Finally, what version of Apache are you running? access.conf is pretty dated and isn't used anymore.. your version must be pretty dated. I could suggest some reasons for the errors, but I don't know what you're trying to do or what gives you errors exactly... Can you provide a little more detail?

Lmax
10-06-2001, 05:36 AM
Well, i was using apache 1.3.6 and all worked fine. Now i upgraded to 1.3.20 and nothing worked. I also tried 1.3.19, without luck.

My problem is that directories with htaccess in it become totally inaccesible. There is no popup asking for a password, just a "page not found" error

The htaccess file isn't the problem. I didn't change that. I also tried some other htacces files, still no luck.
So the problem should be something with the access.conf.

Thanks for the help.

Jm4n
10-06-2001, 06:59 AM
First, make sure you keep the lines denying .ht* files, you do not want to change that. What you have is depricated but should still work.

Second, I haven't used the older (multiple file) Apache config in a while, so I don't know which file this belongs -- but make this appears in one of your *.conf files:

AccessFileName .htaccess

If it doesn't appear anywhere, place it in access.conf near your <Files> directive.

For reference, my config has this:

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

Lmax
10-06-2001, 08:24 AM
When i added
AccessFileName .htaccess
i got a syntax error. I've put it between the <directory> tags.
Putting it before the <directory> tags didn't produce the syntax error but also doesn't solve the problem.

Any other suggestions??

Thanks

Lmax
10-07-2001, 08:20 PM
Also a strange thing is that htaccess is working for the admserv(it's a raq3) which is running with the same httpd.
Checked the access.conf for both servers but could find strange differences.

Lmax
10-14-2001, 06:41 PM
Since my "little" problem still isn't solved i've done some checking. I think i miss the right modules. mod_accss wasn't installed for example.
Which modules are required for htaccess?? Then i'll try to install them. mod_access alone didn't solve the problem.