What is the default directory for apache server in linux and www folder...How can i detect the apache server's path through command prompt of Linux...

Well i want to learn if there is an apache server in the remote machine having linux...Which directory is the default directory for apache server in linux and www folder of course...

How can i detect the apache server's path through command prompt of Linux...
LVL 12
jazzIIIloveAsked:
Who is Participating?
 
vetelysCommented:
It depends on the linux distro used in the remote machine and how Apache is installed / configured.

First I'll recommend checking:

/var/www (Debian, ubuntu)
/var/www/html (Red Hat based systems)
/usr/local/apache/htdocs (classic default)

The web root folder is defined typically in httpd.conf file with DocumentRoot directive.

First locate httpd.conf and then check the web root directive. For example:

cat /etc/httpd/conf/httpd.conf | grep DocumentRoot
0
 
fosiul01Commented:
it would be :

/var/www/html/ all web site will go there

configure file for apace :

/etc/httpd/conf/httpd.conf

0
 
fosiul01Commented:
if you want to see if apache is running or not

pgrep httpd

it will show you some Id
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
jazzIIIloveAuthor Commented:
ok...half of it done...

How can i detect the apache server's path through command prompt of Linux...
0
 
fosiul01Commented:
what do you  mean apache server path ??

0
 
jazzIIIloveAuthor Commented:
the path where i can put my php files into it...
0
 
fosiul01Commented:
ohh as i said

it would be : cd /var/www/html/
mkdir yourwebdirecotry

Place all your file in that direcotry , html, php everything

and try to open that site like this : http://yourservername/yourwebdirectory
0
 
mchkorgCommented:
depends on the distro

A nice command would maybe be :
grep -ri documentroot /etc/apache*

That will look for the DocumentRoot directive in your apache/apache2 config files
It will consider all your web sites (if virtualhosts for instance)

If your apache conf files are elsewhere, adapt :
grep -ri documentroot /etc/httpblahblah
0
 
jazzIIIloveAuthor Commented:
by the way, what is the relation between php.ini and httpd.conf and where to look in Linux server for php.ini?

Sorry, this seems aditional question...
0
 
mchkorgCommented:
Every config file is generally stored in /etc/something - no matter the distro
php.ini might be in several places : /etc/php or /etc/php5
0
 
fosiul01Commented:
php.init is for php configureation for php programming

httpd.conf is for apache configureation for webserver
0
 
vetelysCommented:
As said, php.ini is configuration file only for php that is an extension/module for Apache web server. httpd.conf is main configuration file for whole web server, and there i

If you found the documentroot you asked and have access to it, you can put there a php file with code attached to check which php.ini file is loaded and how it is configured.
<?php
phpinfo();
?>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.