#Install web2py Web Framework

<div class="text-success lead">
This article illustrates how to install Web2py
</div>

<img src="logo_web2py.jpg"/>

Web2Py is a"<i>Free open source full-stack framework for rapid development of fast, scalable, 
secure and portable database-driven web-based applications. 
Written and programmable in Python</i>"

* [Web2py web site](http://www.web2py.com)

Download from Web2py download page the Source code:

<pre class="minicom">
~# <b>wget http://www.web2py.com/examples/static/web2py_src.zip</b>
</pre>

and unzip it:

<pre class="minicom">
~# <b>unzip -a web2py_src.zip</b>
</pre>

If you don't have unzip install it:

<pre class="minicom">
~# <b>apt-get update</b>
~# <b>apt-get install unzip</b>
</pre>

Move inside the just created __web2py__ directory and launch web2py:

<pre class="minicom">
~# <b>cd web2py</b>
~/web2py# <b>python web2py.py -a 'AdminPwd' --ip 0.0.0.0</b>
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2007
Version 2.8.2-stable+timestamp.2013.11.28.13.54.07
Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib)
please visit:
	http://127.0.0.1:8000/
use "kill -SIGTERM 2400" to shutdown the web2py server
</pre>

Open a browser and access to the web2py embedded web server from this url:

* [http://ariag25.local:8000](http://ariag25.local:8000)

Due to security reasons, the web2py admin application is not usable
on an insecure channel so we have to use https instead of http protocol
using __openssl__.

##Using Web2py in https

Install openssl:

<pre class="minicom">
~# <b>apt-get update</b>
~# <b>apt-get install openssl</b>
</pre>

Start by generating a certificate files, if you don't have them already:

<pre class="minicom">
~# <b>openssl genrsa -out server.key 2048</b>
Generating RSA private key, 2048 bit long modulus
..........................................................+++
..........................................................+++
e is 65537 (0x10001)

~# <b>openssl req -new -key server.key -out server.csr</b>
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:IT
State or Province Name (full name) [Some-State]:Rome
Locality Name (eg, city) []:Ladispoli
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

~# <b>openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt</b>
Signature ok
...
</pre>

Copy the __server.key__ and __server.crt__ files to your web2py root folder.

<pre class="minicom">
~# <b>cp server.key web2py</b>
~# <b>cp server.crt web2py</b>
</pre>

Then start the web2py application using the certificate files:

<pre class="minicom">
~# <b>cp web2py</b>
~/web2py# <b>python web2py.py -a 'AdminPwd' -c server.crt -k server.key -i 0.0.0.0 -p 8000</b>
</pre>

Open a browser and access to the web2py embedded web server in https from this url:

* [https://ariag25.local:8000](https://ariag25.local:8000)

Now it is possible to access to the Administrator page

#License

web2py is copyrighted by [Massimo Di Pierro](http://www.cdm.depaul.edu/People/Pages/facultyinfo.aspx?fid=343). The web2py trademark is owned by Massimo Di Pierro.

* [Read more](http://www.web2py.com/init/default/license)

@shop='ARIETTA-G25'
@shop='ARIETTA-G25-256'
@shop='WIFI-2'
@shop='AN-WIFI-01'
@shop='AN-WIFI-02'




