setting-up-a-pylowiki-site
| rev 33 | rev 34 | ||||
|---|---|---|---|---|---|
| t | 1 | Setting up a pylowiki site | t | 1 | http://www.rxmarket.net/ accutane purchase =[[[ http://www.effectivemedcare.com |
| > | / phentermine diet pills mezm | ||||
| 2 | ................................... | ||||
| 3 | |||||
| 4 | This page will outline the steps needed to setup a production pylowiki site. | ||||
| 5 | |||||
| 6 | If you are interested in running a demo or local version of pylowiki, check out | ||||
| > | the `minimal pylowiki setup instructions </pylowiki#installation-and-setup>`_. | ||||
| 7 | |||||
| 8 | In 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 | |||||
| 21 | Get the Pylowiki sourcecode | ||||
| 22 | ================================= | ||||
| 23 | |||||
| 24 | The pylowiki sourcecode is hosted at bitbucket.org. You will need mecurial (hg) | ||||
| > | revision control to download the source. | ||||
| 25 | |||||
| 26 | For debian or ubuntu | ||||
| 27 | |||||
| 28 | .. code-block:: shell | ||||
| 29 | |||||
| 30 | sudo apt-get install mercurial | ||||
| 31 | |||||
| 32 | Once 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 | |||||
| 40 | Now 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 | |||||
| 43 | Fix file permissions | ||||
| 44 | ======================= | ||||
| 45 | |||||
| 46 | The web server account only needs access to a few directories. All the other fi | ||||
| > | les may be owned by your id. | ||||
| 47 | |||||
| 48 | Run 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 | |||||
| 64 | Get a Pylons virtual environment | ||||
| 65 | ==================================== | ||||
| 66 | |||||
| 67 | Official 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 | |||||
| 75 | To enable the virtual environment run: | ||||
| 76 | |||||
| 77 | .. code-block:: apache | ||||
| 78 | |||||
| 79 | source virtpy/bin/activate | ||||
| 80 | |||||
| 81 | |||||
| 82 | Install your Pylowiki application | ||||
| 83 | ======================================== | ||||
| 84 | |||||
| 85 | Make 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 | |||||
| 91 | Notice the (virtpy)? The above command will install Pylowiki and all its depend | ||||
| > | encies into your virtual pythons site-lib. | ||||
| 92 | |||||
| 93 | Configure Pylowiki - prod.ini | ||||
| 94 | ======================================== | ||||
| 95 | |||||
| 96 | The 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 | |||||
| 102 | Open 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 | |||||
| 104 | Prepare mySQL Database | ||||
| 105 | ============================= | ||||
| 106 | |||||
| 107 | Login 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 | |||||
| 119 | Now 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 | Now 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 | |||||
| 136 | Configure mod_wsgi dispatch file | ||||
| 137 | ===================================== | ||||
| 138 | |||||
| 139 | First step is to create the mod_wsgi dispatch file. | ||||
| 140 | |||||
| 141 | From 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 | |||||
| 161 | Configure apache2 virtualhost | ||||
| 162 | ================================ | ||||
| 163 | |||||
| 164 | Create 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 | |||||
| 191 | Restart the apache2 service: | ||||
| 192 | |||||
| 193 | .. code-block:: apache | ||||
| 194 | |||||
| 195 | sudo service apache2 restart | ||||
| 196 | |||||
| rev 32 | rev 33 | ||||
|---|---|---|---|---|---|
| t | 1 | 9pEjly <a href="http://jgsdiqqpgbxf.com/">jgsdiqqpgbxf</a>, [url=http://tcrwttk | t | 1 | Setting up a pylowiki site |
| > | hhmdp.com/]tcrwttkhhmdp[/url], [link=http://hzowoqpptwpm.com/]hzowoqpptwpm[/link | ||||
| > | ], http://mpkxtpcyutyr.com/ | ||||
| 2 | ................................... | ||||
| 3 | |||||
| 4 | This page will outline the steps needed to setup a production pylowiki site. | ||||
| 5 | |||||
| 6 | If you are interested in running a demo or local version of pylowiki, check out | ||||
| > | the `minimal pylowiki setup instructions </pylowiki#installation-and-setup>`_. | ||||
| 7 | |||||
| 8 | In 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 | |||||
| 21 | Get the Pylowiki sourcecode | ||||
| 22 | ================================= | ||||
| 23 | |||||
| 24 | The pylowiki sourcecode is hosted at bitbucket.org. You will need mecurial (hg) | ||||
| > | revision control to download the source. | ||||
| 25 | |||||
| 26 | For debian or ubuntu | ||||
| 27 | |||||
| 28 | .. code-block:: shell | ||||
| 29 | |||||
| 30 | sudo apt-get install mercurial | ||||
| 31 | |||||
| 32 | Once 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 | |||||
| 40 | Now 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 | |||||
| 43 | Fix file permissions | ||||
| 44 | ======================= | ||||
| 45 | |||||
| 46 | The web server account only needs access to a few directories. All the other fi | ||||
| > | les may be owned by your id. | ||||
| 47 | |||||
| 48 | Run 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 | |||||
| 64 | Get a Pylons virtual environment | ||||
| 65 | ==================================== | ||||
| 66 | |||||
| 67 | Official 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 | |||||
| 75 | To enable the virtual environment run: | ||||
| 76 | |||||
| 77 | .. code-block:: apache | ||||
| 78 | |||||
| 79 | source virtpy/bin/activate | ||||
| 80 | |||||
| 81 | |||||
| 82 | Install your Pylowiki application | ||||
| 83 | ======================================== | ||||
| 84 | |||||
| 85 | Make 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 | |||||
| 91 | Notice the (virtpy)? The above command will install Pylowiki and all its depend | ||||
| > | encies into your virtual pythons site-lib. | ||||
| 92 | |||||
| 93 | Configure Pylowiki - prod.ini | ||||
| 94 | ======================================== | ||||
| 95 | |||||
| 96 | The 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 | |||||
| 102 | Open 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 | |||||
| 104 | Prepare mySQL Database | ||||
| 105 | ============================= | ||||
| 106 | |||||
| 107 | Login 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 | |||||
| 119 | Now 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 | Now 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 | |||||
| 136 | Configure mod_wsgi dispatch file | ||||
| 137 | ===================================== | ||||
| 138 | |||||
| 139 | First step is to create the mod_wsgi dispatch file. | ||||
| 140 | |||||
| 141 | From 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 | |||||
| 161 | Configure apache2 virtualhost | ||||
| 162 | ================================ | ||||
| 163 | |||||
| 164 | Create 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 | |||||
| 191 | Restart the apache2 service: | ||||
| 192 | |||||
| 193 | .. code-block:: apache | ||||
| 194 | |||||
| 195 | sudo service apache2 restart | ||||
| 196 | |||||
| rev 30 | rev 31 | ||||
|---|---|---|---|---|---|
| t | 1 | Enw5f9 <a href="http://kxjqfxwiswjm.com/">kxjqfxwiswjm</a>, [url=http://oupozst | t | 1 | 9pEjly <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 28 | rev 29 | ||||
|---|---|---|---|---|---|
| t | 1 | Setting up a pylowiki site | t | 1 | Enw5f9 <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 | |||||
| 4 | This page will outline the steps needed to setup a production pylowiki site. | ||||
| 5 | |||||
| 6 | If you are interested in running a demo or local version of pylowiki, check out | ||||
| > | the `minimal pylowiki setup instructions </pylowiki#installation-and-setup>`_. | ||||
| 7 | |||||
| 8 | In 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 | |||||
| 21 | Get the Pylowiki sourcecode | ||||
| 22 | ================================= | ||||
| 23 | |||||
| 24 | The pylowiki sourcecode is hosted at bitbucket.org. You will need mecurial (hg) | ||||
| > | revision control to download the source. | ||||
| 25 | |||||
| 26 | For debian or ubuntu | ||||
| 27 | |||||
| 28 | .. code-block:: shell | ||||
| 29 | |||||
| 30 | sudo apt-get install mercurial | ||||
| 31 | |||||
| 32 | Once 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 | |||||
| 40 | Now 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 | |||||
| 43 | Fix file permissions | ||||
| 44 | ======================= | ||||
| 45 | |||||
| 46 | The web server account only needs access to a few directories. All the other fi | ||||
| > | les may be owned by your id. | ||||
| 47 | |||||
| 48 | Run 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 | |||||
| 64 | Get a Pylons virtual environment | ||||
| 65 | ==================================== | ||||
| 66 | |||||
| 67 | Official 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 | |||||
| 75 | To enable the virtual environment run: | ||||
| 76 | |||||
| 77 | .. code-block:: apache | ||||
| 78 | |||||
| 79 | source virtpy/bin/activate | ||||
| 80 | |||||
| 81 | |||||
| 82 | Install your Pylowiki application | ||||
| 83 | ======================================== | ||||
| 84 | |||||
| 85 | Make 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 | |||||
| 91 | Notice the (virtpy)? The above command will install Pylowiki and all its depend | ||||
| > | encies into your virtual pythons site-lib. | ||||
| 92 | |||||
| 93 | Configure Pylowiki - prod.ini | ||||
| 94 | ======================================== | ||||
| 95 | |||||
| 96 | The 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 | |||||
| 102 | Open 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 | |||||
| 104 | Prepare mySQL Database | ||||
| 105 | ============================= | ||||
| 106 | |||||
| 107 | Login 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 | |||||
| 119 | Now 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 | Now 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 | |||||
| 136 | Configure mod_wsgi dispatch file | ||||
| 137 | ===================================== | ||||
| 138 | |||||
| 139 | First step is to create the mod_wsgi dispatch file. | ||||
| 140 | |||||
| 141 | From 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 | |||||
| 161 | Configure apache2 virtualhost | ||||
| 162 | ================================ | ||||
| 163 | |||||
| 164 | Create 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 | |||||
| 191 | Restart the apache2 service: | ||||
| 192 | |||||
| 193 | .. code-block:: apache | ||||
| 194 | |||||
| 195 | sudo service apache2 restart | ||||
| 196 | |||||
| rev 27 | rev 28 | ||||
|---|---|---|---|---|---|
| 100 | (virtpy)user@host$ paster make-config Pylowiki prod.ini | 100 | (virtpy)user@host$ paster make-config Pylowiki prod.ini | ||
| 101 | 101 | ||||
| n | 102 | Open prod.ini for editing and make changes to reflect your environment. Databas | n | 102 | Open 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. | ||
| 103 | 103 | ||||
| 104 | Prepare mySQL Database | 104 | Prepare mySQL Database | ||
| 125 | 125 | ||||
| 126 | 126 | ||||
| t | 127 | Now we can let Pylowiki create all the database tables using the following comma | t | 127 | Now we can let Pylowiki create all the database tables by issuing the following |
| > | nd: | > | command: | ||
| 128 | 128 | ||||
| 129 | .. code-block:: php | 129 | .. code-block:: php | ||
| rev 26 | rev 27 | ||||
|---|---|---|---|---|---|
| 102 | Open prod.ini for editing and make changes to reflect your environment. Databas | 102 | Open 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. | ||
| 103 | 103 | ||||
| n | 104 | Create mySQL Database | n | 104 | Prepare mySQL Database |
| 105 | ============================= | 105 | ============================= | ||
| 106 | 106 | ||||
| 187 | # Setup mod_wsgi | 187 | # Setup mod_wsgi | ||
| 188 | WSGIScriptAlias / /absolute/path/to/pylowiki/dispatch.wsgi | 188 | WSGIScriptAlias / /absolute/path/to/pylowiki/dispatch.wsgi | ||
| t | 189 | t | |||
| 190 | <Directory /absolute/path/to/pylowiki> | ||||
| 191 | Order deny,allow | ||||
| 192 | Allow from all | ||||
| 193 | </Directory> | ||||
| 194 | </VirtualHost> | 189 | </VirtualHost> | ||
| 195 | 190 | ||||
| rev 25 | rev 26 | ||||
|---|---|---|---|---|---|
| 125 | 125 | ||||
| 126 | 126 | ||||
| t | 127 | Now we can let pylowiki create all the database tables using the following comma | t | 127 | Now we can let Pylowiki create all the database tables using the following comma |
| > | nd: | > | nd: | ||
| 128 | 128 | ||||
| 129 | .. code-block:: php | 129 | .. code-block:: php | ||
| rev 24 | rev 25 | ||||
|---|---|---|---|---|---|
| 96 | The following command should be run in the root of your pylowiki project. This | 96 | The 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: | ||
| 97 | 97 | ||||
| n | 98 | .. code-block:: apache | n | 98 | .. code-block:: php |
| 99 | 99 | ||||
| n | 100 | paster make-config Pylowiki prod.ini | n | 100 | (virtpy)user@host$ paster make-config Pylowiki prod.ini |
| 101 | 101 | ||||
| 102 | Open prod.ini for editing and make changes to reflect your environment. Databas | 102 | Open 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. | ||
| 125 | 125 | ||||
| 126 | 126 | ||||
| t | 127 | t | 127 | Now 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 | ||||
| 128 | 132 | ||||
| 129 | 133 | ||||
| rev 23 | rev 24 | ||||
|---|---|---|---|---|---|
| 115 | CREATE DATABASE mysite | 115 | CREATE DATABASE mysite | ||
| 116 | 116 | ||||
| t | 117 | GRANT ALL PRIVILEGES ON mysite.* TO username@localhost IDENTIFIED BY 'p@ssw0rd | t | 117 | GRANT ALL PRIVILEGES ON mysite.* TO username@localhost IDENTIFIED BY 'passw0rd |
| > | ' WITH GRANT OPTION | > | ' WITH GRANT OPTION | ||
| 118 | 118 | ||||
| 119 | Now make sure the prod.ini reflects these database settings: | 119 | Now make sure the prod.ini reflects these database settings: | ||
| rev 22 | rev 23 | ||||
|---|---|---|---|---|---|
| 49 | 49 | ||||
| 50 | 50 | ||||
| t | 51 | .. code-block:: c | t | 51 | .. code-block:: apache |
| 52 | 52 | ||||
| 53 | mkdir egg-cache data | 53 | mkdir egg-cache data | ||
| rev 21 | rev 22 | ||||
|---|---|---|---|---|---|
| 100 | paster make-config Pylowiki prod.ini | 100 | paster make-config Pylowiki prod.ini | ||
| 101 | 101 | ||||
| t | 102 | Open prod.ini for editing and make changes to reflect your environment. Lots of | t | 102 | Open 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 | |||||
| 104 | Create mySQL Database | ||||
| 105 | ============================= | ||||
| 106 | |||||
| 107 | Login 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 | |||||
| 119 | Now 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 | ||||
| 104 | 131 | ||||
| rev 20 | rev 21 | ||||
|---|---|---|---|---|---|
| 163 | </VirtualHost> | 163 | </VirtualHost> | ||
| 164 | 164 | ||||
| t | t | 165 | Restart the apache2 service: | ||
| 166 | |||||
| 167 | .. code-block:: apache | ||||
| 168 | |||||
| 169 | sudo service apache2 restart | ||||
| 170 | |||||
| rev 19 | rev 20 | ||||
|---|---|---|---|---|---|
| 103 | 103 | ||||
| 104 | 104 | ||||
| n | 105 | Configure apache2 and mod_wsgi | n | 105 | Configure mod_wsgi dispatch file |
| 106 | ===================================== | 106 | ===================================== | ||
| 107 | 107 | ||||
| 128 | 128 | ||||
| 129 | 129 | ||||
| t | t | 130 | Configure apache2 virtualhost | ||
| 131 | ================================ | ||||
| 132 | |||||
| 133 | Create 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 18 | rev 19 | ||||
|---|---|---|---|---|---|
| 91 | Notice the (virtpy)? The above command will install Pylowiki and all its depend | 91 | Notice 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. | ||
| 92 | 92 | ||||
| n | 93 | Create a Pylowiki configuration .ini | n | 93 | Configure Pylowiki - prod.ini |
| 94 | ======================================== | 94 | ======================================== | ||
| 95 | 95 | ||||
| 103 | 103 | ||||
| 104 | 104 | ||||
| t | t | 105 | Configure apache2 and mod_wsgi | ||
| 106 | ===================================== | ||||
| 107 | |||||
| 108 | First step is to create the mod_wsgi dispatch file. | ||||
| 109 | |||||
| 110 | From 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 17 | rev 18 | ||||
|---|---|---|---|---|---|
| 99 | 99 | ||||
| 100 | paster make-config Pylowiki prod.ini | 100 | paster make-config Pylowiki prod.ini | ||
| t | t | 101 | |||
| 102 | Open prod.ini for editing and make changes to reflect your environment. Lots of | ||||
| > | choices. : ) | ||||
| 101 | 103 | ||||
| 102 | 104 | ||||
| rev 16 | rev 17 | ||||
|---|---|---|---|---|---|
| 80 | 80 | ||||
| 81 | 81 | ||||
| t | t | 82 | Install your Pylowiki application | ||
| 83 | ======================================== | ||||
| 84 | |||||
| 85 | Make 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 | |||||
| 91 | Notice the (virtpy)? The above command will install Pylowiki and all its depend | ||||
| > | encies into your virtual pythons site-lib. | ||||
| 92 | |||||
| 82 | Create a Pylowiki configuration .ini | 93 | Create a Pylowiki configuration .ini | ||
| 83 | ======================================== | 94 | ======================================== | ||
| rev 15 | rev 16 | ||||
|---|---|---|---|---|---|
| 19 | 19 | ||||
| 20 | 20 | ||||
| n | 21 | Get the sourcecode | n | 21 | Get the Pylowiki sourcecode |
| 22 | ========================= | 22 | ================================= | ||
| 23 | 23 | ||||
| 24 | The pylowiki sourcecode is hosted at bitbucket.org. You will need mecurial (hg) | 24 | The pylowiki sourcecode is hosted at bitbucket.org. You will need mecurial (hg) | ||
| > | revision control to download the source. | > | revision control to download the source. | ||
| 41 | 41 | ||||
| 42 | 42 | ||||
| t | 43 | File permissions | t | 43 | Fix file permissions |
| 44 | ==================== | 44 | ======================= | ||
| 45 | 45 | ||||
| 46 | The web server account only needs access to a few directories. All the other fi | 46 | The 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 14 | rev 15 | ||||
|---|---|---|---|---|---|
| 51 | .. code-block:: c | 51 | .. code-block:: c | ||
| 52 | 52 | ||||
| t | t | 53 | mkdir egg-cache data | ||
| 54 | |||||
| 53 | sudo chgrp -R www-data pylowiki/public/attachment | 55 | sudo chgrp -R www-data pylowiki/public/attachment | ||
| 54 | sudo chmod -R 774 pylowiki/public/attachment | 56 | sudo chmod -R 774 pylowiki/public/attachment | ||
| rev 13 | rev 14 | ||||
|---|---|---|---|---|---|
| 44 | ==================== | 44 | ==================== | ||
| 45 | 45 | ||||
| n | 46 | Do the following commands from the root pylowiki project directory, user should | n | 46 | The 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 | |||||
| 48 | Run the following commands from the root of your Pylowiki project directory to c | ||||
| > | orrect permissions. | ||||
| 49 | |||||
| 47 | 50 | ||||
| 48 | .. code-block:: c | 51 | .. code-block:: c | ||
| 49 | 52 | ||||
| n | 50 | sudo chown -R user:www-data pylowiki/public/attachment | n | 53 | sudo chgrp -R www-data pylowiki/public/attachment |
| 51 | sudo chmod -R 774 pylowiki/public/attachment | 54 | sudo chmod -R 774 pylowiki/public/attachment | ||
| 52 | 55 | ||||
| n | 53 | sudo chown -R user:www-data egg-cache | n | 56 | sudo chgrp -R www-data egg-cache |
| 54 | sudo chmod -R 774 egg-cache | 57 | sudo chmod -R 774 egg-cache | ||
| 55 | 58 | ||||
| t | 56 | sudo chown -R user:www-data data | t | 59 | sudo chgrp -R www-data data |
| 57 | sudo chmod -R 774 data | 60 | sudo chmod -R 774 data | ||
| 58 | 61 | ||||
| rev 12 | rev 13 | ||||
|---|---|---|---|---|---|
| f | 1 | Setting up a pylowiki site | f | 1 | Setting up a pylowiki site |
| t | 2 | ======================================== | t | 2 | ................................... |
| 3 | 3 | ||||
| 4 | This page will outline the steps needed to setup a production pylowiki site. | 4 | This page will outline the steps needed to setup a production pylowiki site. | ||
| rev 11 | rev 12 | ||||
|---|---|---|---|---|---|
| 13 | * in a python virtualenv | 13 | * in a python virtualenv | ||
| 14 | * with a mysql database backend | 14 | * with a mysql database backend | ||
| n | n | 15 | |||
| 16 | |||||
| 17 | .. contents:: | ||||
| 18 | |||||
| 15 | 19 | ||||
| 16 | 20 | ||||
| 71 | 75 | ||||
| 72 | 76 | ||||
| t | t | 77 | Create a Pylowiki configuration .ini | ||
| 78 | ======================================== | ||||
| 79 | |||||
| 80 | The 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 10 | rev 11 | ||||
|---|---|---|---|---|---|
| 42 | Do the following commands from the root pylowiki project directory, user should | 42 | Do the following commands from the root pylowiki project directory, user should | ||
| > | be replaced with your unix id. | > | be replaced with your unix id. | ||
| 43 | 43 | ||||
| t | 44 | .. code-block:: apache | t | 44 | .. code-block:: c |
| 45 | 45 | ||||
| 46 | sudo chown -R user:www-data pylowiki/public/attachment | 46 | sudo chown -R user:www-data pylowiki/public/attachment | ||
| rev 9 | rev 10 | ||||
|---|---|---|---|---|---|
| 53 | sudo chmod -R 774 data | 53 | sudo chmod -R 774 data | ||
| 54 | 54 | ||||
| n | n | 55 | Get a Pylons virtual environment | ||
| 56 | ==================================== | ||||
| 55 | 57 | ||||
| t | t | 58 | Official 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 | |||||
| 66 | To enable the virtual environment run: | ||||
| 67 | |||||
| 68 | .. code-block:: apache | ||||
| 69 | |||||
| 70 | source virtpy/bin/activate | ||||
| 71 | |||||
| 72 | |||||
| rev 8 | rev 9 | ||||
|---|---|---|---|---|---|
| 8 | In this tutorial we will be configuring pylowiki to run: | 8 | In this tutorial we will be configuring pylowiki to run: | ||
| 9 | 9 | ||||
| t | t | 10 | * on ubuntu linux | ||
| 10 | * as a wsgi application | 11 | * as a wsgi application | ||
| 11 | * with an apache2 webserver | 12 | * with an apache2 webserver | ||
| rev 7 | rev 8 | ||||
|---|---|---|---|---|---|
| 39 | ==================== | 39 | ==================== | ||
| 40 | 40 | ||||
| t | 41 | Do the following commands from the root pylowiki project directory | t | 41 | Do the following commands from the root pylowiki project directory, user should |
| > | be replaced with your unix id. | ||||
| 42 | 42 | ||||
| 43 | .. code-block:: apache | 43 | .. code-block:: apache | ||
| rev 6 | rev 7 | ||||
|---|---|---|---|---|---|
| 43 | .. code-block:: apache | 43 | .. code-block:: apache | ||
| 44 | 44 | ||||
| n | 45 | sudo chown -R www-data:www-data pylowiki/public/attachment | n | 45 | sudo chown -R user:www-data pylowiki/public/attachment |
| 46 | sudo chmod -R 744 pylowiki/public/attachment | 46 | sudo chmod -R 774 pylowiki/public/attachment | ||
| 47 | 47 | ||||
| n | 48 | sudo chown -R www-data:www-data egg-cache | n | 48 | sudo chown -R user:www-data egg-cache |
| 49 | sudo chmod -R 744 egg-cache | 49 | sudo chmod -R 774 egg-cache | ||
| 50 | 50 | ||||
| t | 51 | sudo chown -R www-data:www-data data | t | 51 | sudo chown -R user:www-data data |
| 52 | sudo chmod -R 744 data | 52 | sudo chmod -R 774 data | ||
| 53 | 53 | ||||
| 54 | 54 | ||||
| rev 5 | rev 6 | ||||
|---|---|---|---|---|---|
| 35 | Now you should have the sourcecode in local filesystem. You might want to come | 35 | Now 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. | ||
| 36 | 36 | ||||
| t | t | 37 | |||
| 38 | File permissions | ||||
| 39 | ==================== | ||||
| 40 | |||||
| 41 | Do 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 4 | rev 5 | ||||
|---|---|---|---|---|---|
| 2 | ======================================== | 2 | ======================================== | ||
| 3 | 3 | ||||
| t | 4 | This page will outline the steps needed to setup a production pylowiki site. If | t | 4 | This 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 | |||||
| 6 | If you are interested in running a demo or local version of pylowiki, check out | ||||
| > | the `minimal pylowiki setup instructions </pylowiki#installation-and-setup>`_. | ||||
| 5 | 7 | ||||
| 6 | In this tutorial we will be configuring pylowiki to run: | 8 | In this tutorial we will be configuring pylowiki to run: | ||
| rev 3 | rev 4 | ||||
|---|---|---|---|---|---|
| 2 | ======================================== | 2 | ======================================== | ||
| 3 | 3 | ||||
| t | 4 | This page will outline the steps needed to setup a pylowiki site. | t | 4 | This 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>`_ | ||||
| 5 | 5 | ||||
| 6 | In this tutorial we will be configuring pylowiki to run: | 6 | In this tutorial we will be configuring pylowiki to run: | ||
| rev 2 | rev 3 | ||||
|---|---|---|---|---|---|
| 15 | ========================= | 15 | ========================= | ||
| 16 | 16 | ||||
| t | 17 | The pylowiki sourcecode hosted at bitbucket.org. You will need mecurial (hg) re | t | 17 | The pylowiki sourcecode is hosted at bitbucket.org. You will need mecurial (hg) |
| > | vision control to download the source. | > | revision control to download the source. | ||
| 18 | 18 | ||||
| 19 | For debian or ubuntu | 19 | For debian or ubuntu | ||
| rev 1 | rev 2 | ||||
|---|---|---|---|---|---|
| 3 | 3 | ||||
| 4 | This page will outline the steps needed to setup a pylowiki site. | 4 | This page will outline the steps needed to setup a pylowiki site. | ||
| n | n | 5 | |||
| 6 | In 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 | |||||
| 5 | 13 | ||||
| 6 | Get the sourcecode | 14 | Get the sourcecode | ||
| 22 | 30 | ||||
| 23 | mv pylowiki mysite | 31 | mv pylowiki mysite | ||
| t | t | 32 | |||
| 33 | Now 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 | |||||
| empty | rev 1 | ||||
|---|---|---|---|---|---|
| t | t | 1 | Setting up a pylowiki site | ||
| 2 | ======================================== | ||||
| 3 | |||||
| 4 | This page will outline the steps needed to setup a pylowiki site. | ||||
| 5 | |||||
| 6 | Get the sourcecode | ||||
| 7 | ========================= | ||||
| 8 | |||||
| 9 | The pylowiki sourcecode hosted at bitbucket.org. You will need mecurial (hg) re | ||||
| > | vision control to download the source. | ||||
| 10 | |||||
| 11 | For debian or ubuntu | ||||
| 12 | |||||
| 13 | .. code-block:: shell | ||||
| 14 | |||||
| 15 | sudo apt-get install mercurial | ||||
| 16 | |||||
| 17 | Once 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 | ||||
Remarkbox