My Server’s Web Root Directory(Apache)?

Hi guys i m running a linux server with following os.

uname -o
GNU/Linux
lsb_release -a
LSB Version: :core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
Distributor ID: EnterpriseEnterpriseAS
Description: Enterprise Linux Enterprise Linux AS release 4 (October Update 7)
Release: 4
Codename: OctoberUpdate7
Thanks in advance.
I m running following Apache web server version.

httpd -v
Server version: Apache/2.0.52
Server built: Jun 11 2008 19:01:13
How would i find the root directory of Apache server to put my web pages.
Please help.
 
You can check DocumentRoot path in httpd.conf file.

Don't remember path of httpd.conf file but check /usr and /etc ... should be there within apache directory.

Or find out httpd belongs to which directory and there you should see this file
 
I would recommend to use some webhosting script on your linux server so that it configures everything automatically if only you want to run website on it.

For example , you can use free VHCS VHCS open source hosting control panel for simplified webserver management and ever tried Webmin ? webmin.com ..visit it.

Although VHCS would be easiest and best to configure ! but webmin will make you explore more !

To the topic :

nano /etc/httpd/conf/httpd.conf

ctrl + w

documentroot

vaise just do what rock_ya_baby says
 
coolraghav said:
I would recommend to use some webhosting script on your linux server so that it configures everything automatically if only you want to run website on it.

For example , you can use free VHCS VHCS open source hosting control panel for simplified webserver management and ever tried Webmin ? webmin.com ..visit it.

Although VHCS would be easiest and best to configure ! but webmin will make you explore more !

To the topic :

nano /etc/httpd/conf/httpd.conf

ctrl + w
documentroot

vaise just do what rock_ya_baby says
thanks for your reply.I m still struggling to setup apache .
Please find the details as you requested.
In my case its

DocumentRoot "/var/www/html"

But There are no files in /var/www/html directive.
However i would like create a simple php page and host it on my machine.
Correct me if i m wrong.
1) create a php file say abc.php.
2) Copy it to /var/www/html directory.
3) restart the web server(tomcat).(kindly provide the command if any).
4) access it through url http://localhost:8080/abc.php
 
pinga123 said:
thanks for your reply.I m still struggling to setup apache .

Please find the details as you requested.

In my case its

DocumentRoot "/var/www/html"

But There are no files in /var/www/html directive.

However i would like create a simple php page and host it on my machine.

Correct me if i m wrong.

1) create a php file say abc.php.

2) Copy it to /var/www/html directory.

3) restart the web server(tomcat).(kindly provide the command if any).

4) access it through url http://localhost:8080/abc.php

Firstly, read and know more about what you are trying to do. Tomcat and Apache are two different animals (servers).

You dont need to restart apache if you add php files. If it doesnt work, just make sure you have installed php.

AFAIK, Apache's default port is 80. So, you can just use http://localhost/abc.php but make sure of it from the apache config file.

PS: In case if you have to restart apache - you can do it from /etc/init.d/ use - ./httpd restart or ./apache2 restart (as root) - whichever is available.
 
Back
Top