Apache2.4 -
Apache is the most widely used web server software. Developed and maintained by Apache Software Foundation, Apache is an open source software available for free.
To Install Apache2.4 run the following command at the Linux terminal.
Check Apache Service-
Enable default-ssl.conf site using the command below.
To redirect HTTPS request to HTTP modify /etc/apache/sites-available/default-ssl.conf file. (In my case, I'm using default SSL site, you can modify your Vhost that have SSL configuration.)
Edit Virtual host configuration file-
After, change the required configuration, your website should redirect to http from https. https://192.168.102.10
!!Cheers!!
Apache is the most widely used web server software. Developed and maintained by Apache Software Foundation, Apache is an open source software available for free.
Prerequisites -
- One Linux box
- A user with Sudo access
To Install Apache2.4 run the following command at the Linux terminal.
$ sudo apt install apache2
$ sudo systemctl status apache2.service
Step 2- Enable HTTPS
Default Apache installation works only with HTTP, To enable HTTPS, follow the steps below.
Default Apache installation works only with HTTP, To enable HTTPS, follow the steps below.
$ sudo vi /etc/apache2/ports.conf
Add Listen 443 line-Listen 80
Listen 443
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
Save and Exit from the file. Restart Apache service to apply changes.Enable default-ssl.conf site using the command below.
$ sudo a2ensite default-ssl.conf
Enable SSL Module.$ sudo a2enmod ssl
Now, restart apache service to apply changes.$ sudo systemctl status apache2.service
Step 3- Redirect HTTPS request to HTTP.To redirect HTTPS request to HTTP modify /etc/apache/sites-available/default-ssl.conf file. (In my case, I'm using default SSL site, you can modify your Vhost that have SSL configuration.)
Edit Virtual host configuration file-
sudo vi /etc/apache2/sites-available/default-ssl.conf
Add following line between virtual host configuration.<If "%{HTTPS} == 'on'" >
Redirect permanent / http://192.168.102.10/
</If>
Your VirtualHost configuration should be like this.<VirtualHost _default_:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/html <If "%{HTTPS} == 'on'" > Redirect permanent / http://192.168.102.10/ </If> # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combinedSave and restart Apache Service.
$ sudo systemctl status apache2.service
Step 4- Test your website-After, change the required configuration, your website should redirect to http from https. https://192.168.102.10
!!Cheers!!
No comments:
Post a Comment