Are there any additional steps needed to make Linux recognize a certain directory as browsable underneath /var/www/? Is there a conf file that needs to be set up? I've got a plain html page in a directory called /var/www/test and it isn't coming up. Any help would be greatly appreciated.
your problem sounds more like a webserver problem than a Linux problem.
What exactly do you mean by "browsable"? Browsable via web browser? There's no real concept of browsing local file systems. A directory browser like konqueror makes this possible for you.
If it's a problem with a web directory instead then it depends very much on the web server or serlvet container you're using. It's a configuration option in almost every web server which directories should be browsable. And for your HTML page it could be a problem of the file system rights or perhaps your document root for you web directories could be located in a different directory than /var/www. But this, too, is a configuration problem of the web server.
Perhaps you could describe a little bit more precisely what you're trying to do!
Joined: Apr 09, 2002
Ok, I see. This is definitely not a problem with Linux but with your web server. It would be the same problem if you'd run the same web server on windows.
For most web servers (like Apache for example) you have to allow browsing of web directories. That means you have to configure the web server to allow browsing for specified directories which instructs the web server to produce a directory listing if someone tries browsing an directory URL (with a simple slash at the end).
The problem that the web server doesn't find your HTML page is most likely because with your installation the document root isn't /var/www but /var/www/html. Therefore you would have to put your test directory under the document root. The full path would be /var/www/html/test/. The document root of a web server configuration is the most upper directory the web server can "see" (ok, it's possible to include external directories but that's another story).
Unfortunately these are just assumptions as the exact problem is hard to tell without knowing the web server and its configuration or exact error messages from its log. I'd suggest to inspect the log file of your web server. This could give you valuable hints what's wrong here
Joined: Apr 09, 2002
Apache v2 and Redhat Enterprise v5.1. I thought the configuration for the root was /var/www. Do you know what the config file is then?
Joined: Apr 09, 2002
Hi guys. Never mind. It's the /etc/httpd/conf/httpd.conf file. It's on another server here where it's working but the contents of the httpd.conf file were removed it looks like. I'm not sure what effect that has on what is accessible and what is not but that looks like the reason why it's working there. I saw that there was a backup of the file and after looking in there saw where the /html directory was initially set as the root. Thanks for the responses.
On most Linux systems the config files may be under /etc/apache2. The main config file is usually httpd.conf or apache2.conf or the like. The configuration can be split into (many) different directories and files - depending on the Linux distribution and Apache installation.
Unfortunately I have less experiences with Red Hat so I can't tell you exact details but I think there should be enough documentation with the distribution or on the web pages of Apache and Red Hat to figure out the exact config file locations.
Anyway you can search or grep the config files for a parameter called "DocumentRoot" just to be sure that you're not simply putting the web files in the wrong location
The problem is, a lot of people think otherwise, since URLs and filesystem paths look so much alike AND because for a lot of web servers, the default action when asked for a URL is to break the URL down into a directory path. But they're not one and the same.
For Apache, you set a document base directory for the server - these days it's commonly /var/www. Viewing files stored under that document base generally requires that you have the index option turned on (at least if you want to be able to see the directory indexes).
What's especially nasty about apache is that unless a whole multitude of constraints are met, the document won't be served and you won't know why.
Among these are:
o The apache server doesn't have read rights to the file or its path o You don't have authorization rights set in the httpd.conf file or one of its delegates. o You've got selinux turned on and the selinux requirements aren't being met.
There's probably at least 3 more reasons for failures, but I can never remember them all.
Customer surveys are for companies who didn't pay proper attention to begin with.
Tim, I hope my tips weren't suggestive of a web server being the same as file server?!?
I know it's of course not the same. I just didn't want to make it too complicated and the problem finally seems to cut down to a problem in the file system. At least the problem with the test directory.
I've administrated lots of production web servers and I have to state once more: my hints to a solution were just based on assumptions. Apache is one of the most complex services with the possibly the most configuration options I know of. So it's obvious that it's not possible to explain it here in detail in a few words. And it's not possible to give an exact solution without seeing all details on this server.
subject: Browsable Directory under /var/www in Linux