Apache Configuration File


 
Thread Tools Search this Thread
Top Forums Web Development Apache Configuration File
# 1  
Old 05-17-2009
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.
# 2  
Old 05-17-2009
On which operation system are you installed the Apache?
# 3  
Old 05-17-2009
I am using Red Hat Linux. Does it matters?
# 4  
Old 05-17-2009
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!
# 5  
Old 05-17-2009
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 Smilie "

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.
# 6  
Old 05-19-2009
closing thread on grounds of homework questions.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Apache log rotate configuration

HI i was trying to configure logrotate for my apache server and it's not working properly. Os: Red Hat 6 here is my lodrotate configuration /var/log/httpd/*log { daily missingok notifempty sharedscripts compress delaycompress postrotate ... (3 Replies)
Discussion started by: bentech4u
3 Replies

2. UNIX for Advanced & Expert Users

Apache log rotate configuration

HI i was trying to configure logrotate for my apache server and it's not working properly. here is my lodrotate configuration /var/log/httpd/*log { daily missingok notifempty sharedscripts compress delaycompress postrotate /sbin/service httpd... (1 Reply)
Discussion started by: bentech4u
1 Replies

3. Red Hat

About the apache for ipv6 configuration

I am running apache 2 on centos 7 which is running ipv4 , now I would like to enable it to support ipv6 , would advise what I need to change to Adding IPv6 support to the server ? or nothing need to do ? the existing vhosts is as below . <VirtualHost *:80> ServerAdmin xxx.com.hk " "... (2 Replies)
Discussion started by: ust3
2 Replies

4. Shell Programming and Scripting

Apache configuration Automation based on location

Hi I need to find a way to automate the deployment of my apache configuration to a few servers. I make change frequently on apache/conf/... etc, and I usually do this manually by copying files to each servers(and country config path)and restart apache servers.Source file will be like... (1 Reply)
Discussion started by: naresh2389
1 Replies

5. Linux

Apache httpd configuration - Issues with APR

Hi I have tried setting up of Apache http server - httpd-2.4.25. During configuration, I understand it needs APR to be setup. Hence I have downloaded APR & APR-Util. Performed, tar xvfC apr-1.5.2.tar /root/httpd-2.4.25/srclib/apr What is happening is there is another directory... (1 Reply)
Discussion started by: videsh77
1 Replies

6. Web Development

Need help on Apache configuration for redirecting URLS

I am extremely new to Apache httpd configuration. Can you please help here below is my requirement. If the URL match existing resource - return resource. If the URL doesn't match existing resource it should return index.html from the app root directory. Apps root directories are: 1.... (0 Replies)
Discussion started by: kar_333
0 Replies

7. Solaris

JAMES (Java Apache Mail Enterprise Server) - Installation/Configuration Problem

Good Afternoon Intelligent Administrators/Debuggers! I am installing JAMES on an internal server (192.168.2.33) Specs of xxx.xxx.xxx.33 = SunOS v210b 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-V210 After placing and "gunziping" the respective file, I am trying to run it by: ... (1 Reply)
Discussion started by: kazmiM
1 Replies

8. Solaris

Apache Configuration issue on Solaris

I seem to have an issue with Apache configurationon our Sun solaris Server. Since there are 2 my_app instances running in parallel, the perl modules in my_app_perl_libs are getting shared between them, even though they are in different directories (/u01/my_app and /u01/my_app8). This is because... (1 Reply)
Discussion started by: rahulrathod
1 Replies

9. UNIX for Advanced & Expert Users

apache configuration

Hi. I run openbsd and apache 1.3.29 PHP/4.3.9 mod_perl/1.29 DAV/1.0.3 mod_ssl/2.8.16 OpenSSL/0.9.7c anyway,problem is i have in httpd.conf allow override all in /dir1 and 2 directories /dir1/.htaccess is AuthType Basic AuthName "Password Required" AuthUserFile /passwords/password.file... (1 Reply)
Discussion started by: hachik
1 Replies
Login or Register to Ask a Question