2014-02-12 10:59:56 +01:00
|
|
|
# OpenVPN Admin
|
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
## Summary
|
|
|
|
Administrate its OpenVPN with a web interface (logs visualisations, users managing...) and a SQL database.
|
2014-02-12 10:59:56 +01:00
|
|
|
|
2016-08-26 14:59:25 +02:00
|
|
|

|
2016-09-12 10:47:17 +02:00
|
|
|

|
2016-08-26 14:59:25 +02:00
|
|
|
|
2014-03-19 21:53:24 +01:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
## Prerequisite
|
2014-03-21 21:47:01 +01:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
* GNU/Linux with Bash and root access
|
|
|
|
* Fresh install of OpenVPN
|
|
|
|
* Web server (NGinx, Apache...)
|
|
|
|
* MySQL
|
|
|
|
* PHP >= 5.5 with modules:
|
|
|
|
* zip
|
|
|
|
* pdo_mysql
|
2015-07-26 18:16:45 +02:00
|
|
|
* bower
|
2015-07-29 13:54:19 +02:00
|
|
|
* unzip
|
|
|
|
* wget
|
|
|
|
* sed
|
2016-12-15 13:11:39 +01:00
|
|
|
* curl
|
2016-08-24 16:56:06 +02:00
|
|
|
|
2018-03-22 10:11:43 +01:00
|
|
|
### Debian 8 Jessie
|
2016-09-12 23:33:38 +02:00
|
|
|
|
|
|
|
````
|
2016-12-15 13:11:39 +01:00
|
|
|
# apt-get install openvpn apache2 php5-mysql mysql-server php5 nodejs unzip git wget sed npm curl
|
2016-09-12 23:33:38 +02:00
|
|
|
# npm install -g bower
|
|
|
|
# ln -s /usr/bin/nodejs /usr/bin/node
|
|
|
|
````
|
|
|
|
|
2018-03-22 10:11:43 +01:00
|
|
|
### Debian 9 Stretch
|
|
|
|
|
2019-05-24 08:36:37 +02:00
|
|
|
In order to install `npm`, [stretch-backports need to be added to your sources.list](https://backports.debian.org/Instructions/#index2h2).
|
|
|
|
|
2018-03-22 10:11:43 +01:00
|
|
|
````
|
2019-05-24 08:36:37 +02:00
|
|
|
# apt-get install -t stretch-backports npm nodejs
|
|
|
|
# apt-get install openvpn apache2 php-mysql mysql-server php-zip php unzip git wget sed curl
|
2018-03-22 10:11:43 +01:00
|
|
|
# npm install -g bower
|
|
|
|
````
|
|
|
|
|
2016-10-30 13:37:43 +01:00
|
|
|
### 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
|
|
|
|
````
|
|
|
|
|
2016-09-12 23:33:38 +02:00
|
|
|
### Other distribution... (PR welcome)
|
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
## Tests
|
2014-03-19 21:53:24 +01:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
Only tested on Debian Jessie. Feel free to open issues.
|
2014-02-12 10:59:56 +01:00
|
|
|
|
|
|
|
## Installation
|
2014-03-21 21:47:42 +01:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
* Setup OpenVPN and the web application:
|
2014-03-21 21:47:42 +01:00
|
|
|
|
2015-07-12 10:32:43 +02:00
|
|
|
$ cd ~/my_coding_workspace
|
|
|
|
$ git clone https://github.com/Chocobozzz/OpenVPN-Admin openvpn-admin
|
|
|
|
$ cd openvpn-admin
|
2018-04-11 21:07:26 +02:00
|
|
|
# ./install.sh /var/www www-data www-data
|
2014-02-12 10:59:56 +01:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
* Setup the web server (Apache, NGinx...) to serve the web application.
|
2016-08-24 16:56:06 +02:00
|
|
|
* Create the admin of the web application by visiting `http://your-installation/index.php?installation`
|
2015-07-09 14:26:07 +02:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
* Start OpenVPN on the server (for example `systemctl start openvpn@server`)
|
|
|
|
* Connect to the web application as an admin
|
|
|
|
* Create an user
|
2015-07-29 15:10:58 +02:00
|
|
|
* User get the configurations files via the web application (and put them in */etc/openvpn*)
|
2015-08-07 19:56:24 +02:00
|
|
|
* Users on GNU/Linux systems, run `chmod +x /etc/openvpn/update-resolv.sh` as root
|
2015-07-09 14:26:07 +02:00
|
|
|
* User run OpenVPN (for example `systemctl start openvpn@client`)
|
|
|
|
|
2015-07-12 10:29:43 +02:00
|
|
|
## Update
|
|
|
|
|
2015-07-12 10:32:43 +02:00
|
|
|
$ git pull origin master
|
2018-04-11 21:07:26 +02:00
|
|
|
# ./update.sh /var/www
|
2016-08-24 16:56:06 +02:00
|
|
|
|
2015-07-12 10:29:43 +02:00
|
|
|
## Desinstall
|
|
|
|
It will remove all installed components (OpenVPN keys and configurations, the web application, iptables rules...).
|
|
|
|
|
2018-04-11 21:07:26 +02:00
|
|
|
# ./desinstall.sh /var/www
|
2015-07-12 10:29:43 +02:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
## Use of
|
|
|
|
|
|
|
|
* [Bootstrap](https://github.com/twbs/bootstrap)
|
2016-09-11 18:48:59 +02:00
|
|
|
* [Bootstrap Table](http://bootstrap-table.wenzhixin.net.cn/)
|
|
|
|
* [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker)
|
|
|
|
* [JQuery](https://jquery.com/)
|
|
|
|
* [X-editable](https://github.com/vitalets/x-editable)
|