[Webinar] Streamline your web hosting managementRegister Today

x
?
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
Medium Priority
?
360 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 440 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 440 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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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 440 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 240 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 320 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 320 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Welcome back to our beginners guide of the popular Unix tool, cron. If you missed part one where we introduced this tool, the link is below. We left off learning how to build a simple script to schedule automatic back ups. Now, we’ll learn how to se…
Can you run Linux on a Windows system?  Yep.  Here's how.
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…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

591 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