Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

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...
0
jazzIIIlove
Asked:
jazzIIIlove
  • 5
  • 3
  • 2
  • +1
6 Solutions
 
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
 
jazzIIIloveAuthor Commented:
ok...half of it done...

How can i detect the apache server's path through command prompt of Linux...
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

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

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now