Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Request for .htaccess

Status
Not open for further replies.

rphips

IS-IT--Management
Sep 12, 2003
590
US
Hello, Never worked in SUSe Linux 9 enterprise before or even performed Web server management until now.

I have read all the docs that came with SUSe, queried Google - and read there links, and even searched Tek-tips and all I find is how to.

The document are straight foward - and I wrote my .htaccess file as follows.

AuthName "Restricted site"
AuthType Basic
AuthUserFile /path to .htpasswd
AuthGroupFile /dev/null
require valid-user

Then I generated the .htpasswd using apache2 .htpasswd tool

Then went into the httpd.conf and change
AllowOverride None to AllowOverride AuthConfig

But it doesn't work!!!!

It is a simple setup go to the web site (open to public) and if you want to go to members only section (prompt for login and password) but right now I get no prompt - what am I doing wrong

Please help been on this for 2 days now and nothing seem to work.






bob

"ZOINKS !!!!!"

Shaggy

 
Thanks for your assistance

Yes I restarted the whole machine - at first I just tried

kill all -1 httpd

but since I am not getting the prompt for a password i rebooted the whole system - still the same

nothing [banghead]

bob

"ZOINKS !!!!!"

Shaggy

 
Hi

Are you sure the [tt]AllowOverride[/tt] directive you modified applies to that member directory too ?

Are you sure the per directory configuration file's name is .htaccess ?

Are you sure the .htaccess file and the path to it is readable for the web server's user ?

Feherke.
 
Hello feherke


1. When I put the AllowOverride in the httpd.conf I no longer had access to the WEB site not even the public sector.

<Directory /srv/option - indexes FollowSymlinks
AllowOverride AuthConfig
Order allow, deny
Allow from all
</Directory>

2.Yes in the /srv/ the file is .htaccess

3. the web site opens for anybody and when I click on the members only link it opens to everybody to.



bob

&quot;ZOINKS !!!!!&quot;

Shaggy
 
thedaver

I just checked my httpd.conf file and they have quotes on both ends.

<Directory "/srv/
It seems I made a typo in my answer - but hey I willing to check it a thousand times if I can get it to work.

Also with that code in the httpd.conf I cannot see the web site at all



bob

&quot;ZOINKS !!!!!&quot;

Shaggy
 
Hello

Here is a follow up since I have found the answer to my problem.

In Suse 9 Enterprise server - with Apache2 it seems that there are 3 files you have to modify to get .htaccess to work.

If you put the site into the /srv/ directory then .htaccess does not function at all.

So I moved them to /home/ and came up with access denied so I had to modify the following files and now it works perfectly.

1. httpd.conf file located in /etc/apache2 directory - here is where you place the following:
<Directory /srv/AllowOverride AuthConfig
Order allow, deny
Allow from all
</Directory>

2. httpd.conf file located in /etc/http directory - here is where you change the DocumentRoot from /srv/ where you are placing your files. (remember there are 2 places that need to be changes)

3. default-server.conf file located in /etc/apache2/ directory - here is where you configure the document root from /srv/ to your new location.

If anybody knows of a better way then feel free to post - I would love to know. But this worked for me







bob

&quot;ZOINKS !!!!!&quot;

Shaggy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top