I found that doing it the "hard" way was in some way easier for me.

Been at least 2 months since I setup the server on vps and its amazing
how much you can forget in 2 months when you have to cram other stuff
in your head, but here is what I recall of it:

1) Disable admin. Setup a sudo user (I recall there being some decent
online documentation for this... you can do an impressive amount of
customization on sudo privileges)

2) Download the source folder for Web2py on your local machine and
look at the file ./scripts/setup-web2py-unbuntu.sh to figure out the
dependencies.

3) Install the dependencies. Of the dependencies...

ssh is installed by default on vps so you don't need to worry about
it.

You can change python 2.5 for python 2.6 without problems too.

I recall the following being optional (didn't install them as I wanted
a minimalistic installation):

mercurial
python-reportlab
python-matplotlib
postfix

4) The following set of instructions was pretty straightforward and
right on the mark:

cd /home
mkdir www-data
cd www-data
rm web2py_src.zip*
wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
chown -R www-data:www-data web2py

a2enmod ssl
a2enmod proxy
a2enmod proxy_http
a2enmod headers
a2enmod expires
mkdir /etc/apache2/ssl

5) Haven't setup an ssl certificate yet so I'm not sure about that
part.

6) Make sure Apache is not running. Write the apache config file for
wsgi using the model file provide it to you (but consider it a
template file, don't just copy it verbatim). If you do some searching,
I vaguely recall there being 2 versions for the temple (1 was better),
but you should lookup the configuration file and make sure it matches
what you have (in my case, I had to modify it a little).

7) Setup iptables and make a bunch of rules that makes the firewall as
tight as you can make it for your usage (minimall, you should

You can setup a file in /etc/network/if-pre-up for the firewall
settings to apply automatically everytime your machine boots.

A good Reference I used for the iptables rules:

http://www.amazon.ca/Linux-Administration-Beginners-Guide-Fifth/dp/0071545883/ref=sr_1_1?s=gateway&ie=UTF8&qid=1285255663&sr=8-1

Some of the info is dated (particularly the section about GRUB), but
from a beginner level, the section about networking, routers and
firewalls is rock-solid.

8) Setup your PostGreSQL db. I don't recall the specifics, but if you
have a modicum of patience, all the info can be found here:
http://www.postgresql.org/docs/ (I seem to recall I had some trouble
following the instructions in the deployment recipe so I had to lookup
the official PostgreSQL docs)

Also, make sure you modify your model in your Web2py app with your DB
info.

Instructions for for modifying your model file can be found here:

http://web2py.com/book/default/chapter/11#PostgreSQL

9) Ah, there was an exploit that recently poped up with the Linux
kernel. Make sure that you're running the kernel version 2.6.32-24 or
later.

You can figure out which version of the kernel your're running by
typing "uname -r".

Instructions on patching the kernel for Ubuntu can be found here:

http://www.vps.net/forum/public-forums/announcements/3309-update-your-ubuntu-installs#post30846

Reply via email to