Configure Apache Virtual Hosts - CentOS 7

Configure Apache Virtual Hosts - CentOS 7
This article shows you how to install and setup Apache web server, which can point to your backend Application server using proxy

Install the Apache web server
Update your packages on centos
sudo yum update
Install Apache
sudo yum install httpd
Start the service
sudo service httpd start

Set up Apache server
Apache can be configured by httpd.conf file, which also includes all files present under conf.d folder, so let's create .conf file under conf.d folder
sudo vim /etc/httpd/conf.d/webserver.conf
Past the code and change configuration based on your requirement, here I need to call App server on HTTPS also don't want SSL handshake.
<VirtualHost *:80>
    ServerAdmin email@example.com
    ServerName www.example.com
    ServerAlias example.com
    SSLProxyEngine On

    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off

    ProxyPreserveHost on
    ProxyPass / https://serverIP:port/
    ProxyPassReverse / https://serverIP:port/

</VirtualHost>
Save and quit the file
:wq!
Restart Apache
sudo service httpd restart



After setting Apache server I was getting error
[error] (13)Permission denied: proxy: AJP: attempt to connect to 10.x.x.x:9002 failed
To resolve it I have followed this steps

Comments

Popular posts from this blog

Git Auto Increment tag

Log rotate (catalina.out) of Tomcat

Bypass SSL certificate check for Apache Axis2 client