LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   Where is the httpd -S command (http://www.linuxquestions.org/questions/debian-26/where-is-the-httpd-s-command-762549/)

AndyBG 10-17-2009 05:01 AM

Where is the httpd -S command
 
I have a Debian Etch distribution.

My "Apache Cookbook" (O'Reilly, December, 2007) tells me that "It is particularly instructive to run httpd -S and observe the virtual host configuration as Apache understands it"

However, when I type-in the command, I am told "-bash: httpd: command not found" which is particularly uninstructive.

I've had a good rummage around in my server but I can't pin-point exactly where this command is?

Thanks to anyone who can help.

pixellany 10-17-2009 05:11 AM

I assume that Apache is installed....

Did you try running the command as root (First do "su -", so that you get root's environment)

Try this in a terminal (as root)
Code:

find / -name "*httpd*"  (may take a while)
OR

Code:

man httpd
##if the command is there, then so should be the man page.

repo 10-17-2009 05:23 AM

Try
Code:

apache2 -V

AndyBG 10-17-2009 05:43 AM

Thanks for the quick responses.

find / -name "*httpd*"

Code:

/etc/apache2/httpd.conf
/usr/share/doc/apache2-doc/manual/programs/httpd.html
/usr/share/doc/apache2-doc/manual/programs/httpd.html.ko.euc-kr
/usr/share/doc/apache2-doc/manual/programs/httpd.html.en
/usr/share/doc/libnet-server-perl/examples/httpd.gz
/usr/share/doc/apache2.2-common/examples/apache2/original/httpd.conf.gz
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-multilang-errordoc.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-languages.conf.gz
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-vhosts.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-ssl.conf.gz
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-info.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-userdir.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-manual.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-dav.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-default.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-mpm.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/extra/httpd-autoindex.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-multilang-errordoc.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-languages.conf.gz
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-vhosts.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-ssl.conf.gz
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-info.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-userdir.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-manual.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-dav.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-default.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-mpm.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-autoindex.conf
/usr/lib/apache2/modules/httpd.exp

man httpd

Code:

No manual entry for httpd
apache2 -V

Code:

Server version: Apache/2.2.3
Server built:  Jul 29 2009 09:49:56
Server's Module Magic Number: 20051115:3
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:  32-bit
Server MPM:    Prefork
  threaded:    no
    forked:    yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=""
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"

It looks like I don't have it. What should I do to get it?

My /etc/apt/sources.list looks like this (if it's of any use)

Code:

# debian etch i386 port defaults
deb http://ftp2.ca.debian.org/debian etch main contrib non-free
deb http://ftp2.ca.debian.org/debian-security etch/updates main contrib non-free

Thanks!

pixellany 10-17-2009 06:34 AM

http://httpd.apache.org/docs/2.2/
This describes the option you are talking about, but also says that "httpd" is not the normal way to start the daemon.

In your output from find, there seem to be some manuals. but no "httpd" command.

I've never used Apache, so we've pretty much hit the wall as far as getting help from me.......

AlucardZero 10-17-2009 09:58 AM

RedHat changed Apache's name to "httpd". Debian didn't, so you won't find an httpd binary. I don't use Apache either, but doesn't apache2 -S work?

AndyBG 10-17-2009 11:00 AM

@AlucardZero : That did the trick! Thanks

jangulasion 12-17-2010 03:41 PM

apache2 -S wont work in Ubuntu
you will get this error:
apache2: bad user name ${APACHE_RUN_USER}

use this instead:
apache2ctl - S

x16man 12-22-2011 10:23 AM

I'm using Ubuntu11.10
 
In Ubuntu you can use the command:
apache2 -l

to show compiled in modules.


All times are GMT -5. The time now is 08:37 PM.