General Information
This page covers the Network Services objectives, specifically for the Apache Web Server.
Network Services Objectives
The following virtual machines will be used:
Install Apache Web Server (httpd) and manual
yum install httpd httpd-manual
Access the httpd-manual
http://localhost/manual OR elinks /usr/share/httpd/manual/<page|section>
# Install package yum install setools-console # View all label types seinfo -t # Find Apache types seinfo -t | grep httpd
Configuring the Apache Web Server with a non standard port and allowing port access with selinux.
semanage port -l | grep http
Change HTTPD's Port
Change httpd port
vim /etc/httpd/conf/httpd.conf Listen 8282
Restart httpd service
systemctl stop httpd systemctl start httpd
See why
systemctl status httpd -l
SELinux: Configure Non Standard Port
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
Check Current Service Status
systemctl status httpd
Enabling a service to start on boot
systemctl enable httpd
Enable and Start the service
systemctl enable httpd
systemctl start httpd
Allow access through the firewall
# Standard http/https ports firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https firewall-cmd --reload # Non-standard port example firewall-cmd --permanent --add-port=8282/tcp firewall-cmd --reload
/etc/httpd/conf/httpd.conf
<Directory "/var/www/html"> # Blacklist "server1" <RequireAll> Require all granted Require not host server1 </RequireAll> </Directory>