Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd February 2006, 15:34
Median Median is offline
Member
 
Join Date: Jan 2006
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default Password Protected Directories Problem

Told you I'd be back

I am trying to password protect a dirctory on one of my ISPConfig sites.

When I try and access a page within that directory I should be prevented from accessing it until I put in a username and password. What actually happens is the the page just opens normally.

I followed the Perfect Setup - Fedora Core 4 and installed ISPConfig. Any errors that were encountered were fixed and everything seems to work perfectly.

I then installed osCOmmerce on one of my vhosts. Unfortunately this lovely piece of software won't run under php 5. So....

I uninstalled php 5 using
Code:
yum remove php
and installed php 4 using the rpms. This has fixed the problem with osCommerce which has installed and is running fine.

I then went into ISPConfig as the admin for that site, opened the site with the webFTP program, clicked on the relevant folder, clicked on the protect directory button and entered the username and password. No errors were encountered with this, but as I said at the start, when I try and access a page within that directory the page just opens normally.

Any suggestions as to were I start looking to fix this please?

Thanks a lot
Reply With Quote
Sponsored Links
  #2  
Old 3rd February 2006, 18:27
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Can you see an .htaccess file in that directory? (Use
Code:
ls -la
to look at the contents of that directory on the command line.) What's in it?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 3rd February 2006, 19:04
Median Median is offline
Member
 
Join Date: Jan 2006
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
Can you see an .htaccess file in that directory? (Use
Code:
ls -la
to look at the contents of that directory on the command line.) What's in it?
Both .htaccess and .htpasswd are there along with the php files I want protected.
Reply With Quote
  #4  
Old 4th February 2006, 14:06
Median Median is offline
Member
 
Join Date: Jan 2006
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just checked in .htaccess and this
Code:
# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
#
#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals on
#</IfModule>
appears. I am using php4. Do I need to uncomment these lines?

.htpasswd (edited for security) contains
Code:
username:JKe47yT4pl9B0
Reply With Quote
  #5  
Old 4th February 2006, 14:33
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by Median
Just checked in .htaccess and this
Code:
# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
#
#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals on
#</IfModule>
appears. I am using php4. Do I need to uncomment these lines?
I'm quite surprised where this comes from. Did you somehow replace the .htaccess file created by ISPConfig? Because it should rather look like this:
Code:
AuthType Basic
AuthName "Passwortgeschützter Bereich"
AuthUserFile /path/to/.htpasswd
require user username
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 4th February 2006, 14:50
Median Median is offline
Member
 
Join Date: Jan 2006
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
I'm quite surprised where this comes from. Did you somehow replace the .htaccess file created by ISPConfig? Because it should rather look like this:
Code:
AuthType Basic
AuthName "Passwortgeschützter Bereich"
AuthUserFile /path/to/.htpasswd
require user username
All I have done is created the site within ISPConfig and installed osCommerce. Maybe that is where it came from.

In full, .htaccess is:
Code:
# $Id: .htaccess,v 1.1 2003/06/20 00:18:30 hpdl Exp $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

<IfModule mod_setenvif.c>
  <IfDefine SSL>
    SetEnvIf User-Agent ".*MSIE.*" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
  </IfDefine>
</IfModule>

# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter
#
# AcceptPathInfo On

# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
#
#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals 1
#</IfModule>
After I set up osCommerce I then tried to activate the protected directory in ISPConfig and discovered the problem.

Assuming (and I don't know for sure) this is an important part of the osCommerce setup, how would I modify it to make it work as I want it to?

This is the first of at least 3 osCommerce sites I need to set up for myself so it would be great to get it sorted.

Incidentally, I notice a few people around the forums having problems with osCommerce. Once everything is sorted I'll try and put together a 'How-To' if you think it will help.

Thanks.
Reply With Quote
  #7  
Old 4th February 2006, 16:40
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,972
Thanks: 825
Thanked 5,367 Times in 4,214 Posts
Default

You can not use the ISPConfig password protection feature when you install a software that uses .htaccess files too, like oscommerce.

Instead of using the password protect feature from 42go you will have to modify the .htaccess manually and add a section like the one falko posted above:

Code:
AuthType Basic
AuthName "Passwortgeschützter Bereich"
AuthUserFile /path/to/.htpasswd
require user username
then make add the users that shall have access to your site with the "htpasswd" commandline utility.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #8  
Old 4th February 2006, 17:15
Median Median is offline
Member
 
Join Date: Jan 2006
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

That's fixed it.

Many thanks for you help and patience guys
Reply With Quote
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
mysql password problem brianetilley Installation/Configuration 30 31st December 2007 22:32
Secure Page & Password Protected mphayesuk General 7 26th January 2006 17:30
Debian install error jf1976 Installation/Configuration 25 19th January 2006 22:31
ISP install problems Debian sarge 3.1 lerra Installation/Configuration 1 5th January 2006 16:37
Virtual Users And Domains With Postfix, etc, problem with SMTP/Auth wrong password ggere HOWTO-Related Questions 15 14th November 2005 16:08


All times are GMT +2. The time now is 11:57.


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