Reverse proxy setup with httpd service - RHEL 9

Install httpd

dnf install httpd

Check httpd service status 

systemctl status httpd
systemctl start httpd
systemctl enable httpd

Httpd service configurations path

cd /etc/httpd

Httpd service configurations file

/etc/httpd/conf/httpd.conf

Httpd logs

/var/log/httpd/access_log

/var/log/httpd/error_log

Add proxy modules to httpd configs

cd /etc/httpd/conf.modules.d/
vi 00-proxy.conf

Add following 2 lines in to the file 00-proxy.conf

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Create a new virtual host configuration file

cd /etc/httpd/conf.d
touch my-reverse-proxy.conf

Add following configs

<VirtualHost *:80>

    ServerName maleeshatst.codegen.net

    ProxyPreserveHost On

    ProxyRequests Off

    ProxyPass / http://192.168.2.118:8080/

    ProxyPassReverse / http://192.168.2.118:8080/

    <Proxy *>

        Require all granted

    </Proxy>

</VirtualHost>


Or

<VirtualHost *:80>
ServerName rcclqatbx.codegen.net
ProxyPreserveHost On
ProxyPass / http://192.168.1.133:7070/
ProxyPassReverse / http://192.168.1.133:7070/
Timeout 5400
ProxyTimeout 5400
</VirtualHost>

Check syntax errors for httpd

apachectl configtest

Restart httpd service 

systemctl restart httpd


Maleesha Gimshan | 21st June 2025

Comments

Popular posts from this blog

ArgoCD Installation

Setup sqlplus for AWS RDS Oracle DB in a Linux server

Linux File Permissions – Quick Short Note