Solved

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...

Posted on 2008-10-08
12
345 Views
Last Modified: 2012-05-05
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...
0
Comment
Question by:jazzIIIlove
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 29

Assisted Solution

by:fosiul01
fosiul01 earned 110 total points
ID: 22667548
it would be :

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

configure file for apace :

/etc/httpd/conf/httpd.conf

0
 
LVL 29

Assisted Solution

by:fosiul01
fosiul01 earned 110 total points
ID: 22667552
if you want to see if apache is running or not

pgrep httpd

it will show you some Id
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 22667555
ok...half of it done...

How can i detect the apache server's path through command prompt of Linux...
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22667565
what do you  mean apache server path ??

0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 22667613
the path where i can put my php files into it...
0
 
LVL 29

Assisted Solution

by:fosiul01
fosiul01 earned 110 total points
ID: 22667626
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Accepted Solution

by:
vetelys earned 60 total points
ID: 22668846
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
 
LVL 7

Assisted Solution

by:mchkorg
mchkorg earned 80 total points
ID: 22685202
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
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 22697951
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
 
LVL 7

Assisted Solution

by:mchkorg
mchkorg earned 80 total points
ID: 22700700
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
 
LVL 29

Expert Comment

by:fosiul01
ID: 22700703
php.init is for php configureation for php programming

httpd.conf is for apache configureation for webserver
0
 

Expert Comment

by:vetelys
ID: 22708992
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

Featured Post

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now