6

I am on someone else's linux server (shared hosting). I do not have root access. I have determined that it's a Redhat 4.1.2-46 running as Centos Release 5.9(Final).

I have the database dump for the site and the .php files from public_html as well. What I'm TRYING TO DO is locate the httpd.conf file and get the config for that site.

when I type in

httpd - v

I get -bas: httpd: command not found - even in like the /user/sbin directory - and it's clearly running and there.

Bottom line I can't find the sitedef/conf file for www.thisparticularsite.com - and can't even figure out what version of apache I'm running...

2
  • 1
    Assuming by "even in like the /usr/sbin directory" you mean you see the binary in there, what about /usr/sbin/httpd -v, or ./httpd -v when in /usr/sbin?
    – ajp15243
    Commented Jul 2, 2014 at 19:16
  • See if there's a script like /etc/init.d/httpd that's normally used to start Apache when the system boots. It should have the path to httpd in it.
    – Barmar
    Commented Jul 2, 2014 at 19:16

4 Answers 4

7

For Apache 2 try apache2ctl -v (or sudo apache2ctl -v if root access is available). I'm on a Raspberry Pi 4B running Debian, just for reference.

0
3

The init files of apache are usually located in /etc/init.d the httpd path are found in it. However, You can find out where the httpd.conf file and httpd command directory by doing a ps aux|grep -i http. For example:

ps aux|grep -i http

510       2594  0.0  0.0  77256  1516 ?        S    Jul02   0:00 **/usr/sbin/httpd-0.0.0.0_80** -k start -f **/etc/httpd/conf/instances/httpd-0.0.0.0_80/httpd.conf**

root      5470  0.0  0.0  77120   872 ?        Ss    2013  22:13 **/usr/sbin/httpd-0.0.0.0_80** -k start -f **/etc/httpd/conf/instances/httpd-0.0.0.0_80/httpd.conf**

Conclusion:

httpd.conf file path: **/etc/httpd/conf/instances/httpd-0.0.0.0_80/httpd.conf**
httpd command directory: **/usr/sbin/httpd-0.0.0.0_80**
0
0

As mentionned by apache.org, httpd command should not be invoked directly. see source

0

If you're trying to find loaded modules, earlier the command was httpd -l. But it'll give you the same error, Command 'httpd' not found,

Nowadays, you can use apache2 -l (tested on Apache/2.4.29).

Not the answer you're looking for? Browse other questions tagged or ask your own question.