Linux service that converts http to https. For example:
|------------------------------------------|
| WEB CLIENT |
|------------------------------------------|
| ^
v |
|------------------------------------------|
|Sever B: 192.168.0.2 (http2https) |
|HTTPS B service: https://192.168.0.2:8443/|
|------------------------------------------|
| ^
v |
|------------------------------------------|
|Server A: 192.168.0.10 |
|HTTP A service: http://192.168.0.10:8080/ |
|------------------------------------------|Here we want to use Sever B as a HTTPS proxy, redirecting all the requests to the HTTP service at Server A. Notice that A and B can be the same server.
The following example is an installation at Server B.
NOTE ✅You need to installtmuxandconda.
To install tumx and other dependencies use this command:
admin@serverB:~$ sudo apt install tmux jq opensslFor conda you can download the latest installer from conda.io for your linux distro, for example x86_64:
admin@serverB:~$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.shAnd then installing it with
admin@serverB:~$ bash Miniconda3-latest-Linux-x86_64.shWhen the installer prompt if you want to execute "conda init" select yes. Then to avoid the automatic activation of the conda base environment use this:
admin@serverB:~$ conda config --set auto_activate_base falseClone this repo. Note that where you clone the repo, it will be the installation folder. For example I will clone it in the /home directory of the user "admin", so if I don't set a custom bind name for the service, the installation folder will be /home/admin/http2https.
admin@serverB:~$ git clone https://github.com/Eric106/http2httpsThen cd into the http2https folder:
admin@serverB:~$ cd http2https/Run the installer (your user need to have sudo access to install the linux service) :
admin@serverB:~/http2https$ bash install.shThis will install the conda environment called http2https, then the python packages needed will be installed. In the process it will prompt you for input about the config of your service like :
-http server ip
-http port
-https port
-ssl cert & key. You can select if you want to use a custom ssl cert and key paths or generate a self-signed key pair
-bind name for the service (default http2https). Note that if you change the bind name of the service it will change the name of the instalation folder, and linux service name.
After installation of the linux service you can start, stop and restart it with this simple commands. Assuming that you keep the default service bind name (http2https).
admin@serverB:~$ sudo service http2https startadmin@serverB:~$ tmux a -t http2httpsadmin@serverB:~$ sudo service http2https stopadmin@serverB:~$ sudo service http2https restartNote that for the installation of the service we have 2 important files:
-
/etc/init.d/http2https-> This is the description of the linux service tha name may will be different if you set a custom service bind name. -
/etc/rc.local-> This file set the service to start on server reboot/start.
You just need to cd into your installation folder
admin@serverB:~$ cd http2https/And run the following command
admin@serverB:~/http2https$ bash uninstall.sh