Pages: [1]   Go Down
  Print  
Author Topic: Apache Question...  (Read 1903 times)
0 Members and 2 Guests are viewing this topic.
Tom
Administrator
Senior Member
*
Offline Offline

Posts: 5,618



View Profile WWW
« on: February 16, 2005, 04:42:00 PM »

I've been playing around with creating a private directory with Apache.  The process seems easy enough, but I keep getting an Internal Server Error when I try to access the directory.  Here's what I've done:

The name of the directory is, "private".

httpd.config:
AllowOverride All  (temporarily)

.htaccess:
AuthUserFile c:/clients/queststudios/public_html/private/.htpasswd
AuthName Private Directory
AuthType Basic

<Limit GET>
require valid-user
</Limit>

Then I run the htpasswd program and generate a Login and Password, which seems to work properly.

As Quest Studios is setup as a virtual host, does this need to be contained within a <Directory> tag under the virtual host?  I haven't read anything that would indicate that; the htaccess command is a general server directive, I believe, and not specific to any specific virtual host.

On another topic:
When you access queststudios.com, you're immediately redirected to http://queststudios.com/quest/Sierra1.html.  This redirect is contained in the virtual host tag.  However, the way I set it up isn't making sense to me.  I used the line:

Redirect /index.html http://queststudios.com/quest/Sierra1.html

Seems to me I should simply be able to use:

Redirect /index.html /quest/Sierra1.html

But Apache won't run when I tried that.  Is it that I have to spell out the complete Windows path to the redirect, like:

Redirect /index.html c:/clients/queststudios/public_html/quest/Sierra1.html

(At least with Unix, I always knew how to setup full paths.)  Smiley
Logged

laxdragon
Member
*
Offline Offline

Posts: 42



View Profile WWW
« Reply #1 on: February 16, 2005, 06:45:45 PM »

First with "Internal Server Error" messages you can always check your apache error log to see the details of the error message. It could be a permissions thing, the files need to be readable by the user/group apache is in. No idea where the Win32 version of apache keeps its log though. The httpd.conf should let you know where,

Since you have the AllowOverride set to all, any directives set in .htaccess should be allowed. Make sure the AllowOverride is in set the correct <Directory> tags though.

The second param of redirect needs to be a full URL or it will error. If you want, you can also place this in the .htaccess file. Nice things about .htaccess you can change them without needing to restart apache over the httpd.conf file.
Logged
Tom
Administrator
Senior Member
*
Offline Offline

Posts: 5,618



View Profile WWW
« Reply #2 on: February 16, 2005, 07:02:07 PM »

It's working now.  I checked the error log this morning, but the error didn't make sense  -- until it dawned on me what it was actually saying....

...the AuthName realm had to be in "quotes".  Duh.

Quote
Nice things about .htaccess you can change them without needing to restart apache over the httpd.conf file.
 


Yeah, that is preferable.  I went with using the httpd.conf file for the redirect because I read somewhere that it's less strain on the server.  Whether it would even make a noticeable difference either way, I didn't even experiment with.

I really appreciate yours, Laust, and Martin's expertise and help.  Maybe in a few years, I'll be able to answer some questions instead of always asking them.  Smiley
Logged

Pages: [1]   Go Up
  Print  
 
Jump to: