Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've recently installed Apache 1.3.33 on a Debian machine and all is working well - with the exception of one thing. I can visit my machine's web page root via http : / / xx.xx.xx.xx and it displays fine. However, when I wish to browse to one of the displayed subdirs, I get a 'connection refused' error.
If I key in the address of the subdir in the URL:
h t t p : / / xx.xx.xx.xx/folder/
( note the trailing slash ) it works fine.
On previous installations I could browse dirs without any problems and I could also specify URLs without the need of a trailing slash ( / ). If I don't put a trailing slash behind URLs, I get the connection refused error. Its quite weird. I was curious if I've overlooked something really obvious here. All the dirs and subdirs I have also chmodded to 777 to see if permissions were to blame. Alas, no difference - suggesting my Apache configuration may be a little off in httpd.conf - which I can post here if required.
Originally posted by uberNUT69 My guess would be that your root directory is not browsable.
Thanks for the response, Ubernut.
The root dir is viewable, but traversing into subdirs thereafter gives me this error. Is there a setting in httpd.conf that controls browsing the root dir?
The reason that doesn't work is because apache is looking for a file named "folder" in the document root. Apache has a module called mod_rewrite that can fix this, I've never used it, so I don't know the syntax, but I'm sure google does.
To allow directory browsing you need to add "Indexes" to the <Directory /your/doc/root > features.
Code:
<Directory /var/www/localhost >
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Originally posted by twsnnva
[B]The reason that doesn't work is because apache is looking for a file named "folder" in the document root. Apache has a module called mod_rewrite that can fix this, I've never used it, so I don't know the syntax, but I'm sure google does.
To allow directory browsing you need to add "Indexes" to the <Directory /your/doc/root > features.
Thanks for the reply. Below is the config for my server's Document root directory:
<Directory "/website">
Options Includes Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
'Indexes' is definately enabled. I understanding a trailing '/' is not supposed to be used when I specify the Documentroot directory - correct?
I'm considering digging up the default Apache httpd.conf file and starting fresh - I assume this will reset me to defaults, and I can make my changes again step by step. On previous machines I've never encountered this behaviour before, and I've rebuilt this box multiple times this week :)
I've discovered the problem, if anyone cares, or is perhaps suffering from the same thing :
You need to have the correct 'ServerName' setting in your httpd.conf file reflecting the actual hostname of your Linux machine. i.e.:
ServerName "mylinuxmachine"
I changed this to reflect a server name in my httpd.conf file that didn't exist, which required me to enter trailing '/' characters to validate sub directories. Once changed to the legitimate servername on my hosting linux machine, trailing slahes were no longer required. A pretty dumb oversight on my behalf, but at the same time its weird how things still worked, albeit required the trailing slash.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.