LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Document Root in Apache (https://www.linuxquestions.org/questions/linux-newbie-8/document-root-in-apache-108712/)

Hal 10-26-2003 11:44 AM

Document Root in Apache
 
Ok, so I spent ages looking for folder with the Apache test page inside. On the page it says it needs to be replaced. I have decided that it is just one of those things you don't find by looking for it...

So I had a look at httpd.conf and it says the document root is /var/www/html (on RedHat 9) I presume this is where I have to dump my .php .html, etc, files to be served out by Apache. Since I only want to test my pages, and not serve them out to the internet, they only need to work on the localhost. The problem is that it doesn't allow any new folders to be created there, and doesn't allow for copy and paste of any files.

So why doesn't it allow me to put my files there? Do I need special permissions? Or am I wanting to put my files in the wrong place?

If anyone has any information about setting up Apache just to test .php etc on RedHat 9 it would be appreciated.

tgflynn 10-26-2003 11:59 AM

By default the Document Root directory will probably be owned by root. Therefore you will only be able to modify files there if logged in as root.

There are a couple of ways around this. You could create a group called, for example, web and add yourself to it. Then as root do the following :

cd /var
chgrp -R web www
chmod -R g+rw www

A simpler solution for testing might be to use user directories. Most Apache installations are set up by default to give access to a directory called "public_html" directly under any user's home directory. To access such a site the URL to use is :

http://localhost/~username

Tim

Hal 10-28-2003 06:10 AM

Thanks for that!


All times are GMT -5. The time now is 12:18 PM.