Skip to content

Install and administrate OpenVPN with a web interface (logs visualisations, users managing...)

License

Notifications You must be signed in to change notification settings

modfiles/OpenVPN-Admin

 
 

Repository files navigation

OpenVPN Admin

Summary

Administrate its OpenVPN with a web interface (logs visualisations, users managing...) and a SQL database.

Previsualisation configuration Previsualisation administration

Prerequisite

  • GNU/Linux with Bash and root access
  • Fresh install of OpenVPN
  • Web server (NGinx, Apache...)
  • MySQL
  • PHP >= 5.5 with modules:
    • zip
    • pdo_mysql
  • bower
  • unzip
  • wget
  • sed
  • curl

Debian Jessie

apt-get install openvpn apache2 php7.0-mysql mysql-server php7.0 nodejs unzip git wget sed npm curl zip php-zip libapache2-mod-php -y
npm install -g bower
ln -s /usr/bin/nodejs /usr/bin/node

CentOS 7

# yum install epel-release
# yum install openvpn httpd php-mysql mariadb-server php nodejs unzip git wget sed npm
# npm install -g bower
# systemctl enable mariadb
# systemctl start mariadb

Other distribution... (PR welcome)

Tests

Only tested on Debian Jessie. Feel free to open issues.

Installation

  • Setup OpenVPN and the web application:

    cd /var/www
    git clone https://github.com/modfiles/OpenVPN-Admin openvpn-admin
    cd openvpn-admin
    ./install.sh www_base_dir web_user web_group
    
    Sample input
    ./install.sh /var/www/html nobody nogroup
    
  • Setup the web server (Apache, NGinx...) to serve the web application.

  • Guide in Apache2 configuration on Ubuntu 16.04 https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04

  • Create the admin of the web application by visiting http://your-installation/index.php?installation

Usage

  • Start OpenVPN on the server (for example systemctl start openvpn@server)
  • Connect to the web application as an admin
  • Create an user
  • User get the configurations files via the web application (and put them in /etc/openvpn)
  • Users on GNU/Linux systems, run chmod +x /etc/openvpn/update-resolv.sh as root
  • User run OpenVPN (for example systemctl start openvpn@client)

Update

git pull origin master
./update.sh www_base_dir

Sample input
./update.sh /var/www/html

Desinstall

It will remove all installed components (OpenVPN keys and configurations, the web application, iptables rules...).

./desinstall.sh www_base_dir

Sample input
./desinstall.sh /var/www/html

Fix mysql not accepting 00:00:00:00 as default value in Ubuntu

sudo nano /etc/mysql/conf.d/disable_strict_mode.cnf
# Add the following entries

[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

# Save (Ctrl +X, Y) and restart MySQL server
sudo service mysql restart

Use of

About

Install and administrate OpenVPN with a web interface (logs visualisations, users managing...)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 45.8%
  • Shell 41.5%
  • JavaScript 12.4%
  • CSS 0.3%