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
344 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

Suggested Solutions

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

9 Experts available now in Live!

Get 1:1 Help Now