CentOS 7 Apache Virtual Host Install and Configure

SET HOSTNAME
hostnamectl set-hostname firewall
hostnamectl set-hostname firewall --pretty
hostnamectl set-hostname firewall --static
sysctl -p
systemctl restart network

CONFIGURE NIC AS PUBLIC (for firewalld)
/etc/sysconfig/network-scripts/ifconfig-eno16777984: ZONE="public"
sysctl -p
systemctl restart network

ENABLE FIREWALLD AND PERSISTANT OPEN 22, 80, 443
systemctl enable firewalld
systemctl start firewalld
systemctl status firewalld
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=public --add-service=ssh
firewall-cmd --reload
sysctl -p
systemctl restart network

INSTALL APACHE
yum clean all
yum -y update
yum install httpd
systemctl enable httpd.service (start at boot)
systemctl start httpd.service (start now)

INSTALL PHP
yum install php
systemctl restart httpd.service

SET TIME ZONE IN PHP.INI
date.timezone = America/Los_Angeles

CREATE VIRTUAL HOST PATHS
chmod -R 755 /var/www/html
mkdir /var/www/html/l0r3_net
chown -R $USER:$USER /var/www/html/l0r3_dev
mkdir /var/www/logs
mkdir /var/www/logs/l0r3_dev
chown -R $USER:$USER /var/www/logs/

CREATE VIRTUAL HOST FILE like: /etc/httpd/conf.d/l0r3_dev.conf
Centos7 Vhost File


0/5 : Not rated