setting-up-a-pylowiki-site

JSON

rev 35  |  unknown  |  1290634829000  |  JSON

rev 34
rev 35
t No Differences Found t No Differences Found 
rev 34  |  unknown  |  1290634825000  |  JSON

rev 33
rev 34
t1Setting up a pylowiki sitet1 http://www.rxmarket.net/ accutane purchase =[[[ http://www.effectivemedcare.com
 >/ phentermine diet pills mezm 
2...................................
3 
4This page will outline the steps needed to setup a production pylowiki site.  
5 
6If you are interested in running a demo or local version of pylowiki, check out 
>the `minimal pylowiki setup instructions </pylowiki#installation-and-setup>`_. 
7 
8In this tutorial we will be configuring pylowiki to run:
9 
10* on ubuntu linux
11* as a wsgi application
12* with an apache2 webserver
13* in a python virtualenv
14* with a mysql database backend
15 
16 
17.. contents::
18 
19 
20 
21Get the Pylowiki sourcecode
22=================================
23 
24The pylowiki sourcecode is hosted at bitbucket.org.  You will need mecurial (hg)
> revision control to download the source. 
25 
26For debian or ubuntu
27 
28.. code-block:: shell
29 
30    sudo apt-get install mercurial
31 
32Once you have mercurial you need to clone the pylowiki sourcecode
33 
34.. code-block:: shell
35    
36    hg clone http://bitbucket.org/russellballestrini/pylowiki
37 
38    mv pylowiki mysite
39 
40Now you should have the sourcecode in local filesystem.  You might want to come 
>up with a workflow to maintain your changes and still accept revisions from the  
>upstream pylowiki repository.  I'll leave that up to you. 
41 
42 
43Fix file permissions
44=======================
45 
46The web server account only needs access to a few directories.  All the other fi
>les may be owned by your id. 
47 
48Run the following commands from the root of your Pylowiki project directory to c
>orrect permissions. 
49 
50 
51.. code-block:: apache
52 
53  mkdir egg-cache data
54 
55  sudo chgrp -R www-data pylowiki/public/attachment
56  sudo chmod -R 774 pylowiki/public/attachment
57 
58  sudo chgrp -R www-data egg-cache
59  sudo chmod -R 774 egg-cache
60 
61  sudo chgrp -R www-data data
62  sudo chmod -R 774 data
63 
64Get a Pylons virtual environment
65====================================
66 
67Official Pylons setup notes: http://pylonshq.com/docs/en/1.0/gettingstarted/
68 
69.. code-block:: apache 
70 
71 wget http://www.pylonshq.com/download/1.0/go-pylons.py
72 
73 python go-pylons.py virtpy
74 
75To enable the virtual environment run:
76 
77.. code-block:: apache 
78 
79 source virtpy/bin/activate
80 
81 
82Install your Pylowiki application
83========================================
84 
85Make sure your currently inside your virtual python environment.  Your shell sho
>uld look like this: 
86 
87.. code-block:: php
88 
89  (virtpy)user@host$ python setup.py develop
90 
91Notice the (virtpy)?  The above command will install Pylowiki and all its depend
>encies into your virtual pythons site-lib. 
92 
93Configure Pylowiki - prod.ini
94========================================
95 
96The following command should be run in the root of your pylowiki project.  This 
>will create a configuration ini named prod.ini: 
97 
98.. code-block:: php
99 
100  (virtpy)user@host$ paster make-config Pylowiki prod.ini
101 
102Open prod.ini for editing and make changes to reflect your environment.  Databas
>e settings, public wiki registration, all the tweak-able settings are declared i 
>n the ini. 
103 
104Prepare mySQL Database
105=============================
106 
107Login to mySQL as root.  
108 
109.. code-block:: mysql 
110 
111  mysql -u root -p
112 
113  mysql>
114 
115  CREATE DATABASE mysite
116 
117  GRANT ALL PRIVILEGES ON mysite.* TO username@localhost IDENTIFIED BY 'passw0rd
>' WITH GRANT OPTION 
118 
119Now make sure the prod.ini reflects these database settings:
120 
121.. code-block:: ini
122 
123  sqlalchemy.url = mysql://username:password@127.0.0.1/mysite?charset=utf8
124  sqlalchemy.pool_recycle = 3600
125 
126 
127Now we can let Pylowiki create all the database tables by issuing the following 
>command: 
128 
129.. code-block:: php
130 
131   (virtpy)user@host$ paster setup-app prod.ini
132 
133 
134  
135 
136Configure mod_wsgi dispatch file
137=====================================
138 
139First step is to create the mod_wsgi dispatch file.
140 
141From the root directory of the Pylowiki project, create a *dispatch.wsgi* file w
>ith the following content: 
142 
143.. code-block:: python
144 
145 # Add the virtual Python environment site-packages directory to the path
146 import sys
147 sys.stdout = sys.stderr
148 
149 import site
150 site.addsitedir('/absolute/path/to/virtpy/lib/python2.6/site-packages')
151 
152 # Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages
153 import os
154 os.environ['PYTHON_EGG_CACHE'] = '/absolute/path/to/pylowiki/egg-cache'
155 
156 # Load the Pylons application
157 from paste.deploy import loadapp
158 application = loadapp('config:/absolute/path/to/pylowiki/prod.ini')
159 
160 
161Configure apache2 virtualhost
162================================
163 
164Create a domain file under /etc/apache2/sites-enabled.
165 
166.. code-block:: apache
167 
168  sudo vi 002-mysite
169 
170 #mysite.net
171 
172 #pylons embeded mod_wsgi
173 <VirtualHost *:80>
174        ServerName www.mysite.net
175        ServerAlias mysite.net
176        ServerAdmin admin@mysite.com
177 
178        # ReWrite URL to WWW
179        RewriteEngine On
180        RewriteCond %{HTTP_HOST} ^mysite.net
181        RewriteRule (.*) http://www.mysite.net$1 [R=301,L]
182 
183        # Log Files
184        ErrorLog /var/log/apache2/error-mysite.log
185        CustomLog /var/log/apache2/access-mysite.log combined
186 
187        # Setup mod_wsgi
188        WSGIScriptAlias / /absolute/path/to/pylowiki/dispatch.wsgi
189 </VirtualHost>
190 
191Restart the apache2 service:
192 
193.. code-block:: apache
194 
195  sudo service apache2 restart
196 
rev 33  |  foxhop  |  1289340931000  |  JSON

rev 32
rev 33
t19pEjly  <a href="http://jgsdiqqpgbxf.com/">jgsdiqqpgbxf</a>, [url=http://tcrwttkt1Setting up a pylowiki site
>hhmdp.com/]tcrwttkhhmdp[/url], [link=http://hzowoqpptwpm.com/]hzowoqpptwpm[/link 
>], http://mpkxtpcyutyr.com/ 
2...................................
3 
4This page will outline the steps needed to setup a production pylowiki site.  
5 
6If you are interested in running a demo or local version of pylowiki, check out 
 >the `minimal pylowiki setup instructions </pylowiki#installation-and-setup>`_.
7 
8In this tutorial we will be configuring pylowiki to run:
9 
10* on ubuntu linux
11* as a wsgi application
12* with an apache2 webserver
13* in a python virtualenv
14* with a mysql database backend
15 
16 
17.. contents::
18 
19 
20 
21Get the Pylowiki sourcecode
22=================================
23 
24The pylowiki sourcecode is hosted at bitbucket.org.  You will need mecurial (hg)
 > revision control to download the source.
25 
26For debian or ubuntu
27 
28.. code-block:: shell
29 
30    sudo apt-get install mercurial
31 
32Once you have mercurial you need to clone the pylowiki sourcecode
33 
34.. code-block:: shell
35    
36    hg clone http://bitbucket.org/russellballestrini/pylowiki
37 
38    mv pylowiki mysite
39 
40Now you should have the sourcecode in local filesystem.  You might want to come 
 >up with a workflow to maintain your changes and still accept revisions from the 
 >upstream pylowiki repository.  I'll leave that up to you.
41 
42 
43Fix file permissions
44=======================
45 
46The web server account only needs access to a few directories.  All the other fi
 >les may be owned by your id.
47 
48Run the following commands from the root of your Pylowiki project directory to c
 >orrect permissions.
49 
50 
51.. code-block:: apache
52 
53  mkdir egg-cache data
54 
55  sudo chgrp -R www-data pylowiki/public/attachment
56  sudo chmod -R 774 pylowiki/public/attachment
57 
58  sudo chgrp -R www-data egg-cache
59  sudo chmod -R 774 egg-cache
60 
61  sudo chgrp -R www-data data
62  sudo chmod -R 774 data
63 
64Get a Pylons virtual environment
65====================================
66 
67Official Pylons setup notes: http://pylonshq.com/docs/en/1.0/gettingstarted/
68 
69.. code-block:: apache 
70 
71 wget http://www.pylonshq.com/download/1.0/go-pylons.py
72 
73 python go-pylons.py virtpy
74 
75To enable the virtual environment run:
76 
77.. code-block:: apache 
78 
79 source virtpy/bin/activate
80 
81 
82Install your Pylowiki application
83========================================
84 
85Make sure your currently inside your virtual python environment.  Your shell sho
 >uld look like this:
86 
87.. code-block:: php
88 
89  (virtpy)user@host$ python setup.py develop
90 
91Notice the (virtpy)?  The above command will install Pylowiki and all its depend
 >encies into your virtual pythons site-lib.
92 
93Configure Pylowiki - prod.ini
94========================================
95 
96The following command should be run in the root of your pylowiki project.  This 
 >will create a configuration ini named prod.ini:
97 
98.. code-block:: php
99 
100  (virtpy)user@host$ paster make-config Pylowiki prod.ini
101 
102Open prod.ini for editing and make changes to reflect your environment.  Databas
 >e settings, public wiki registration, all the tweak-able settings are declared i
 >n the ini.
103 
104Prepare mySQL Database
105=============================
106 
107Login to mySQL as root.  
108 
109.. code-block:: mysql 
110 
111  mysql -u root -p
112 
113  mysql>
114 
115  CREATE DATABASE mysite
116 
117  GRANT ALL PRIVILEGES ON mysite.* TO username@localhost IDENTIFIED BY 'passw0rd
 >' WITH GRANT OPTION
118 
119Now make sure the prod.ini reflects these database settings:
120 
121.. code-block:: ini
122 
123  sqlalchemy.url = mysql://username:password@127.0.0.1/mysite?charset=utf8
124  sqlalchemy.pool_recycle = 3600
125 
126 
127Now we can let Pylowiki create all the database tables by issuing the following 
 >command:
128 
129.. code-block:: php
130 
131   (virtpy)user@host$ paster setup-app prod.ini
132 
133 
134  
135 
136Configure mod_wsgi dispatch file
137=====================================
138 
139First step is to create the mod_wsgi dispatch file.
140 
141From the root directory of the Pylowiki project, create a *dispatch.wsgi* file w
 >ith the following content:
142 
143.. code-block:: python
144 
145 # Add the virtual Python environment site-packages directory to the path
146 import sys
147 sys.stdout = sys.stderr
148 
149 import site
150 site.addsitedir('/absolute/path/to/virtpy/lib/python2.6/site-packages')
151 
152 # Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages
153 import os
154 os.environ['PYTHON_EGG_CACHE'] = '/absolute/path/to/pylowiki/egg-cache'
155 
156 # Load the Pylons application
157 from paste.deploy import loadapp
158 application = loadapp('config:/absolute/path/to/pylowiki/prod.ini')
159 
160 
161Configure apache2 virtualhost
162================================
163 
164Create a domain file under /etc/apache2/sites-enabled.
165 
166.. code-block:: apache
167 
168  sudo vi 002-mysite
169 
170 #mysite.net
171 
172 #pylons embeded mod_wsgi
173 <VirtualHost *:80>
174        ServerName www.mysite.net
175        ServerAlias mysite.net
176        ServerAdmin admin@mysite.com
177 
178        # ReWrite URL to WWW
179        RewriteEngine On
180        RewriteCond %{HTTP_HOST} ^mysite.net
181        RewriteRule (.*) http://www.mysite.net$1 [R=301,L]
182 
183        # Log Files
184        ErrorLog /var/log/apache2/error-mysite.log
185        CustomLog /var/log/apache2/access-mysite.log combined
186 
187        # Setup mod_wsgi
188        WSGIScriptAlias / /absolute/path/to/pylowiki/dispatch.wsgi
189 </VirtualHost>
190 
191Restart the apache2 service:
192 
193.. code-block:: apache
194 
195  sudo service apache2 restart
196 
rev 32  |  unknown  |  1289319997000  |  JSON

rev 31
rev 32
t No Differences Found t No Differences Found 
rev 31  |  unknown  |  1289319994000  |  JSON

rev 30
rev 31
t1Enw5f9  <a href="http://kxjqfxwiswjm.com/">kxjqfxwiswjm</a>, [url=http://oupozstt19pEjly  <a href="http://jgsdiqqpgbxf.com/">jgsdiqqpgbxf</a>, [url=http://tcrwttk
>uabji.com/]oupozstuabji[/url], [link=http://cqsjpbryausk.com/]cqsjpbryausk[/link>hhmdp.com/]tcrwttkhhmdp[/url], [link=http://hzowoqpptwpm.com/]hzowoqpptwpm[/link
>], http://xvutgrtnilut.com/>], http://mpkxtpcyutyr.com/
rev 30  |  unknown  |  1289276815000  |  JSON

rev 29
rev 30
t No Differences Found t No Differences Found 
rev 29  |  unknown  |  1289276775000  |  JSON

rev 28
rev 29
t1Setting up a pylowiki sitet1Enw5f9  <a href="http://kxjqfxwiswjm.com/">kxjqfxwiswjm</a>, [url=http://oupozst
 >uabji.com/]oupozstuabji[/url], [link=http://cqsjpbryausk.com/]cqsjpbryausk[/link
 >], http://xvutgrtnilut.com/
2...................................
3 
4This page will outline the steps needed to setup a production pylowiki site.  
5 
6If you are interested in running a demo or local version of pylowiki, check out 
>the `minimal pylowiki setup instructions </pylowiki#installation-and-setup>`_. 
7 
8In this tutorial we will be configuring pylowiki to run:
9 
10* on ubuntu linux
11* as a wsgi application
12* with an apache2 webserver
13* in a python virtualenv
14* with a mysql database backend
15 
16 
17.. contents::
18 
19 
20 
21Get the Pylowiki sourcecode
22=================================
23 
24The pylowiki sourcecode is hosted at bitbucket.org.  You will need mecurial (hg)
> revision control to download the source. 
25 
26For debian or ubuntu
27 
28.. code-block:: shell
29 
30    sudo apt-get install mercurial
31 
32Once you have mercurial you need to clone the pylowiki sourcecode
33 
34.. code-block:: shell
35    
36    hg clone http://bitbucket.org/russellballestrini/pylowiki
37 
38    mv pylowiki mysite
39 
40Now you should have the sourcecode in local filesystem.  You might want to come 
>up with a workflow to maintain your changes and still accept revisions from the  
>upstream pylowiki repository.  I'll leave that up to you. 
41 
42 
43Fix file permissions
44=======================
45 
46The web server account only needs access to a few directories.  All the other fi
>les may be owned by your id. 
47 
48Run the following commands from the root of your Pylowiki project directory to c
>orrect permissions. 
49 
50 
51.. code-block:: apache
52 
53  mkdir egg-cache data
54 
55  sudo chgrp -R www-data pylowiki/public/attachment
56  sudo chmod -R 774 pylowiki/public/attachment
57 
58  sudo chgrp -R www-data egg-cache
59  sudo chmod -R 774 egg-cache
60 
61  sudo chgrp -R www-data data
62  sudo chmod -R 774 data
63 
64Get a Pylons virtual environment
65====================================
66 
67Official Pylons setup notes: http://pylonshq.com/docs/en/1.0/gettingstarted/
68 
69.. code-block:: apache 
70 
71 wget http://www.pylonshq.com/download/1.0/go-pylons.py
72 
73 python go-pylons.py virtpy
74 
75To enable the virtual environment run:
76 
77.. code-block:: apache 
78 
79 source virtpy/bin/activate
80 
81 
82Install your Pylowiki application
83========================================
84 
85Make sure your currently inside your virtual python environment.  Your shell sho
>uld look like this: 
86 
87.. code-block:: php
88 
89  (virtpy)user@host$ python setup.py develop
90 
91Notice the (virtpy)?  The above command will install Pylowiki and all its depend
>encies into your virtual pythons site-lib. 
92 
93Configure Pylowiki - prod.ini
94========================================
95 
96The following command should be run in the root of your pylowiki project.  This 
>will create a configuration ini named prod.ini: 
97 
98.. code-block:: php
99 
100  (virtpy)user@host$ paster make-config Pylowiki prod.ini
101 
102Open prod.ini for editing and make changes to reflect your environment.  Databas
>e settings, public wiki registration, all the tweak-able settings are declared i 
>n the ini. 
103 
104Prepare mySQL Database
105=============================
106 
107Login to mySQL as root.  
108 
109.. code-block:: mysql 
110 
111  mysql -u root -p
112 
113  mysql>
114 
115  CREATE DATABASE mysite
116 
117  GRANT ALL PRIVILEGES ON mysite.* TO username@localhost IDENTIFIED BY 'passw0rd
>' WITH GRANT OPTION 
118 
119Now make sure the prod.ini reflects these database settings:
120 
121.. code-block:: ini
122 
123  sqlalchemy.url = mysql://username:password@127.0.0.1/mysite?charset=utf8
124  sqlalchemy.pool_recycle = 3600
125 
126 
127Now we can let Pylowiki create all the database tables by issuing the following 
>command: 
128 
129.. code-block:: php
130 
131   (virtpy)user@host$ paster setup-app prod.ini
132 
133 
134  
135 
136Configure mod_wsgi dispatch file
137=====================================
138 
139First step is to create the mod_wsgi dispatch file.
140 
141From the root directory of the Pylowiki project, create a *dispatch.wsgi* file w
>ith the following content: 
142 
143.. code-block:: python
144 
145 # Add the virtual Python environment site-packages directory to the path
146 import sys
147 sys.stdout = sys.stderr
148 
149 import site
150 site.addsitedir('/absolute/path/to/virtpy/lib/python2.6/site-packages')
151 
152 # Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages
153 import os
154 os.environ['PYTHON_EGG_CACHE'] = '/absolute/path/to/pylowiki/egg-cache'
155 
156 # Load the Pylons application
157 from paste.deploy import loadapp
158 application = loadapp('config:/absolute/path/to/pylowiki/prod.ini')
159 
160 
161Configure apache2 virtualhost
162================================
163 
164Create a domain file under /etc/apache2/sites-enabled.
165 
166.. code-block:: apache
167 
168  sudo vi 002-mysite
169 
170 #mysite.net
171 
172 #pylons embeded mod_wsgi
173 <VirtualHost *:80>
174        ServerName www.mysite.net
175        ServerAlias mysite.net
176        ServerAdmin admin@mysite.com
177 
178        # ReWrite URL to WWW
179        RewriteEngine On
180        RewriteCond %{HTTP_HOST} ^mysite.net
181        RewriteRule (.*) http://www.mysite.net$1 [R=301,L]
182 
183        # Log Files
184        ErrorLog /var/log/apache2/error-mysite.log
185        CustomLog /var/log/apache2/access-mysite.log combined
186 
187        # Setup mod_wsgi
188        WSGIScriptAlias / /absolute/path/to/pylowiki/dispatch.wsgi
189 </VirtualHost>
190 
191Restart the apache2 service:
192 
193.. code-block:: apache
194 
195  sudo service apache2 restart
196 
rev 28  |  foxhop  |  1288036168000  |  JSON

rev 27
rev 28
100  (virtpy)user@host$ paster make-config Pylowiki prod.ini100  (virtpy)user@host$ paster make-config Pylowiki prod.ini
101101
n102Open prod.ini for editing and make changes to reflect your environment.  Databasn102Open prod.ini for editing and make changes to reflect your environment.  Databas
>e settings, public wiki registration, all the tweak-able settigns are declared i>e settings, public wiki registration, all the tweak-able settings are declared i
>n the ini.>n the ini.
103103
104Prepare mySQL Database104Prepare mySQL Database
125125
126126
t127Now we can let Pylowiki create all the database tables using the following commat127Now we can let Pylowiki create all the database tables by issuing the following 
>nd:>command:
128128
129.. code-block:: php129.. code-block:: php
rev 27  |  foxhop  |  1286638334000  |  JSON

rev 26
rev 27
102Open prod.ini for editing and make changes to reflect your environment.  Databas102Open prod.ini for editing and make changes to reflect your environment.  Databas
>e settings, public wiki registration, all the tweak-able settigns are declared i>e settings, public wiki registration, all the tweak-able settigns are declared i
>n the ini.>n the ini.
103103
n104Create mySQL Databasen104Prepare mySQL Database
105=============================105=============================
106106
187        # Setup mod_wsgi187        # Setup mod_wsgi
188        WSGIScriptAlias / /absolute/path/to/pylowiki/dispatch.wsgi188        WSGIScriptAlias / /absolute/path/to/pylowiki/dispatch.wsgi
t189 t
190        <Directory /absolute/path/to/pylowiki>
191        Order deny,allow
192        Allow from all
193        </Directory>
194 </VirtualHost>189 </VirtualHost>
195190
rev 26  |  foxhop  |  1286638229000  |  JSON

rev 25
rev 26
125125
126126
t127Now we can let pylowiki create all the database tables using the following commat127Now we can let Pylowiki create all the database tables using the following comma
>nd:>nd:
128128
129.. code-block:: php129.. code-block:: php
rev 25  |  foxhop  |  1286638195000  |  JSON

rev 24
rev 25
96The following command should be run in the root of your pylowiki project.  This 96The following command should be run in the root of your pylowiki project.  This 
>will create a configuration ini named prod.ini:>will create a configuration ini named prod.ini:
9797
n98.. code-block:: apachen98.. code-block:: php
9999
n100  paster make-config Pylowiki prod.inin100  (virtpy)user@host$ paster make-config Pylowiki prod.ini
101101
102Open prod.ini for editing and make changes to reflect your environment.  Databas102Open prod.ini for editing and make changes to reflect your environment.  Databas
>e settings, public wiki registration, all the tweak-able settigns are declared i>e settings, public wiki registration, all the tweak-able settigns are declared i
>n the ini.>n the ini.
125125
126126
t127  t127Now we can let pylowiki create all the database tables using the following comma
 >nd:
128 
129.. code-block:: php
130 
131   (virtpy)user@host$ paster setup-app prod.ini
128132
129133
rev 24  |  foxhop  |  1286637267000  |  JSON

rev 23
rev 24
115  CREATE DATABASE mysite115  CREATE DATABASE mysite
116116
t117  GRANT ALL PRIVILEGES ON mysite.* TO username@localhost IDENTIFIED BY 'p@ssw0rdt117  GRANT ALL PRIVILEGES ON mysite.* TO username@localhost IDENTIFIED BY 'passw0rd
>' WITH GRANT OPTION>' WITH GRANT OPTION
118118
119Now make sure the prod.ini reflects these database settings:119Now make sure the prod.ini reflects these database settings:
rev 23  |  foxhop  |  1286637226000  |  JSON

rev 22
rev 23
4949
5050
t51.. code-block:: ct51.. code-block:: apache
5252
53  mkdir egg-cache data53  mkdir egg-cache data
rev 22  |  foxhop  |  1286637208000  |  JSON

rev 21
rev 22
100  paster make-config Pylowiki prod.ini100  paster make-config Pylowiki prod.ini
101101
t102Open prod.ini for editing and make changes to reflect your environment.  Lots oft102Open prod.ini for editing and make changes to reflect your environment.  Databas
> choices. : )>e settings, public wiki registration, all the tweak-able settigns are declared i
 >n the ini.
103 
104Create mySQL Database
105=============================
106 
107Login to mySQL as root.  
108 
109.. code-block:: mysql 
110 
111  mysql -u root -p
112 
113  mysql>
114 
115  CREATE DATABASE mysite
116 
117  GRANT ALL PRIVILEGES ON mysite.* TO username@localhost IDENTIFIED BY 'p@ssw0rd
 >' WITH GRANT OPTION
118 
119Now make sure the prod.ini reflects these database settings:
120 
121.. code-block:: ini
122 
123  sqlalchemy.url = mysql://username:password@127.0.0.1/mysite?charset=utf8
124  sqlalchemy.pool_recycle = 3600
125 
126 
127  
128 
129 
103  130  
104131
rev 21  |  foxhop  |  1286633964000  |  JSON

rev 20
rev 21
163 </VirtualHost>163 </VirtualHost>
164164
tt165Restart the apache2 service:
166 
167.. code-block:: apache
168 
169  sudo service apache2 restart
170 
rev 20  |  foxhop  |  1286633916000  |  JSON

rev 19
rev 20
103  103  
104104
n105Configure apache2 and mod_wsgin105Configure mod_wsgi dispatch file
106=====================================106=====================================
107107
128128
129129
tt130Configure apache2 virtualhost
131================================
132 
133Create a domain file under /etc/apache2/sites-enabled.
134 
135.. code-block:: apache
136 
137  sudo vi 002-mysite
138 
139 #mysite.net
140 
141 #pylons embeded mod_wsgi
142 <VirtualHost *:80>
143        ServerName www.mysite.net
144        ServerAlias mysite.net
145        ServerAdmin admin@mysite.com
146 
147        # ReWrite URL to WWW
148        RewriteEngine On
149        RewriteCond %{HTTP_HOST} ^mysite.net
150        RewriteRule (.*) http://www.mysite.net$1 [R=301,L]
151 
152        # Log Files
153        ErrorLog /var/log/apache2/error-mysite.log
154        CustomLog /var/log/apache2/access-mysite.log combined
155 
156        # Setup mod_wsgi
157        WSGIScriptAlias / /absolute/path/to/pylowiki/dispatch.wsgi
158 
159        <Directory /absolute/path/to/pylowiki>
160        Order deny,allow
161        Allow from all
162        </Directory>
163 </VirtualHost>
164 
rev 19  |  foxhop  |  1286633158000  |  JSON

rev 18
rev 19
91Notice the (virtpy)?  The above command will install Pylowiki and all its depend91Notice the (virtpy)?  The above command will install Pylowiki and all its depend
>encies into your virtual pythons site-lib.>encies into your virtual pythons site-lib.
9292
n93Create a Pylowiki configuration .inin93Configure Pylowiki - prod.ini
94========================================94========================================
9595
103  103  
104104
tt105Configure apache2 and mod_wsgi
106=====================================
107 
108First step is to create the mod_wsgi dispatch file.
109 
110From the root directory of the Pylowiki project, create a *dispatch.wsgi* file w
 >ith the following content:
111 
112.. code-block:: python
113 
114 # Add the virtual Python environment site-packages directory to the path
115 import sys
116 sys.stdout = sys.stderr
117 
118 import site
119 site.addsitedir('/absolute/path/to/virtpy/lib/python2.6/site-packages')
120 
121 # Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages
122 import os
123 os.environ['PYTHON_EGG_CACHE'] = '/absolute/path/to/pylowiki/egg-cache'
124 
125 # Load the Pylons application
126 from paste.deploy import loadapp
127 application = loadapp('config:/absolute/path/to/pylowiki/prod.ini')
128 
129 
rev 18  |  foxhop  |  1286632545000  |  JSON

rev 17
rev 18
9999
100  paster make-config Pylowiki prod.ini100  paster make-config Pylowiki prod.ini
tt101 
102Open prod.ini for editing and make changes to reflect your environment.  Lots of
 > choices. : )
101  103  
102104
rev 17  |  foxhop  |  1286631959000  |  JSON

rev 16
rev 17
80 80 
8181
tt82Install your Pylowiki application
83========================================
84 
85Make sure your currently inside your virtual python environment.  Your shell sho
 >uld look like this:
86 
87.. code-block:: php
88 
89  (virtpy)user@host$ python setup.py develop
90 
91Notice the (virtpy)?  The above command will install Pylowiki and all its depend
 >encies into your virtual pythons site-lib.
92 
82Create a Pylowiki configuration .ini93Create a Pylowiki configuration .ini
83========================================94========================================
rev 16  |  foxhop  |  1286631328000  |  JSON

rev 15
rev 16
1919
2020
n21Get the sourcecoden21Get the Pylowiki sourcecode
22=========================22=================================
2323
24The pylowiki sourcecode is hosted at bitbucket.org.  You will need mecurial (hg)24The pylowiki sourcecode is hosted at bitbucket.org.  You will need mecurial (hg)
> revision control to download the source.> revision control to download the source.
4141
4242
t43File permissionst43Fix file permissions
44====================44=======================
4545
46The web server account only needs access to a few directories.  All the other fi46The web server account only needs access to a few directories.  All the other fi
>les may be owned by your id.>les may be owned by your id.
rev 15  |  foxhop  |  1286631250000  |  JSON

rev 14
rev 15
51.. code-block:: c51.. code-block:: c
5252
tt53  mkdir egg-cache data
54 
53  sudo chgrp -R www-data pylowiki/public/attachment55  sudo chgrp -R www-data pylowiki/public/attachment
54  sudo chmod -R 774 pylowiki/public/attachment56  sudo chmod -R 774 pylowiki/public/attachment
rev 14  |  foxhop  |  1286631068000  |  JSON

rev 13
rev 14
44====================44====================
4545
n46Do the following commands from the root pylowiki project directory, user should n46The web server account only needs access to a few directories.  All the other fi
>be replaced with your unix id.>les may be owned by your id.
47 
48Run the following commands from the root of your Pylowiki project directory to c
 >orrect permissions.
49 
4750
48.. code-block:: c51.. code-block:: c
4952
n50  sudo chown -R user:www-data pylowiki/public/attachmentn53  sudo chgrp -R www-data pylowiki/public/attachment
51  sudo chmod -R 774 pylowiki/public/attachment54  sudo chmod -R 774 pylowiki/public/attachment
5255
n53  sudo chown -R user:www-data egg-cachen56  sudo chgrp -R www-data egg-cache
54  sudo chmod -R 774 egg-cache57  sudo chmod -R 774 egg-cache
5558
t56  sudo chown -R user:www-data datat59  sudo chgrp -R www-data data
57  sudo chmod -R 774 data60  sudo chmod -R 774 data
5861
rev 13  |  foxhop  |  1286630503000  |  JSON

rev 12
rev 13
f1Setting up a pylowiki sitef1Setting up a pylowiki site
t2========================================t2...................................
33
4This page will outline the steps needed to setup a production pylowiki site.  4This page will outline the steps needed to setup a production pylowiki site.  
rev 12  |  foxhop  |  1286630441000  |  JSON

rev 11
rev 12
13* in a python virtualenv13* in a python virtualenv
14* with a mysql database backend14* with a mysql database backend
nn15 
16 
17.. contents::
18 
1519
1620
71 75 
7276
tt77Create a Pylowiki configuration .ini
78========================================
79 
80The following command should be run in the root of your pylowiki project.  This 
 >will create a configuration ini named prod.ini:
81 
82.. code-block:: apache
83 
84  paster make-config Pylowiki prod.ini
85  
86 
rev 11  |  foxhop  |  1286630003000  |  JSON

rev 10
rev 11
42Do the following commands from the root pylowiki project directory, user should 42Do the following commands from the root pylowiki project directory, user should 
>be replaced with your unix id.>be replaced with your unix id.
4343
t44.. code-block:: apachet44.. code-block:: c
4545
46  sudo chown -R user:www-data pylowiki/public/attachment46  sudo chown -R user:www-data pylowiki/public/attachment
rev 10  |  foxhop  |  1286629828000  |  JSON

rev 9
rev 10
53  sudo chmod -R 774 data53  sudo chmod -R 774 data
5454
nn55Get a Pylons virtual environment
56====================================
5557
tt58Official Pylons setup notes: http://pylonshq.com/docs/en/1.0/gettingstarted/
59 
60.. code-block:: apache 
61 
62 wget http://www.pylonshq.com/download/1.0/go-pylons.py
63 
64 python go-pylons.py virtpy
65 
66To enable the virtual environment run:
67 
68.. code-block:: apache 
69 
70 source virtpy/bin/activate
71 
72 
rev 9  |  foxhop  |  1286617386000  |  JSON

rev 8
rev 9
8In this tutorial we will be configuring pylowiki to run:8In this tutorial we will be configuring pylowiki to run:
99
tt10* on ubuntu linux
10* as a wsgi application11* as a wsgi application
11* with an apache2 webserver12* with an apache2 webserver
rev 8  |  foxhop  |  1286617327000  |  JSON

rev 7
rev 8
39====================39====================
4040
t41Do the following commands from the root pylowiki project directoryt41Do the following commands from the root pylowiki project directory, user should 
 >be replaced with your unix id.
4242
43.. code-block:: apache43.. code-block:: apache
rev 7  |  foxhop  |  1286565734000  |  JSON

rev 6
rev 7
43.. code-block:: apache43.. code-block:: apache
4444
n45  sudo chown -R www-data:www-data pylowiki/public/attachmentn45  sudo chown -R user:www-data pylowiki/public/attachment
46  sudo chmod -R 744 pylowiki/public/attachment46  sudo chmod -R 774 pylowiki/public/attachment
4747
n48  sudo chown -R www-data:www-data egg-cachen48  sudo chown -R user:www-data egg-cache
49  sudo chmod -R 744 egg-cache49  sudo chmod -R 774 egg-cache
5050
t51  sudo chown -R www-data:www-data datat51  sudo chown -R user:www-data data
52  sudo chmod -R 744 data52  sudo chmod -R 774 data
5353
5454
rev 6  |  foxhop  |  1285883619000  |  JSON

rev 5
rev 6
35Now you should have the sourcecode in local filesystem.  You might want to come 35Now you should have the sourcecode in local filesystem.  You might want to come 
>up with a workflow to maintain your changes and still accept revisions from the >up with a workflow to maintain your changes and still accept revisions from the 
>upstream pylowiki repository.  I'll leave that up to you.>upstream pylowiki repository.  I'll leave that up to you.
3636
tt37 
38File permissions
39====================
40 
41Do the following commands from the root pylowiki project directory
42 
43.. code-block:: apache
44 
45  sudo chown -R www-data:www-data pylowiki/public/attachment
46  sudo chmod -R 744 pylowiki/public/attachment
47 
48  sudo chown -R www-data:www-data egg-cache
49  sudo chmod -R 744 egg-cache
50 
51  sudo chown -R www-data:www-data data
52  sudo chmod -R 744 data
53 
54 
rev 5  |  foxhop  |  1284929337000  |  JSON

rev 4
rev 5
2========================================2========================================
33
t4This page will outline the steps needed to setup a production pylowiki site.  Ift4This page will outline the steps needed to setup a production pylowiki site.  
> you are interested in running a demo or local PC version of pylowiki, check out 
> `minimal pylowiki install instructions </pylowiki#install>`_ 
5 
6If you are interested in running a demo or local version of pylowiki, check out 
 >the `minimal pylowiki setup instructions </pylowiki#installation-and-setup>`_.
57
6In this tutorial we will be configuring pylowiki to run:8In this tutorial we will be configuring pylowiki to run:
rev 4  |  foxhop  |  1284929161000  |  JSON

rev 3
rev 4
2========================================2========================================
33
t4This page will outline the steps needed to setup a pylowiki site.t4This page will outline the steps needed to setup a production pylowiki site.  If
 > you are interested in running a demo or local PC version of pylowiki, check out
 > `minimal pylowiki install instructions </pylowiki#install>`_
55
6In this tutorial we will be configuring pylowiki to run:6In this tutorial we will be configuring pylowiki to run:
rev 3  |  foxhop  |  1284927520000  |  JSON

rev 2
rev 3
15=========================15=========================
1616
t17The pylowiki sourcecode hosted at bitbucket.org.  You will need mecurial (hg) ret17The pylowiki sourcecode is hosted at bitbucket.org.  You will need mecurial (hg)
>vision control to download the source.> revision control to download the source.
1818
19For debian or ubuntu19For debian or ubuntu
rev 2  |  foxhop  |  1284927461000  |  JSON

rev 1
rev 2
33
4This page will outline the steps needed to setup a pylowiki site.4This page will outline the steps needed to setup a pylowiki site.
nn5 
6In this tutorial we will be configuring pylowiki to run:
7 
8* as a wsgi application
9* with an apache2 webserver
10* in a python virtualenv
11* with a mysql database backend
12 
513
6Get the sourcecode14Get the sourcecode
2230
23    mv pylowiki mysite31    mv pylowiki mysite
tt32 
33Now you should have the sourcecode in local filesystem.  You might want to come 
 >up with a workflow to maintain your changes and still accept revisions from the 
 >upstream pylowiki repository.  I'll leave that up to you.
34 
rev 1  |  foxhop  |  1284926956000  |  JSON

empty
rev 1
tt1Setting up a pylowiki site
2========================================
3 
4This page will outline the steps needed to setup a pylowiki site.
5 
6Get the sourcecode
7=========================
8 
9The pylowiki sourcecode hosted at bitbucket.org.  You will need mecurial (hg) re
 >vision control to download the source.
10 
11For debian or ubuntu
12 
13.. code-block:: shell
14 
15    sudo apt-get install mercurial
16 
17Once you have mercurial you need to clone the pylowiki sourcecode
18 
19.. code-block:: shell
20    
21    hg clone http://bitbucket.org/russellballestrini/pylowiki
22 
23    mv pylowiki mysite