Changeset - 68aaa0aca0d2
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2010-12-27 15:30:04
marcin@python-works.com
Updated docs, added apache proxy example config
1 file changed with 34 insertions and 8 deletions:
0 comments (0 inline, 0 general)
docs/setup.rst
Show inline comments
 
@@ -169,25 +169,25 @@ Nginx virtual host example
 
Sample config for nginx using proxy::
 

	
 
 server {
 
    listen          80;
 
    server_name     hg.myserver.com;
 
    access_log      /var/log/nginx/rhodecode.access.log;
 
    error_log       /var/log/nginx/rhodecode.error.log;
 
    location / {
 
            root /var/www/rhodecode/rhodecode/public/;
 
            if (!-f $request_filename){
 
                proxy_pass      http://127.0.0.1:5000;
 
            }
 
            #this is important for https !!!
 
            #this is important if You want to use https !!!
 
            proxy_set_header X-Url-Scheme $scheme;
 
            include         /etc/nginx/proxy.conf;  
 
    }
 
 }  
 
  
 
Here's the proxy.conf. It's tuned so it'll not timeout on long
 
pushes and also on large pushes::
 

	
 
    proxy_redirect              off;
 
    proxy_set_header            Host $host;
 
    proxy_set_header            X-Host $http_host;
 
    proxy_set_header            X-Real-IP $remote_addr;
 
@@ -207,43 +207,69 @@ pushes and also on large pushes::
 
Also when using root path with nginx You might set the static files to false
 
in production.ini file::
 

	
 
  [app:main]
 
    use = egg:rhodecode
 
    full_stack = true
 
    static_files = false
 
    lang=en
 
    cache_dir = %(here)s/data
 

	
 
To not have the statics served by the application. And improve speed.
 

	
 
Apache reverse proxy
 
--------------------
 
Tutorial can be found here
 

	
 
Apache virtual host example
 
---------------------------
 

	
 
Sample config for apache using proxy::
 

	
 
<VirtualHost *:80>
 
        ServerName hg.myserver.com
 
        ServerAlias hg.myserver.com
 

	
 
        <Proxy *>
 
          Order allow,deny
 
          Allow from all
 
        </Proxy>
 

	
 
        #important !
 
        #Directive to properly generate url (clone url) for pylons
 
        ProxyPreserveHost On
 

	
 
        #rhodecode instance
 
        ProxyPass / http://127.0.0.1:5000/
 
        ProxyPassReverse / http://127.0.0.1:5000/
 
        
 
        #to enable https use line below
 
        #SetEnvIf X-Url-Scheme https HTTPS=1
 
        
 
</VirtualHost> 
 

	
 

	
 
Additional tutorial
 
http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
 

	
 

	
 
Apache's example FCGI config
 
----------------------------
 

	
 
TODO !
 

	
 
Other configuration files
 
-------------------------
 

	
 
Some extra configuration files and examples can be found here:
 
http://hg.python-works.com/rhodecode/files/tip/init.d
 
Some example init.d script can be found here, for debian and gentoo:
 

	
 
and also an celeryconfig file can be use from here:
 
http://hg.python-works.com/rhodecode/files/tip/celeryconfig.py
 
https://rhodeocode.org/rhodecode/files/tip/init.d
 

	
 

	
 
Troubleshooting
 
---------------
 

	
 
- missing static files ?
 

	
 
 - make sure either to set the `static_files = true` in the .ini file or
 
   double check the root path for Your http setup. It should point to 
 
   for example:
 
   /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
 
   
 
- can't install celery/rabbitmq
0 comments (0 inline, 0 general)