Directories and Files Protection in Apache Server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Directories and Files Protection in Apache Server
# 1  
Old 07-23-2002
Directories and Files Protection in Apache Server

Hi everyone, I'm a newbie at this. We have a unix web server which has redhat 7.2 on it. It has apache server hosting our website at the moment. This is what I'm trying to do.

Goal: I'm trying to put reports online so when clients come they can read it and what not. I want only clients viewing their particular folders only and not read others. On the server, there will be a directories of folders of groups number and in those directories are the files. I want a link on the website so that when they click on it, it tells them to put in their user name and password, once they do that, it will take them to their group number. From there, they can do whatever they want, print the file, download the file, etc....

I tried using the .htaccess method but aren't very successful. If someone can help me out with this, I would really appreciate it. I created a .htaccess file in the directory that I want to protect...this is what is in the file:

AuthType Basic
AuthUserFile /var/www/html/test2/.htpasswd
AuthGroupFile /dev/null
AuthName Testing
require valid-user
<Limit GET>
require user temp
</Limit>

and then I created a user name and password and put it inside that folder also. This is what i did next:

htpasswd -c /var/www/html/test2/.htpasswd temp
<enter password twice>

then i place stuff in the folder like a couple of text file, then open up my browser, i could see all the stuff in the folder, it didn't prompt me for a user name/password. Well thats what I did, hopefully someone can help me out.
# 2  
Old 07-23-2002
Power

check your httpd.conf file

make sure this section of httpd.conf file
AllowOverride is set to Authconfig

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#

AllowOverride Authconfig

that is

<Directory />
Options All Multiviews
AllowOverride Authconfig
Order deny,allow
Allow from all
</Directory>


stop and start apache for changes to take effect
# 3  
Old 07-24-2002
Hi, that works. Thanks. Another question is if I put a link to the website which says the following:

Agree | Disagree

After they click agree, it will bring up the pop screen which ask for user name and password. After they enter in the user name and password, it takes them to their directory that they were assigned to. The user name would be the name of the folder that they are assigned to. How would I do that? Thanks for helping me out.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. AIX

How to backup a directory (sub-directories/files) files from one server on to other ?

Hello, Server A: /directory1/ Server B: /Backups/ i wanted to backup contents of /directory1 from "server A" on to "Server B" every 1 hour. If there is any change in (only new/differences) contents on serverA (directory1/) supposed to be backeup on next run. I did used rsync command to... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Copy Directories with Files from One Server to Other using sftp

Hi, I have a requirement where I have to connect to another server and copy directories from one server to another Directories on the Source server look like below (YYYY-MM-DD- 1 to 23) drwxr-xr-x 2 test_user dmfmart 422 Sep 1 23:45 2014-09-01-18drwxr-xr-x 2 test_user dmfmart ... (1 Reply)
Discussion started by: arunkesi
1 Replies

3. Shell Programming and Scripting

Need shell script to compare directories and delete files on target server

Hello, I need help in writing the shell script for below mentioned case. There are 2 servers(server A, server B). A cronjob syncs files between these 2 servers. Existing script is copying files from A to B. This is done using the command rsync. However, the files are not deleted... (2 Replies)
Discussion started by: SravaniVedam11
2 Replies

4. Red Hat

CPU high - apache real server OK, virtual server not

Got two RHEL servers - one real and one virtual/cloud. Both run apache web server. When traffic is applied, CPU seems to go quite high on virtual one (20%) but real is not really affected. Worry is that a further increase in traffic will see a problem. Experience of RHEL is limited. Whats... (2 Replies)
Discussion started by: psychocandy
2 Replies

5. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

6. Programming

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.

I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning. The script is called cwrmail.pl and is located in my cgi-bin. When I... (9 Replies)
Discussion started by: BigBobbyB
9 Replies

7. Web Development

Apache 0777 directories

Hi All I have a web server,I have many world writeable directories (0777),Created by programmers,for uploading pictures. Now i want to stop script excuation (php,cgi,etc) in the directories 0777,I know one way is to use htaccess file,i dont wana used that,if some one know any other method... (14 Replies)
Discussion started by: aliahsan81
14 Replies

8. UNIX for Advanced & Expert Users

Does unix has password protection for zip files?

How to set password in zip files under unix? There are password protection available in various os. Does unix has password protection for zip files? Is zip and gzip command has it? (6 Replies)
Discussion started by: p_prathaban
6 Replies
Login or Register to Ask a Question