Apache Introduction & Apache Shell Commands Print

  • http, apache, web server, httpd
  • 2

One of the best & most used HTTP Server On The Internet. The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows. Apache servers files from http requests made by applications using port 80, 8080 or 143 with ssl certificates. We can also customize this ports using apache config file.
Following are some of the commands that will help you know the apache which is already installed on your system:
which httpd, tells where is http executable is located. 
whereis httpd, gives path of http executable with config path. 
httpd -v, shows version of apache installed in your system.
httpd -t -D DUMP_MODULES, shows all modules loaded with apache. 
httpd -t -D DUMP_VHOSTS , lists all vhosts[virtual hostnames] from apache config file.
httpd -t, shows if your apache config syntax is good or not.
Below are few more commands you may want to check:
Usage:  httpd [-D name] [-d directory] [-f file]
                                   [-C "directive"] [-c "directive"]
                                   [-k start|restart|graceful|graceful-stop|stop]
                                   [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]
Options:
  -D name            : define a name for use in  directives
  -d directory       : specify an alternate initial ServerRoot
  -f file            : specify an alternate ServerConfigFile
  -C "directive"     : process directive before reading config files
  -c "directive"     : process directive after reading config files
  -e level           : show startup errors of level (see LogLevel)
  -E file            : log startup errors to file
  -v                 : show version number
  -V                 : show compile settings
  -h                 : list available command line options (this page)
  -l                 : list compiled in modules
  -L                 : list available configuration directives
  -G                : list available configuration directives after loading conf file
  -t -D DUMP_VHOSTS  : show parsed settings (currently only vhost settings)
  -S                 : a synonym for -t -D DUMP_VHOSTS
  -t -D DUMP_MODULES : show all loaded modules
  -M                 : a synonym for -t -D DUMP_MODULES
  -t                 : run syntax check for config files
  -T                 : start without DocumentRoot(s) check
To summarize the article, what apache does is, listens to the port that it has configured and serves files to the requested client. To check apache connections on your server run command:
lsof -i | grep httpd
netstat -peanut | grep "httpd" | grep ":::"

Was this answer helpful?

« Back

Powered by WHMCompleteSolution