Web Interface for OpenVPN

So, at some point I was really tired of all the steps to create the users keys and certificates and generating the installer and decided to make a simple web interface to manage all that.

With this interface you will be able to  create and revoke the users certificates and also to check connected users and some statistics.

As I said, it is a very simple web interface and the code can be improved, but this works for me.

In the end you will have something like this:


Here I assume that you followed my Install and Configure OpenVPN using a TAP interface and Create an installer for your Windows VPN clients tutorials.

1 – Install prerequisites.

2 – Enable necessary modules

3 – Install the fonts

Make your server aware of the new fonts so that it can make use of them:

4 – Configure Apache

Add/edit the file to look like this

Change to your web directory

Backup your original index.html:

Create a new index.html:

Add the code:

Create accordion.js

Add the code:

Create default.css

Add the code:

Create the images directory:

Download the OpenVPN logo into that folder.openvpntech_logo1

5 – Prepare scripts

Add the code:

Create list-status.sh

Add the code:

Create routing-status.sh

Add the code:

Create create_lists.sh

Add the code:

Create global-status.sh

Add the code:

Create check-connected-users.sh

Add the code:

Create VPN-WEB.sh

Add the code:

Replace my-vpn-installer for whatever you configured in the step 4 in the Create an installer for your Windows VPN clients tutorial.

Create create-web-vpn-user.sh

Add the code:

Edit this file to match the variables in /etc/openvpn/easy-rsa/vars

Create RVPN-WEB.sh

Add the code:

Create revoke_vpn_access.sh

vim revoke_vpn_access.sh

Add the code:

Create revoke-web-vpn-user.sh

Add the code:

6 – Create necessary files

7 – Change files and folder permissions

8 –  Create the downloads folder