Red Hat / CentOS / Fedora – Install/Configure Cerbot

| | | | | |

This is a work in progress….

# Install/Configure Apache - Start
# Install Apache
sudo yum -y install httpd

# Install SSL
sudo yum -y install mod_ssl openssl

# Start and Enable Apache
sudo systemctl start httpd.service
sudo systemctl enable httpd.service

# Open Firewall for HTTP and HTTPS
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

# Install/Configure PHP - Start
# Install PHP with extensions
sudo yum -y install php php-soap curl curl-devel

# Create simple PHP Info page to verify PHP is working in Apache
sudo echo "<?PHP phpinfo() ?>" | sudo tee /var/www/html/info.php

echo "AddType application/x-httpd-php .php" | sudo tee -a /etc/httpd/conf/httpd.conf
# Install/Configure PHP - Stop

# Restart Apache
sudo systemctl restart httpd.service

# Install/Configure Apache - Stop

# Download/Install EPEL - Start
cd ~/
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh epel-release-latest-7.noarch.rpm
sudo yum repolist all | grep epel
# Download/Install EPEL - Stop

# Install Cerbot
sudo yum -y install python-certbot-apache

# Configure Cerbot with Apache
sudo certbot --apache

All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.