Welcome! Log In Create A New Profile

Advanced

Trac+Nginx

Posted by udienz 
Trac+Nginx
November 28, 2010 07:01AM
Hello all,
I need you help, i still staged migrating my own Trac using Nginx with socket (not use port). It try to confing like this [1] and this [2]. I running under Ubuntu Lucid LTS. i got error messages :(

[code]
2010/11/28 18:44:15 [crit] 21412#0: *1 connect() to unix:/tmp/trac-fastcgi.sock failed (13: Permission denied) while connecting to upstream, client: 192.168.122.1, server: 192.168.122.1, request: "GET /trac/ HTTP/1.0", upstream: "fastcgi://unix:/tmp/trac-fastcgi.sock:", host: "192.168.122.1"
[/code]


can someone help to correct it?

[1] --- Trac-fcgi.py
[code]
#!/usr/bin/env python
import os
import tempfile

sockaddr = '/tmp/trac-fastcgi.sock'
os.environ['TRAC_ENV'] = '/home/udienz/devel/dev.boi/project/ubuntu/'
os.environ['PYTHON_EGG_CACHE'] = tempfile.gettempdir()

try:
from trac.web.main import dispatch_request
import trac.web._fcgi

fcgiserv = trac.web._fcgi.WSGIServer(dispatch_request,
bindAddress = sockaddr, umask = 7)
fcgiserv.run()

except SystemExit:
raise
except Exception, e:
print 'Content-Type: text/plain\r\n\r\n',
print 'Oops...'
print
print 'Trac detected an internal error:'
print
print e
print
import traceback
import StringIO
tb = StringIO.StringIO()
traceback.print_exc(file=tb)
print tb.getvalue()

[/code]


[2] Nginx Conf
[code]
server {
listen 80;
server_name 192.168.122.1;
access_log /var/log/nginx/virtual.access.log;
error_log /var/log/nginx/virtual.error.log;
location /trac {
# full path
if ($uri ~ ^/trac/([^/]+)(/.*)) {
set $script_name $1;
set $path_info $2;
}

# socket address
fastcgi_pass unix:/tmp/trac-fastcgi.sock;

## WSGI REQUIRED VARIABLES
# WSGI application name - trac instance prefix.
fastcgi_param SCRIPT_NAME $script_name;
fastcgi_param PATH_INFO $path_info;

## WSGI NEEDED VARIABLES - trac warns about them
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;

# for authentication to work
fastcgi_param REMOTE_USER $remote_user;
}

}

[/code]
Re: Trac+Nginx
December 08, 2010 04:10AM
test
Re: Trac+Nginx
December 08, 2010 05:13AM
test message
Re: Trac+Nginx
December 08, 2010 06:13AM
test message
Re: Trac+Nginx
December 08, 2010 08:55AM
test
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 274
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready