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
347 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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
 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

828 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