DeveloperSide.NET Forums
May 23, 2019, 07:32:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Htaccess  (Read 35753 times)
0 Members and 1 Guest are viewing this topic.
bigjoe11a
Jr. Member
**
Posts: 56


bigjoe11a
View Profile WWW Email
« on: October 01, 2007, 02:29:40 AM »

Hi! where can I get help with .htaccess. for WD

1) I need to know how to deney access to directories
2) How can I get my PHP scripts to see another directory

Joe
« Last Edit: October 01, 2007, 03:00:27 AM by bigjoe11a » Logged

admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #1 on: October 01, 2007, 02:03:02 PM »

1. You should have .htaccess enabled with something like...

Code:
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

AccessFileName .htaccess

2. You need to allow whichever directory blocks to allow specific levels of .htaccess override with...
http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

3. Assuming you have 'AllowOverride Info' set, you can restrict access to a dir with .htaccess file similar to...
Code:
order deny,allow
deny from all
allow from xx.xx.xx.xx
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
bigjoe11a
Jr. Member
**
Posts: 56


bigjoe11a
View Profile WWW Email
« Reply #2 on: October 01, 2007, 02:11:09 PM »

1. You should have .htaccess enabled with something like...

Code:
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

AccessFileName .htaccess

2. You need to allow whichever directory blocks to allow specific levels of .htaccess override with...
http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

3. Assuming you have 'AllowOverride Info' set, you can restrict access to a dir with .htaccess file similar to...
Code:
order deny,allow
deny from all
allow from xx.xx.xx.xx

ok, Thanks, where do I add the code too. Is there a file I add it too. Or??

I never done this before.

Joe

Logged

bigjoe11a
Jr. Member
**
Posts: 56


bigjoe11a
View Profile WWW Email
« Reply #3 on: October 01, 2007, 02:37:10 PM »

I fount this option in my httpd.conf file

Code:
IndexIgnore .HTaccess
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

I hope that helps you so that you can help me

Logged

admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #4 on: October 01, 2007, 02:48:10 PM »

Put the 1st in httpd.conf - global, put the second in a specific directory block under httpd.conf.
« Last Edit: October 01, 2007, 02:49:57 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
bigjoe11a
Jr. Member
**
Posts: 56


bigjoe11a
View Profile WWW Email
« Reply #5 on: October 01, 2007, 03:17:56 PM »

Put the 1st in httpd.conf - global, put the second in a specific directory block under httpd.conf.

The first part is done. I don't get the 2nd part

do you mean
apache22/conf/httpd.conf file and path of httpd.conf
apache22/ you mean the .htaccess file should go in the apache22 directory

Or do you mean some thing else
Logged

admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #6 on: October 01, 2007, 03:23:03 PM »

You need to put 'AllowOverride Info' into a '<Directory xxx'> block under httpd.conf. Maybe the '/' block, maybe the '/www/webroot' block, etc...
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
bigjoe11a
Jr. Member
**
Posts: 56


bigjoe11a
View Profile WWW Email
« Reply #7 on: October 01, 2007, 03:36:30 PM »

You need to put 'AllowOverride Info' into a '<Directory xxx'> block under httpd.conf. Maybe the '/' block, maybe the '/www/webroot' block, etc...

Ok, theres both of them in my httpd.conf file

Both of them say
Code:
AllowOverride None

I take it that it shouldn't say that. what should it say

Joe
« Last Edit: October 01, 2007, 03:38:22 PM by bigjoe11a » Logged

admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #8 on: October 01, 2007, 03:49:03 PM »

Put it under the webroot block.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #9 on: October 01, 2007, 03:50:17 PM »

Make sure to restart Apache for changes to take effect. Also note that if you want to use more than 'order allow/deny' in .htaccess files, you will need to adjust 'AllowOverride' accordingly. Set it to 'All' for max override.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
bigjoe11a
Jr. Member
**
Posts: 56


bigjoe11a
View Profile WWW Email
« Reply #10 on: October 01, 2007, 04:12:24 PM »

Make sure to restart Apache for changes to take effect. Also note that if you want to use more than 'order allow/deny' in .htaccess files, you will need to adjust 'AllowOverride' accordingly. Set it to 'All' for max override.

Thank You. How my browser is tring to read the .htaccess file. It's just that I keep getting an internal server error. It says that the

The server encountered an internal error or misconfiguration and was unable to complete your request.

I get the idea that its not reading the .htaccess files that I have in the directory that I'm trying to protect

any way. Heres the samples that I got from a google.com search

Code:
.htaccess
AuthName "Fileboss"
Authtype Basic
AuthUserFile /fileboss/data/ .htaccess
Requires Valid-User

.htpasswd
username:password


As far as I know it should read it. SO what I'm I doing wrong

Joe
Logged

admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #11 on: October 01, 2007, 04:30:57 PM »

I'm sure it's reading it, its just that what its reading is not right. Check the private.conf for an example of what you are trying to do.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
bigjoe11a
Jr. Member
**
Posts: 56


bigjoe11a
View Profile WWW Email
« Reply #12 on: October 01, 2007, 04:51:18 PM »

I'm sure it's reading it, its just that what its reading is not right. Check the private.conf for an example of what you are trying to do.

What I did was I copy the info from the private.conf file and copied it into the .htaccess file that I have in that directory. All I did was change some of the directories around and I still get a Internal Server Error. So Its trying to read.

Here my new code
Code:
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_user_module modules/mod_authz_user.so

<IfModule authn_file_module>
Alias /data "/www/webroot/fileboss/data"

<Directory "/www/webroot/fileboss/data">
Options Indexes FollowSymLinks
AllowOverride All

Order allow,deny
Allow from all

AuthType Basic
AuthName "FileBoss"
AuthUserFile "/www/webroot/fileboss/data/.htpasswd"
require valid-user
</Directory>
</IfModule>

Again Thanks for your help

Joe
Logged

admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #13 on: October 01, 2007, 04:58:11 PM »

Check \www\Apache22\logs\error.log
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
bigjoe11a
Jr. Member
**
Posts: 56


bigjoe11a
View Profile WWW Email
« Reply #14 on: October 01, 2007, 05:15:14 PM »

Check \www\Apache22\logs\error.log

Its say Invalid Auth File Type .htpsswd
and
LoadModule not allowed here.

Ok, So I commented the load Modules. How How do I fix the Auth File Type

Logged

Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!