linux_wiki:network_services_overview_apache_web_server

This is an old revision of the document!


Network Services Overview: Apache Web Server

General Information

This page covers the Network Services objectives, specifically for the Apache Web Server.

Network Services Objectives

  • Install the packages needed to provide the service
  • Configure SELinux to support the service
  • Use SELinux port labeling to allow services to use non-standard ports
  • Configure the service to start when the system is booted
  • Configure the service for basic operation
  • Configure host-based and user-based security for the service

Install the packages needed to provide the service

Install Apache Web Server (httpd)

yum install httpd

Configure SELinux to support the service

Use SELinux port labeling to allow services to use non-standard ports

Configuring the Apache Web Server with a non standard port and allowing port access with selinux.

NOTE: “man semanage-port” has examples for allowing non-standard ports!


Change httpd port

vim /etc/httpd/conf/httpd.conf
 
Listen 8282


Restart httpd service

systemctl stop httpd
systemctl start httpd
  • service should fail to start


See why

systemctl status httpd -l
  • Should see permission denied to make socket 8282

View http ports SELinux allows

semanage port -l | grep http


Label port 8282 for the http service

semanage port -a -t http_port_t -p tcp 8282
  • semanage port → SELinux port mapping tool
  • -a → add a record
  • -t http_port_t → Type http_port_t
  • -p tcp → Protocol tcp
  • 8282 → the port

Configure the service to start when the system is booted

Check Current Service Status

systemctl status httpd
  • Also displays if the service is enabled or disabled


Enabling a service to start on boot

systemctl enable httpd

Configure the service for basic operation

Start the service

systemctl start httpd

Configure host-based and user-based security for the service

Allow access through the firewall

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

  • linux_wiki/network_services_overview_apache_web_server.1472323058.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)