LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-01-2010, 03:35 PM   #1
thorinn
LQ Newbie
 
Registered: Feb 2010
Posts: 8

Rep: Reputation: 0
RHEL5 Apache Directory Listing for a directory


Hey guys, newbie that needs some help. I have RHEL5 with apache installed and running. I have a directory off of / called software that I would like to have show up as a directory listing so if I go to http://myserver.mynetwork.com/software I get the directory listing.

I have tried searching around and nothing seems to work for me. So out of the box how do I get this to work? My server properly resolves to myserver.mynetwork.com so I am good there.

Need some step-by-step hand holding here...

Thanks!
Mike
 
Old 02-01-2010, 03:44 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
You'll need to post your /etc/httpd/conf/httpd.conf so we can see what you already have configured

cheers
 
Old 02-01-2010, 04:40 PM   #3
thorinn
LQ Newbie
 
Registered: Feb 2010
Posts: 8

Original Poster
Rep: Reputation: 0
No problem here you go!

Anytime I try to go the url I get 404 not found.
Attached Files
File Type: txt httpd.conf.txt (31.8 KB, 33 views)
 
Old 02-01-2010, 06:08 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Try adding this to the end:

Code:
<Directory "/software">
        Options +Indexes
        AllowOverride None
	Order allow,deny
        Allow from all
</Directory>
An extra note: if you have selinux enabled, it will prevent access to /software. You can see if selinux is in enforcing mode by running 'getenforce', if the result is 'enforcing' then you'll need to one of 2 things:

Code:
chcon -R --reference=/var/www/html /software
or

Code:
setenforce 0
edit /etc/sysconfig/selinux and change 
'SELINUX=enforcing' to 'SELINUX=permissive'
cheers
 
Old 02-02-2010, 04:52 AM   #5
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Following will relax/lower your SELinux security, so if you need your server to use maximum of security available, avoid it:
Quote:
Originally Posted by kbp View Post
setenforce 0
edit /etc/sysconfig/selinux and change
'SELINUX=enforcing' to 'SELINUX=permissive'
 
Old 02-02-2010, 08:14 AM   #6
thorinn
LQ Newbie
 
Registered: Feb 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Sorry guys, nothing. I still get 404 not found. The requested URL /software was not found on this server.

Apache/2.2.3 (red hat) server at myserver Port 80.

I verifed getenforce and shows disabled. My firewall allows www (http).

I am just trying to get to this url from the Firefox on the local machine.

I also tried http://localhost/software and same thing. If I ping localhost I do get a response back localhost.localdomain (127.0.0.1)

At the end of httpd.conf I put in:

<Directory "/software">
Options +Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>

and saved the file and restarted the httpd service.

Thanks!
 
Old 02-02-2010, 08:31 AM   #7
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Quote:
Originally Posted by thorinn View Post
I have a directory off of / called software that I would like to have show up as a directory listing
is that path /var/www/html/software or /software ? Only the first path will be visible on your server. If you have second path, then create symlink to /var/www/html/software .
 
Old 02-02-2010, 08:56 AM   #8
thorinn
LQ Newbie
 
Registered: Feb 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks DrLove,

Well I went into /var/www/html and did a ln -s /software which created my link so now I can cd into /var/www/html/software.

If I try to go open the browser and go to http://mymachine.mynetwork.com/software I get a slightly different error.

I still get the 404 Not Found
the requested URL /software was not found on this server.

Additionally, a 404 not Found error was encountered while trying to use an ErroDocument to handle the request.
 
Old 02-02-2010, 09:01 AM   #9
thorinn
LQ Newbie
 
Registered: Feb 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Nevermind!! I did a service restart, reopened firefox and it works!!

Thanks DrLove!!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache directory listing krneki Linux - Networking 3 06-17-2006 09:47 AM
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 06:03 AM
apache - directory listing thejackal13 Linux - Software 1 01-05-2005 10:31 AM
Directory Listing with apache aroop Linux - Networking 2 06-02-2004 02:50 AM
apache 2 directory listing jwatco2001 Linux - Software 5 06-07-2003 06:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 11:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration