Feb 15, 2014

install openvpn admin gui web base administration part 1

there are so many openvpn administration software, there are : 


  • http://openvpncertmgmt.sourceforge.net/ 
  • http://sourceforge.net/projects/openvpn-admin/?source=recommended
  • http://sourceforge.net/projects/openvpn-control/?source=recommended
  • http://www.bytemine.net/en/bytemine-manager
  • http://sourceforge.net/projects/openvpn-control/files/?source=navbar


but, today i will share my experience installing purplenet, i think its better, ok lets start.


A. install purplenet openvpn server gui administration 

apt-get install bridge-utils vlan ebtables openvpn libapache2-mod-python postgresql python-psycopg2 python-django 

note: 
if you want to install by your self independently, you can use this way : 
wget http://www.djangoproject.com/download/1.1.1/tarball/
tar zxf Django-1.1.1.tar.gz
cd Django-1.1.1
sudo cp -pr django /usr/local/lib/python2.5/site-packages/

then
python setup.py

B. Create Database for purplenet




sudo -u postgres createuser -S -D -R -l -P -E purplenet
sudo -u postgres createdb --encoding=UTF-8 --owner=purplenet purplenetdb

edit your hba

vim /etc/postgresql/9.1/main/pg_hba.conf
just like this :
host purplenetdb purplenet 127.0.0.1/32 md5
or 
host    all         all         127.0.0.1/32          md5

C. Install Purplenet

wget http://sourceforge.net/projects/purplenet/files/purplenet-0.7.2/purplenet-0.7.2.tar.bz2/download
bzip2 -dc purplenet-0.7.2.tar.bz2 | tar xf -
mkdir -p /opt
sudo cp -r purplenet-0.7.2 /opt
sudo ln -s /opt/purplenet-0.7.2 /opt/purplenet

edit your seting.py

cd /opt/purplenet/purplenet
sudo cp settings.py.dist settings.py
vim /opt/purplenet/purplenet/settings.py

ADMINS = (
        ('Firstname Surname', 'firstname.surname@yourdomain'),
)

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'purplenetdb'
DATABASE_USER = 'purplenet'
DATABASE_PASSWORD = 'yourpassword'
DATABASE_HOST = '127.0.0.1'
DATABASE_PORT = '5432'
MEDIA_ROOT = '/opt/purplenet/media'
MEDIA_URL = 'http://servername/purplenet/media/'
ADMIN_MEDIA_PREFIX = '/purplenet/media/admin/'
SECRET_KEY = 'yourSecretKey'
LOGIN_URL = '/purplenet/login/'
TEMPLATE_DIRS = (
       '/opt/purplenet/templates',
)
FIXTURE_DIRS = (
      '/opt/purplenet/fixtures'
)
PURPLENET_LOGOUT_URL = "http://servername/"
PURPLENET_SETUP_KEY = "yourOtherSecretKey"

edit your mkca.conf and openssl template

vim /opt/purplenet/libpurplenet/mkca.cnf
countryName_default = US
localityName_default            = Montreal
organizationName_default        = SuperFastVPN
organizationalUnitName_default  = vpn

vim /opt/purplenet/templates/mkca/openssl.cnf
countryName_default             = US
localityName_default            = Montreal
organizationName_default        = SuperFastVPN
organizationalUnitName_default  = vpn

D. Create Database purplenet


cd /opt/purplenet
source env.sh
manage syncdb

.....
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use 'someuser'): administrator
E-mail address: firstname.surname@organisation.com
Password: 
Password (again): 
Superuser created successfully.
Installing index for auth.Permission model
Installing index for auth.Message model
Installing index for admin.LogEntry model
....

this user will use to setup purplenet web.

E. Configure Apache

vim /etc/apache2/sites-available/default.
<Location /purplenet>
     SetHandler python-program
    PythonHandler django.core.handlers.modpython
     SetEnv DJANGO_SETTINGS_MODULE purplenet.settings
     PythonOption django.root /purplenet
     PythonDebug On
     PythonAutoReload On
    PythonPath "['/opt/purplenet'] + sys.path"
     PythonInterpreter purplenet
</Location>
Alias "/purplenet/media/admin" "/usr/local/lib/python2.5/site-packages/django/contrib/admin/media/"
Alias "/purplenet/media" "/opt/purplenet/media"
<Location /purplenet/media>
   SetHandler None
</Location>

Apache needs now be restarted with the new configuration with the following
command:
sudo /etc/init.d/apache2 restart

F. Configure CA Directory

sudo mkdir -p /var/lib/purplenet/ca
sudo chown www-data:www-data /var/lib/purplenet/ca
sudo chmod 750 /var/lib/purplenet/ca

the last, enter to :

http://yourwebserver/purplenet/setup/


install purplenet openvpn server administration

turn to the next page, lets setup the purplenet-web
if you want to try this connection, you can download vpn tcp configuration here (the password is trial5)


.
there are so many openvpn administration software, there are : 


  • http://openvpncertmgmt.sourceforge.net/ 
  • http://sourceforge.net/projects/openvpn-admin/?source=recommended
  • http://sourceforge.net/projects/openvpn-control/?source=recommended
  • http://www.bytemine.net/en/bytemine-manager
  • http://sourceforge.net/projects/openvpn-control/files/?source=navbar


but, today i will share my experience installing purplenet, i think its better, ok lets start.


A. install purplenet openvpn server gui administration 

apt-get install bridge-utils vlan ebtables openvpn libapache2-mod-python postgresql python-psycopg2 python-django 

note: 
if you want to install by your self independently, you can use this way : 
wget http://www.djangoproject.com/download/1.1.1/tarball/
tar zxf Django-1.1.1.tar.gz
cd Django-1.1.1
sudo cp -pr django /usr/local/lib/python2.5/site-packages/

then
python setup.py

B. Create Database for purplenet




sudo -u postgres createuser -S -D -R -l -P -E purplenet
sudo -u postgres createdb --encoding=UTF-8 --owner=purplenet purplenetdb

edit your hba

vim /etc/postgresql/9.1/main/pg_hba.conf
just like this :
host purplenetdb purplenet 127.0.0.1/32 md5
or 
host    all         all         127.0.0.1/32          md5

C. Install Purplenet

wget http://sourceforge.net/projects/purplenet/files/purplenet-0.7.2/purplenet-0.7.2.tar.bz2/download
bzip2 -dc purplenet-0.7.2.tar.bz2 | tar xf -
mkdir -p /opt
sudo cp -r purplenet-0.7.2 /opt
sudo ln -s /opt/purplenet-0.7.2 /opt/purplenet

edit your seting.py

cd /opt/purplenet/purplenet
sudo cp settings.py.dist settings.py
vim /opt/purplenet/purplenet/settings.py

ADMINS = (
        ('Firstname Surname', 'firstname.surname@yourdomain'),
)

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'purplenetdb'
DATABASE_USER = 'purplenet'
DATABASE_PASSWORD = 'yourpassword'
DATABASE_HOST = '127.0.0.1'
DATABASE_PORT = '5432'
MEDIA_ROOT = '/opt/purplenet/media'
MEDIA_URL = 'http://servername/purplenet/media/'
ADMIN_MEDIA_PREFIX = '/purplenet/media/admin/'
SECRET_KEY = 'yourSecretKey'
LOGIN_URL = '/purplenet/login/'
TEMPLATE_DIRS = (
       '/opt/purplenet/templates',
)
FIXTURE_DIRS = (
      '/opt/purplenet/fixtures'
)
PURPLENET_LOGOUT_URL = "http://servername/"
PURPLENET_SETUP_KEY = "yourOtherSecretKey"

edit your mkca.conf and openssl template

vim /opt/purplenet/libpurplenet/mkca.cnf
countryName_default = US
localityName_default            = Montreal
organizationName_default        = SuperFastVPN
organizationalUnitName_default  = vpn

vim /opt/purplenet/templates/mkca/openssl.cnf
countryName_default             = US
localityName_default            = Montreal
organizationName_default        = SuperFastVPN
organizationalUnitName_default  = vpn

D. Create Database purplenet


cd /opt/purplenet
source env.sh
manage syncdb

.....
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use 'someuser'): administrator
E-mail address: firstname.surname@organisation.com
Password: 
Password (again): 
Superuser created successfully.
Installing index for auth.Permission model
Installing index for auth.Message model
Installing index for admin.LogEntry model
....

this user will use to setup purplenet web.

E. Configure Apache

vim /etc/apache2/sites-available/default.
<Location /purplenet>
     SetHandler python-program
    PythonHandler django.core.handlers.modpython
     SetEnv DJANGO_SETTINGS_MODULE purplenet.settings
     PythonOption django.root /purplenet
     PythonDebug On
     PythonAutoReload On
    PythonPath "['/opt/purplenet'] + sys.path"
     PythonInterpreter purplenet
</Location>
Alias "/purplenet/media/admin" "/usr/local/lib/python2.5/site-packages/django/contrib/admin/media/"
Alias "/purplenet/media" "/opt/purplenet/media"
<Location /purplenet/media>
   SetHandler None
</Location>

Apache needs now be restarted with the new configuration with the following
command:
sudo /etc/init.d/apache2 restart

F. Configure CA Directory

sudo mkdir -p /var/lib/purplenet/ca
sudo chown www-data:www-data /var/lib/purplenet/ca
sudo chmod 750 /var/lib/purplenet/ca

the last, enter to :

http://yourwebserver/purplenet/setup/


install purplenet openvpn server administration

turn to the next page, lets setup the purplenet-web
if you want to try this connection, you can download vpn tcp configuration here (the password is trial5)

4 comments:

  1. awesome blog it's very nice and useful i got many more information it's really nice i like your blog styleweb design company in velachery

    ReplyDelete
  2. It has drastically changed the nature of social cooperation around the world. Websites multiply. advertising on the web costs significantly less. What's more, it has made systems administration examples of overcoming adversity. Web 2.0 gives you full power over your business while including littler however extremely valuable highlights to it. Web Design Curriculum

    ReplyDelete