Gossamer Forum
Home : General : Perl Programming :

htaccess

Quote Reply
htaccess
Hello-

I have successfully created an htaccess file, however, while it protects the admin script it also prevents users from searching, adding a site, etc. Is there a way to configure htaccess to only require a password for the admin.cgi file and not everything else?

Thanks,

Jason

Quote Reply
Re: htaccess In reply to
Hi Jason:

Sounds like you have lumped together your admin and user scripts in one directory. The admin scripts should be in the .htaccess protected admin directory and the user scripts (e.g., add.cgi, modify.cgi, search.cgi) in the directory above the admin directory. Or you have the proper directory structure but you uploaded the .htaccess file to the directory above the admin directory when it should be in the admin directory. That should fix things.


Dan Cool


Quote Reply
Re: htaccess In reply to
Thanks for the response, Dan...

My admin script is in the admin directory with the following files:

drwxr-xr-x HTML
drwxr-xr-x LWP
-rw-rw-rw- Mailer.pm
-rw-rw-rw- Template.pm
-rw-rw-rw- Validator.pm
-rwxrwxrwx admin.cgi
-rw-rw-rw- admin_html.pl
drwxrwxrwx backup
-rw-rw-rw- category.def
drwxrwxrwx data
-rw-rw-rw- db.pl
-rw-rw-rw- db_utils.pl
-rw-rw-rw- links.cfg
-rw-rw-rw- links.def
-rwxr-xr-x nph-build.cgi
-rwxr-xr-x nph-email.cgi
-rwxr-xr-x nph-verify.cgi
-rw-rw-rw- site_html.pl
-rw-rw-rw- site_html_templates.pl
drwxr-xr-x templates

Does that look right?

Thanks again!!!

Quote Reply
Re: htaccess In reply to
Hi Jason:

And where is the .htaccess file? BTW, the scripts (CGI and PL files) should all be chmod 0755 (rwxr_xr_x) - all other files in admin directory chmod 0644 (rw_r__r__).


Dan Cool


Quote Reply
Re: htaccess In reply to
The htaccess and htpasswd file were in the admin directory. I have changed the permissions that you mentioned

Thanks!

Quote Reply
Re: htaccess In reply to
I don't think that I made it clear in my last post, but it still isn't working...

Thanks,

Jason

Quote Reply
Re: htaccess In reply to
Hi Jason:

Sorry but I've been really swamped in the past couple days. I seen this before a few times where the domain of a .htaccess file in a CGI-BIN subdirectory carries over to the next directory above. Not sure if it is due to aliasing or the form of publishing. How do you upload - FTP or a publisher like FrontPage. If you FTP in, do you see a reference to the .htaccess file in the directory above the admin directory?


Dan Cool


Quote Reply
Re: htaccess In reply to
I use FTP to publish. Did not see a reference to .htacess above admin directory.

Thanks,

Jason

Quote Reply
Re: htaccess In reply to
Actually...only the CGI scripts need to be 755 (rwxr-xr-x). The PL scripts can be kept at 644 (rw-r--r--). The PL scripts are NOT executed, only the CGI scripts.

Regards,

Eliot Lee
Quote Reply
Re: htaccess In reply to
Change your FTP configurations to SHOW HIDDEN files.

Regards,

Eliot Lee
Quote Reply
Re: htaccess In reply to
I can see the htaccess file fine in the directory that it has been created. Dan was suggesting that maybe the htaccess file was affecting parent directories.

Quote Reply
Re: htaccess In reply to
In Reply To:
Did not see a reference to .htacess above admin directory.
Welp...thought you could NOT see the .htaccess file (period) and that is why I recommending changing your FTP configurations.

Good luck with finding a solution.

Regards,

Eliot Lee
Quote Reply
Re: htaccess In reply to
This is strange. I'd suggest approaching your web host since they are the ones that configured your box. And yes, Eliot is right. The .pl files should be chmod 0644 (rw_r__r__). Oops, I guess I really have ignored the one site I have that uses Links and forgot about the setup.


Dan Cool


Quote Reply
Re: htaccess In reply to
I had the same problem you are having . My solution was to put the .htpasswd in the directory below the root. I don't know why it worked by seperating them, but it did because that was the only thing that I did differently.

Jimmy Crow
http://www.homewithgod.com/