Apache Configuration File

I am new in Linux configure Apache. I got few questions to ask. I am will grateful for the help. Thanks.

1) In the Apache Configuration File, where is actually the base for the web tree?

2) I wanted to create a directory (called java) inside the base of the web tree. How am I going to do that?

3) I wanted to make this directory (called java) to be protected. I only allow the user (named glenn) with the password (glenn) to see the contents of the directory (called java). How am I going to do that? I know I need to create a .htaccess file but I don't how to do it.

On which operation system are you installed the Apache?

I am using Red Hat Linux. Does it matters?

I'm not 100% sure but I think the basic root web directory on red hat is : /var/www/

This can be change in you apache configuration file: /etc/httpd/conf/httpd.conf

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>

You have to edit this part and change the /var/www/ to you directory

and to you last point -- please run the command :

htpasswd -c /your/directory/.htpasswd glenn glenn

then you have to create a file .htaccess in you web server directory

and paste the following lines in your .htaccess (only change the /your/directory) parameter!

AuthType Basic
AuthName "Authetication"
AuthUserFile /your/derectory/.htpasswd
require valid-user

I hope that's all!

This is some straight up homework. No one in their right mind is making a username and password glenn/glenn.

I am a part time Linux instructor, and this is the type of stuff i would have my students do.

If it is a legitimate question, then tell us what you tried. Don't just say "I cant do it :frowning: "

Also, you should look at the Apache manual, it's a great reference guide...much better than the traditional man page.

There is a how-to in there for authentication, its excellent.

just type in "apache docs" in google, and its the first entry.

closing thread on grounds of homework questions.