• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

httpd Command Examples in Linux

by admin

HTTPD refers to the Apache2 web server, and is commonly used on Linux systems. Web servers commonly use the HTTP Protocol to transfer web pages. Apart from HTTP, protocols such as HTTPS and FTP are also supported. To install httpd in a CentOS/RHEL server:

# yum install httpd -y

Now let’s start it, since this is CentOS/RHEL distribution, use the below systemctl command:

# systemctl enable --now httpd

Now you can navigate to the browser and go to address “http://127.0.0.1:8080” to open the basic welcome page of apache.

httpd Command Examples

1. To set the initial value for the server root:

# httpd -d /var/tmp/ 

2. To set the config file:

# httpd -c /etc/myconfig.conf 

3. To start/restart/stop the apache web service:

# httpd start
# httpd stop
# httpd restart
# httpd graceful
# httpd graceful-stop 

4. To process the config directive before reading config file:

# httpd -C 

5. To process the config directive before reading config file:

# httpd -c 

6. To set a configuration parameter:

# httpd -D 

7. To set the log level for the http daemon:

# httpd -e 

8. To sent error message during server startup to file:

# httpd -E /tmp/error.log 

9. To set the directory for shared object files:

# httpd -R /dri/path 

10. To get the help for httpd:

# httpd -h 

11. To see the list of modules compiled into the server:

# httpd -l 

12. To see the list of directives:

# httpd -L 

13. To see the list of static and loaded modules:

# httpd -M 

14. To see the settings parsed from the configuration file:

# httpd -S 

15. To run syntax test for config files only:

# httpd -t 

16. To print the version of httpd:

# httpd -v 

17. To print the version and build parameters of httpd:

# httpd -V 

18. To run the httpd in debu mode:

# httpd -X 

19. To install apache as Windows NT sevice:

# httpd -k install
# httpd -k config
# httpd -k uninstall 

20. The name of the Apache service to signal:

# httpd -n name 

21. To keep the console window open on error so that the error message can be read:

# httpd -w 

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Increase KVM Guest vCPU Resources
  2. What is SUID, SGID and Sticky bit ?
  3. How to Convert Ext File Systems to Btrfs
  4. How to Disable NetworkManager in CentOS/RHEL 8
  5. dconf Command Examples in Linux
  6. Understanding linux parted utility
  7. How To Disable Weak Cipher And Insecure HMAC Algorithms In SSH Services In CentOS/RHEL 8
  8. semanage Command Examples in Linux
  9. How to activate a “SUSPENDED” LVM physical volume
  10. abbr Command Examples in fish-shell

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright