PyGoWave-Server

Differences between revisions 1 and 17 (spanning 16 versions)
Revision 1 as of 2009-10-02 06:31:39
Size: 5589
Editor: ABTS-KK-Dynamic-081
Comment:
Revision 17 as of 2012-09-15 17:17:51
Size: 7079
Editor: Finisterre
Comment: I forgot to update pil
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
To install PyGoWave Server | Google wave server needs the following :

Python 2.6.1
Django 1.0.2
Orbited 0.7.7
RabbitMQ 1.6.0
Python libraries

lxml 2.2
PIL 1.1.6
carrot 0.5.0
Note: It's probably best to check GoogleCode. This page is intended for ubuntu/debian installations, but may not be as up to date: https://code.google.com/p/pygowave-server/wiki/PyGoWaveServerInstallation

To install PyGoWave, you'll need the following (version listing may be incomplete):

 * Python >= 2.6.1
 * Django >= 1.0.2
 * Orbited >= 0.7.7
 * RabbitMQ >= 1.6.0

Python libraries:

 * lxml >= 2.2
 * PIL >= 1.1.6
 * carrot >= 0.5.0, [[https://code.google.com/p/pygowave-server/wiki/PyGoWaveServerInstallation#commentlist|<=0.5.1]]
Line 14: Line 18:
django-rosetta 0.4.0

JavaScript libraries:
MooTools 1.2
MochaUI 0.9.5

Get the dependencies :
<code>

sudo apt-get install python-mysqldb

sudo easy_install carrot

easy_install --find-links http://www.pythonware.com/products/pil/ Imaging

sudo apt-get install mercurial
</code>

Get Python : <code> sudo apt-get install python</code>

Get Django :
<code>
 * django-rosetta 0.4.0

 * JavaScript libraries:
 * MooTools 1.2
 * MochaUI 0.9.5

== Installing ==


=== Prepare to install ===

{{{{
sudo apt-get install python python-pip python-dev subversion mercurial
}}}}

=== Django ===

{{{{
sudo apt-get install python-django python-django-registration
}}}}

'''OR'''
{{{{
Line 37: Line 42:

ln -s `pwd`/django-trunk/django SITE-PACKAGES-DIR/django

ln -s `pwd`/django-trunk/django/bin/django-admin.py /usr/local/bin
</code>

Get Orbited :
<code>
ln -s $(pwd)/django-trunk/django SITE-PACKAGES-DIR/django
ln -s $(pwd)/django-trunk/django/bin/django-admin.py /usr/local/bin
}}}}


=== Dependencies ===
{{{{
sudo apt-get install mysql-server python-mysqldb python-lxml python-simplejson
sudo easy_install carrot==0.5.1
sudo easy_install pil
}}}}


=== Orbited ===

{{{{
Line 46: Line 59:

svn checkout http://orbited.org/svn/orbited/trunk/ [path]
hg clone https://bitbucket.org/desmaj/orbited
cd orbited/daemon
Line 50: Line 62:

</code>

Get RabbitMQ:
<code>
sudo nano /etc/apt/sources.list

#Add these lines below
deb http://www.rabbitmq.com/debian/ testing main
#close and exit

# Get the keys
}}}}


=== RabbitMQ ===

Add the repository to the end of /etc/apt/sources.list
{{{{
echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee -a /etc/apt/sources.list
}}}}

Get the keys
{{{{
Line 65: Line 76:

#Update and install
}}}}
Update and install
{{{{
Line 69: Line 81:
</code>

Install Apache2 and mod_python :
<code>
sudo apt-get install apache2 libapache2-mod-python
sudo /etc/init.d/apache2 -k restart
</code>
Database part:

Mysql:
<code>
mysql -u root -p
}}}}

'''OR'''
{{{{
hg clone -r rabbitmq_v1_6_0 http://hg.rabbitmq.com/rabbitmq-stomp
cd rabbitmq-stomp
make RABBIT_SERVER_INCLUDE_DIR=/usr/lib/erlang/lib/rabbitmq_server-1.6.0/include
mkdir -p /usr/lib/erlang/lib/rabbitmq-stomp
cp -R * /usr/lib/erlang/lib/rabbitmq-stomp
}}}}

=== Install Apache2 and mod_python ===
{{{{
sudo apt-get install apache2 libapache2-mod-python libapache2-mod-proxy-html
sudo /etc/init.d/apache2 restart
}}}}


=== PWG ===
{{{{
sudo mkdir -p /srv/http/
cd /srv/http
svn checkout http://pygowave-server.googlecode.com/svn/tags/alpha_0.3 pygowave_project
}}}}


== Configuring ==

=== Mysql ===
install instrunctions: http://www.zolved.com/synapse/view_content/27986/How_to_install_MySQL_On_Ubuntu
{{{{
mysql -u root -p
Line 84: Line 116:
</code>

Apache2:
{Sample file settings is be described below as per the GoogCode}
<code>
#The file you need to edit is apache2.conf
sudo gedit /etc/apache2/apache2.conf
}}}}

=== Apache2 ===
Sample file settings is be described below as per the GoogCode

The file you need to edit is apache2.conf
{{{{
sudoedit /etc/apache2/sites-available/pygowave
}}}}
Add these details. Be sure to update the PythonPath with the path to your pygowave_project folder. Perhaps move the code to /var/www ?
{{{{
Line 113: Line 148:
To enable images and styles in Django's admin interface you might also need the following lines:

#
To enable images and styles in Django's admin interface you might also need the following lines:
Line 123: Line 160:

</code>

Orbit :
{Need to edit /etc/orbited.cfg}
<code>
sudo nano /etc/orbited.cfg
#Add the line below
}}}}
Then link the site to enable it:
{{{{
cd /etc/apache2/sites-enabled
ln -s ../sites-available/pygowave
}}}}
Enable the proxy mods:
{{{{
cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/proxy.conf .
sudo ln -s ../mods-available/proxy.load .
}}}}
And restart apache2. Make sure there's no errors:
{{{{
sudo /etc/init.d/apache2 restart
}}}}
Perhaps browse to it, just to be sure.

=== Orbit ===
Need to edit:
{{{{
sudoedit /etc/orbited.cfg
}}}}

Add the lines below:
{{{{
Line 135: Line 189:
user=http
group=http
user=www-data
group=www-data
Line 157: Line 211:
</code>
Change "user=" and "group=" to your Apache's user and group. This is "apache2" on some systems.

RabbitMQ :See the attached file
<code>
hg clone -r rabbitmq_v1_6_0 http://hg.rabbitmq.com/rabbitmq-stomp
cd rabbitmq-stomp
make RABBIT_SERVER_INCLUDE_DIR=/usr/lib/erlang/lib/rabbitmq_server-1.6.0/include
mkdir -p /usr/lib/erlang/lib/rabbitmq-stomp
cp -R * /usr/lib/erlang/lib/rabbitmq-stomp

sudo nano /etc/rabbitmq/rabbitmq.conf

#Add the lines below
}}}}
Change "user=" and "group=" to your Apache's user and group. This is "www-data" on some systems. Check in the `/etc/apache2/envvars` file.


=== RabbitMQ ===
{{{{
sudoedit /etc/rabbitmq/rabbitmq-env.conf
}}}}
Add the lines below
{{{{
Line 183: Line 233:

#Now restart
your rabbit server sudo rabbitmq-server if no error then the configuration is fine   #Set persimossions, add user and change password   rabbitmqctl change_password guest $RANDOM$RANDOM$RANDOM

rabbitmqctl add_user pygowave_client pygowave_client

rabbitmqctl add_user pygowave_server pygowave_server

rabbitmqctl set_permissions pygowave_client '^[^.]+\.[^.]+\.waveop$|^wavelet.direct$' '^[^.]+\.[^.]+\.(waveop|clientop)$|^wavelet.topic$' '^[^.]+\.[^.]+\.(clientop|waveop)$|^wavelet.direct$'

rabbitmqctl set_permissions pygowave_server '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.(topic|direct)$' '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.direct$' '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.(topic|direct)$'

</code>


Get
PGW :
<code>
sudo mkdir -p /srv/http/
cd /srv/http
svn checkout http://pygowave-server.googlecode.com/svn/tags/alpha_0.3 pygowave_project

#
Change the settings as per your DB
sudo nano settings.py
}}}}
Double check
your configuration with `sudo rabbitmq-server` and if there's no errors (your configuration is fine) go ahead and restart it.
{{{{
sudo /etc/init.d/rabbitmq-server restart
}}}}
Set persimossions, add user and change password
{{{{
sudo
rabbitmqctl change_password guest $RANDOM$RANDOM$RANDOM
sudo rabbitmqctl add_user pygowave_client pygowave_client
sudo rabbitmqctl add_user pygowave_server pygowave_server
sudo rabbitmqctl set_permissions pygowave_client '^[^.]+\.[^.]+\.waveop$|^wavelet.direct$' '^[^.]+\.[^.]+\.(waveop|clientop)$|^wavelet.topic$' '^[^.]+\.[^.]+\.(clientop|waveop)$|^wavelet.direct$'
sudo rabbitmqctl set_permissions pygowave_server '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.(topic|direct)$' '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.direct$' '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.(topic|direct)$'
}}}}

===
PGW ===
Change the settings as per your DB
{{{{
sudoedit
settings.py
Line 211: Line 252:

chown http media/gadgets media/avatars pygowave_client/cache locale pygowave_client/locale
chown www-data media/gadgets media/avatars pygowave_client/cache locale pygowave_client/locale
}}}}
Make sure to chown the files as whatever apache is running as. Check in /etc/apache2/envvars
Line 215: Line 257:
{{{{
Line 216: Line 259:

</code>
That's it !! PyGoWave Server at http://localhost/pygowave. 

-- [[htpp://www.h3manth.com|h3manth.com]]
----
}}}}

That's it !! PyGoWave Server at http://localhost/pygowave.

Note: It's probably best to check GoogleCode. This page is intended for ubuntu/debian installations, but may not be as up to date: https://code.google.com/p/pygowave-server/wiki/PyGoWaveServerInstallation

To install PyGoWave, you'll need the following (version listing may be incomplete):

  • Python >= 2.6.1

  • Django >= 1.0.2

  • Orbited >= 0.7.7

  • RabbitMQ >= 1.6.0

Python libraries:

  • lxml >= 2.2

  • PIL >= 1.1.6

  • carrot >= 0.5.0, <=0.5.1

Optional:

Installing

Prepare to install

sudo apt-get install python python-pip python-dev subversion mercurial

Django

sudo apt-get install python-django python-django-registration

OR

svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk
ln -s $(pwd)/django-trunk/django SITE-PACKAGES-DIR/django
ln -s $(pwd)/django-trunk/django/bin/django-admin.py /usr/local/bin

Dependencies

sudo apt-get install mysql-server python-mysqldb python-lxml python-simplejson
sudo easy_install carrot==0.5.1
sudo easy_install pil

Orbited

sudo apt-get install python-twisted
hg clone https://bitbucket.org/desmaj/orbited
cd orbited/daemon
python setup.py install

RabbitMQ

Add the repository to the end of /etc/apt/sources.list

echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee -a /etc/apt/sources.list

Get the keys

wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc

Update and install

sudo apt-get update
sudo apt-get install rabbitmq-server

OR

hg clone -r rabbitmq_v1_6_0 http://hg.rabbitmq.com/rabbitmq-stomp
cd rabbitmq-stomp
make RABBIT_SERVER_INCLUDE_DIR=/usr/lib/erlang/lib/rabbitmq_server-1.6.0/include
mkdir -p /usr/lib/erlang/lib/rabbitmq-stomp
cp -R * /usr/lib/erlang/lib/rabbitmq-stomp

Install Apache2 and mod_python

sudo apt-get install apache2 libapache2-mod-python libapache2-mod-proxy-html
sudo /etc/init.d/apache2 restart

PWG

sudo mkdir -p /srv/http/
cd /srv/http
svn checkout http://pygowave-server.googlecode.com/svn/tags/alpha_0.3 pygowave_project

Configuring

Mysql

install instrunctions: http://www.zolved.com/synapse/view_content/27986/How_to_install_MySQL_On_Ubuntu

mysql -u root -p
CREATE DATABASE `pygowave`;
CREATE USER 'pygowave'@'localhost' IDENTIFIED BY 'pygowave';
GRANT ALL PRIVILEGES ON `pygowave`.* TO 'pygowave'@'localhost' WITH GRANT OPTION;

Apache2

Sample file settings is be described below as per the GoogCode

The file you need to edit is apache2.conf

sudoedit /etc/apache2/sites-available/pygowave

Add these details. Be sure to update the PythonPath with the path to your pygowave_project folder. Perhaps move the code to /var/www ?

<Location /pygowave>
  SetHandler python-program
  PythonHandler django.core.handlers.modpython
  SetEnv DJANGO_SETTINGS_MODULE settings
  PythonOption django.root /pygowave
  PythonDebug On
  PythonInterpreter pygowave_django
  PythonPath "['/srv/http/pygowave_project'] + sys.path"
</Location>

Alias /pygowave/media /srv/http/pygowave_project/media
<Location "/pygowave/media">
  SetHandler None
  Options Indexes FollowSymLinks
  Order allow,deny
  Allow from all
</Location>

ProxyRequests Off
ProxyPass /static http://localhost:9000/static
ProxyPass /tcp http://localhost:9000/tcp


# To enable images and styles in Django's admin interface you might also need the following lines:

Alias /admin/media /usr/lib/python2.6/site-packages/django/contrib/admin/media
<Directory /usr/lib/python2.6/site-packages/django/contrib/admin/media>
  Order allow,deny
  Allow from all
</Directory>
<Location "/admin/media">
  SetHandler None
</Location>

Then link the site to enable it:

cd /etc/apache2/sites-enabled
ln -s ../sites-available/pygowave

Enable the proxy mods:

cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/proxy.conf .
sudo ln -s ../mods-available/proxy.load .

And restart apache2. Make sure there's no errors:

sudo /etc/init.d/apache2 restart

Perhaps browse to it, just to be sure.

Orbit

Need to edit:

sudoedit /etc/orbited.cfg

Add the lines below:

[global]
reactor=epoll
pid.location=/var/run/orbited.pid
user=www-data
group=www-data
proxy.enabled=1

[listen]
http://localhost:9000

[access]
* -> localhost:61613

[logging]
debug=SCREEN,/var/orbited/debug.log
info=SCREEN,/var/orbited/info.log
access=SCREEN,/var/orbited/info.log
warn=SCREEN,/var/orbited/error.log
error=SCREEN,/var/orbited/error.log

enabled.default=info,access,warn,error

[loggers]
Daemon=info,access,warn,error
TCPConnection=info,access,warn,error

Change "user=" and "group=" to your Apache's user and group. This is "www-data" on some systems. Check in the /etc/apache2/envvars file.

RabbitMQ

sudoedit /etc/rabbitmq/rabbitmq-env.conf

Add the lines below

NODENAME=rabbit
NODE_IP_ADDRESS=0.0.0.0
NODE_PORT=5672

LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia

SERVER_START_ARGS='
  -pa /usr/lib/erlang/lib/rabbitmq-stomp/ebin
  -rabbit
    stomp_listeners [{"0.0.0.0",61613}]
    extra_startup_steps [{"STOMP-listeners",rabbit_stomp,kickstart,[]}]'

Double check your configuration with sudo rabbitmq-server and if there's no errors (your configuration is fine) go ahead and restart it.

sudo /etc/init.d/rabbitmq-server restart

Set persimossions, add user and change password

sudo rabbitmqctl change_password guest $RANDOM$RANDOM$RANDOM
sudo rabbitmqctl add_user pygowave_client pygowave_client
sudo rabbitmqctl add_user pygowave_server pygowave_server
sudo rabbitmqctl set_permissions pygowave_client '^[^.]+\.[^.]+\.waveop$|^wavelet.direct$' '^[^.]+\.[^.]+\.(waveop|clientop)$|^wavelet.topic$' '^[^.]+\.[^.]+\.(clientop|waveop)$|^wavelet.direct$'
sudo rabbitmqctl set_permissions pygowave_server '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.(topic|direct)$' '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.direct$' '^[^.]+\.[^.]+\.waveop$|^wavelet_rpc_singlethread$|^wavelet\.(topic|direct)$'

PGW

Change the settings as per your DB

sudoedit settings.py
python manage.py syncdb
chown www-data media/gadgets media/avatars pygowave_client/cache locale pygowave_client/locale

Make sure to chown the files as whatever apache is running as. Check in /etc/apache2/envvars

Start up Orbited, RabbitMQ and Apache.

./launch-pygowave-rpc

That's it !! PyGoWave Server at http://localhost/pygowave.

CategoryNeedsExpansion

PyGoWave-Server (last edited 2012-09-15 17:17:51 by Finisterre)