On Sat, Nov 11, 2023 at 11:31 AM MARCOS GONÇALVES TEIXEIRA
<[email protected]> wrote:
> trac.wsgi:
> #!/usr/bin/python3
> ....
> ....
> # Author: Noah Kantrowitz <[email protected]>
> import os
> import sys
> sys.path.insert(0, '/usr/local/venv/trac')
> os.environ['TRAC_ENV'] = '/usr/local/venv/trac'
>
> from trac.web.main import dispatch_request as application
>
> #SetEnv PYTHONHOME /usr/local/venv/trac/bin/python3
> #SetEnv PYTHONPATH /var/trac
> os.environ['PYTHONHOME'] = '/usr/local/venv/trac/bin/python3'
> os.environ['PYTHONPATH'] = '/usr/local/venv/trac'
> #import dispatch_request
> def application(environ, start_response):
> environ['trac.env_path'] = '/var/trac'
> return trac.web.main.dispatch_request(environ, start_response)
>
No need to insert sys.path and set to os.environ[...].
The following content is enough:
====
#!/usr/bin/python3
from trac.web.main import dispatch_request as application
====
> my trac.conf in /etc/apache2/sites-available:
> <VirtualHost *:80>
> ....
> DocumentRoot /var/trac
>
> Alias /chrome/common /var/www/trac/htdocs/common
> Alias /chrome/site /var/www/trac/htdocs/site
Incorrect. Should be:
Alias /trac/chrome/common /var/www/trac/htdocs/common
Alias /trac/chrome/site /var/www/trac/htdocs/site
> SetEnv trac.env_path /var/trac
> <Directory "/var/www/trac/htdocs">
> Options +Indexes +FollowSymLinks +MultiViews
Indexes should not be used. Remove "+Indexes".
> apache log error:
> [Sat Nov 11 02:22:13.673726 2023] [mpm_event:notice] [pid 10139:tid
> 140564912088960] AH00492: caught SIGWINCH, shutting down gracefully
> [Sat Nov 11 02:22:13.812982 2023] [mpm_event:notice] [pid 10281:tid
> 140333620463488] AH00489: Apache/2.4.52 (Ubuntu) mod_wsgi/4.9.0 Python/3.10
> configured -- resuming normal operations
> [Sat Nov 11 02:22:13.813090 2023] [core:notice] [pid 10281:tid
> 140333620463488] AH00094: Command line: '/usr/sbin/apache2'
>
> apache acess error: [11/Nov/2023:02:22:23 +0000] "GET /trac HTTP/1.1" 404 493
> "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
> Chrome/117.0.0.0 Safari/537.36"
>
> I reinstalled the entire system ubuntu again...
Your problem cannot is be solved by reinstalling Ubuntu. I absolutely
don't think that is good idea.
The 404 error is caused by something wrong in your apache configuration.
Recheck the configuration and post entire of trac.conf.
--
Jun Omae <[email protected]> (大前 潤)
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/trac-users/CAEVLMajZGJuFZThFpa%3DNocOPWBo6qUDe82AWKPbaTBxOwEUq-A%40mail.gmail.com.