Apache
# Install Apache
Upgrade system
sudo dnf upgrade --refresh -y
Install httpd service
sudo dnf install httpd -y
Set Server name
sudo nano /etc/httpd/conf/httpd.conf
ServerName 127.0.0.1
Check Apache config
apachectl configtest
Enable and start httpd service
sudo systemctl enable httpd --now
Add service to Firewall
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
Reload Firewall service
sudo firewall-cmd --reload
# Config Gzip
Config Gzip
sudo nano /etc/httpd/httpd.conf
# Enable gzip with mod_deflate configuration
<IfModule mod_deflate.c>
# Restrict compression to these MIME types
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/css
# Level of compression (Highest 9 - Lowest 1)
DeflateCompressionLevel 9
# Netscape 4.x has some problems.
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
# Config Virtual host
Create Virtual host config file
sudo touch /etc/httpd/conf.d/{domain}.conf
<VirtualHost *:80>
DocumentRoot "/var/www/{domain}/build"
ServerAdmin admin@{domain}
ServerName {domain}
ServerAlias www.{domain}
ErrorLog logs/{domain}-error_log
CustomLog logs/{domain}-access_log common
# <Directory "/var/www/{domain}/build">
# Options FollowSymLinks
# AllowOverride All
# DirectoryIndex index.html index.php
# Require all granted
# </Directory>
</VirtualHost>
Config Proxy pass
ProxyPreserveHost On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://localhost:{port}/
ProxyPassReverse / http://localhost:{port}/