Deploy trac with error

171 views
Skip to first unread message

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 9, 2023, 11:52:57 AM11/9/23
to Trac Users
Hi, 
After installing trac and deploying,
I have two folders in /var/www
1 - cgi-bin
2 - htdocs

The tutorial says that you should have also created the folder:
/chrome/site

is this a bug?

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 9, 2023, 6:20:05 PM11/9/23
to Trac Users
my trac-alias.conf in /etc/apache2/sites-available

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/htdocs

    Alias /chrome /var/www/htdocs/common
    Alias /site /var/www/htdocs/site
    Alias /cgi-bin/ /var/www/cgi-bin/

    <Directory "/var/www/htdocs">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride None
        Require all granted
    </Directory>

    WSGIScriptAlias /trac /var/www/cgi-bin/trac.wsgi

    <Directory "/var/www/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Require all granted
    </Directory>

</VirtualHost> 

apache see only folders and directorys and not index page equals command tracd.
please ajude me! 

RjOllos

unread,
Nov 9, 2023, 7:56:30 PM11/9/23
to Trac Users
Which tutorial?

I suggest following this section as it explains everything.

/chrome/site is resource alias that points to /var/www/htdocs/site on the disk.

The assets in htdocs/site are extracted from $env/htdocs, so it may not exist (I'm not sure if it's always created) or at least may be empty if your environment htdocs directory is empty.

I think you want to change this:
    Alias /chrome /var/www/htdocs/common
    Alias /site /var/www/htdocs/site

-> 

    Alias /chrome/common /var/www/htdocs/common
    Alias /chrome/site /var/www/htdocs/site

or just use:

    Alias /chrome /var/www/htdocs

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 9, 2023, 8:58:49 PM11/9/23
to Trac Users
this is the project IP: http://20.206.242.97

changes applied and persistent problem...

After a lot of trying, I deleted everything and created it again....

deli@vm-delivery:~/trac$ ll /home/deli/trac/
total 40
drwxrwxrwx  8 root root 4096 Nov 10 00:18 ./
drwxr-x--- 11 deli deli 4096 Nov  9 23:25 ../
-rw-rw-r--  1 deli deli   99 Nov  9 22:09 README
-rw-rw-r--  1 deli deli   27 Nov  9 22:09 VERSION
drwxrwxr-x  2 deli deli 4096 Nov  9 22:09 conf/
drwxrwxr-x  2 deli deli 4096 Nov 10 00:18 eggs/
drwxrwxr-x  2 deli deli 4096 Nov  9 22:09 htdocs/
drwxrwxr-x  2 deli deli 4096 Nov  9 22:09 log/
drwxrwxr-x  2 deli deli 4096 Nov  9 22:09 plugins/
drwxrwxr-x  2 deli deli 4096 Nov  9 22:09 templates/

deli@vm-delivery:~/trac$ ll /var/www/trac/
total 16
drwxrwxr-x 4 deli deli 4096 Nov 10 00:06 ./
drwxrwxrwx 4 root root 4096 Nov  9 22:11 ../
drwxrwxr-x 2 deli deli 4096 Nov 10 00:17 cgi-bin/
drwxrwxr-x 4 deli deli 4096 Nov  9 22:11 htdocs/

deli@vm-delivery:~/trac$ cat /var/www/trac/cgi-bin/trac.wsgi 
import os
import trac.web.main

os.environ['TRAC_ENV'] = '/home/deli/trac'
os.environ['PYTHON_EGG_CACHE'] = '/home/deli/trac/eggs'

def application(environ, start_response):
    if "\\" in environ['REMOTE_USER']:
        environ['REMOTE_USER'] = environ['REMOTE_USER'].split("\\", 1)[1]
    return trac.web.main.dispatch_request(environ, start_response)


if you access the ip you will see that it is incorrect...

Jun Omae

unread,
Nov 10, 2023, 7:56:30 AM11/10/23
to trac-...@googlegroups.com
On Fri, Nov 10, 2023 at 10:58 AM MARCOS GONÇALVES TEIXEIRA
<marco...@gmail.com> wrote:
>
> this is the project IP: http://20.206.242.97
>
> changes applied and persistent problem...

Please describe the "problem" in details.

> if you access the ip you will see that it is incorrect...

Check error.log of apache if you get errors from apache.

--
Jun Omae <jun...@gmail.com> (大前 潤)

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 10, 2023, 8:04:49 AM11/10/23
to Trac Users
erro in apache:
[Fri Nov 10 12:58:35.740842 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP] mod_wsgi (pid=15986): Failed to exec Python script file '/var/www/trac/cgi-bin/trac.wsgi'.
[Fri Nov 10 12:58:35.740891 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP] mod_wsgi (pid=15986): Exception occurred processing WSGI script '/var/www/trac/cgi-bin/trac.wsgi'.
[Fri Nov 10 12:58:35.745253 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP] Traceback (most recent call last):
[Fri Nov 10 12:58:35.745277 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP]   File "/var/www/trac/cgi-bin/trac.wsgi", line 24, in <module>
[Fri Nov 10 12:58:35.745282 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP]     from trac.web.main import dispatch_request
[Fri Nov 10 12:58:35.745292 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP] ModuleNotFoundError: No module named 'trac'

archive /var/www/trac/cgi-bin/trac/trac.wsgi


import os


os.environ['TRAC_ENV'] = '/home/deli/trac'
os.environ['PYTHON_EGG_CACHE'] = '/home/deli/trac/eggs'

from trac.web.main import dispatch_request
def application(environ, start_response):
  environ['trac.env_path'] = '/usr/local/trac/mysite'
  return trac.web.main.dispatch_request(environ, start_response)

see problems only this archives in log apache...

Jun Omae

unread,
Nov 10, 2023, 8:30:20 AM11/10/23
to trac-...@googlegroups.com
On 2023/11/10 22:04, MARCOS GONÇALVES TEIXEIRA wrote:
> erro in apache:
> [Fri Nov 10 12:58:35.740842 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP] mod_wsgi (pid=15986): Failed to exec Python script file '/var/www/trac/cgi-bin/trac.wsgi'.
> [Fri Nov 10 12:58:35.740891 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP] mod_wsgi (pid=15986): Exception occurred processing WSGI script '/var/www/trac/cgi-bin/trac.wsgi'.
> [Fri Nov 10 12:58:35.745253 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP] Traceback (most recent call last):
> [Fri Nov 10 12:58:35.745277 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP]   File "/var/www/trac/cgi-bin/trac.wsgi", line 24, in <module>
> [Fri Nov 10 12:58:35.745282 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP]     from trac.web.main import dispatch_request
> [Fri Nov 10 12:58:35.745292 2023] [wsgi:error] [pid 15986:tid 140462495180352] [client myIP] ModuleNotFoundError: No module named 'trac'

"ModuleNotFoundError: No module named 'trac'" is logged. So that mod-wsgi
cannot find Trac. If you haven't install to standard directory, the installed
location should be configured using mod-wsgi directives in apache configuration
file.

e.g.

WSGIScriptAlias /trac /var/www/cgi-bin/trac.wsgi



# Replace </path/to/your-virtualenv> with your virtualenv location
WSGIDaemonProcess trac python-home=</path/to/your-virtualenv> display-name=%{GROUP}
WSGIScriptAlias /trac /var/www/cgi-bin/trac.wsgi process-group=trac application-group=%{GLOBAL}


See also:
https://modwsgi.readthedocs.io/en/master/configuration-directives/WSGIDaemonProcess.html
https://modwsgi.readthedocs.io/en/master/configuration-directives/WSGIScriptAlias.html

Jun Omae

unread,
Nov 10, 2023, 9:08:22 AM11/10/23
to trac-...@googlegroups.com
On Fri, Nov 10, 2023 at 10:30 PM Jun Omae <jun...@gmail.com> wrote:
> "ModuleNotFoundError: No module named 'trac'" is logged. So that mod-wsgi
> cannot find Trac. If you haven't install to standard directory, the installed
> location should be configured using mod-wsgi directives in apache configuration
> file.
>
> e.g.
>
> WSGIScriptAlias /trac /var/www/cgi-bin/trac.wsgi
>
> ↓
>
> # Replace </path/to/your-virtualenv> with your virtualenv location
> WSGIDaemonProcess trac python-home=</path/to/your-virtualenv> display-name=%{GROUP}
> WSGIScriptAlias /trac /var/www/cgi-bin/trac.wsgi process-group=trac application-group=%{GLOBAL}

Where is directory you've install Trac to? How have you installed?

Also, the installed directory should be readable from apache process
(www-data) or configure user parameter of WSGIDaemonProcess.

See also:
https://modwsgi.readthedocs.io/en/master/configuration-directives/WSGIDaemonProcess.html#user

Your trac.wsgi has another issue:

====
import os

os.environ['TRAC_ENV'] = '/home/deli/trac'
os.environ['PYTHON_EGG_CACHE'] = '/home/deli/trac/eggs'

from trac.web.main import dispatch_request
def application(environ, start_response):
environ['trac.env_path'] = '/usr/local/trac/mysite'
return trac.web.main.dispatch_request(environ, start_response)
====

Only one of os.environ['TRAC_ENV'] and environ['trac.env_path'] is enough.
And, two paths should be same.

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 10, 2023, 10:45:01 AM11/10/23
to Trac Users
this installed in Ubuntu server 22 LTS
directory: /home/deli/trac  deploy /var/www/trac

erro:

[Fri Nov 10 14:35:49.887597 2023] [wsgi:warn] [pid 21333:tid 140020309247872] (2)No such file or directory: mod_wsgi (pid=21333): Unable to stat Python home </home/deli/trac>. Python interpreter may not be able to be initialized correctly. Verify the supplied path and access permissions for whole of the path.
Python path configuration:
  PYTHONHOME = '</home/deli/trac>'
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3'
  sys.base_prefix = '</home/deli/trac>'
  sys.base_exec_prefix = '</home/deli/trac>'
  sys.platlibdir = 'lib'
  sys.executable = '/usr/bin/python3'
  sys.prefix = '</home/deli/trac>'
  sys.exec_prefix = '</home/deli/trac>'
  sys.path = [
    '</home/deli/trac>/lib/python310.zip',
    '</home/deli/trac>/lib/python3.10',
    '</home/deli/trac>/lib/python3.10/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

--------------------------
deli@vm-delivery:~$ cat /var/www/trac/cgi-bin/trac.wsgi
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
import os
SetEnv PYTHONHOME /usr/bin/python3
SetEnv PYTHONPATH /home/deli/trac
os.environ['PYTHONHOME'] = '/usr/bin/python3'
os.environ['PYTHONPATH'] = '/home/deli/trac'

os.environ['TRAC_ENV'] = '/home/deli/trac'

import trac.web.main

import dispatch_request
def application(environ, start_response):
  environ['trac.env_path'] = '/home/deli/trac'
  return trac.web.main.dispatch_request(environ, start_response)

Current thread 0x00007f5904cb4780 (most recent call first):
  <no Python frame>
------------------------------------------------
deli@vm-delivery:~$ cat /etc/apache2/sites-available/trac-alias.conf
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/trac/htdocs

    Alias /chrome/common /var/www/trac/htdocs/common
    Alias /chrome/site /var/www/trac/htdocs/site

    <Directory "/var/www/trac/htdocs">

        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride None
        Require all granted
    </Directory>

##    WSGIScriptAlias /trac /var/www/trac/cgi-bin/trac.wsgi
WSGIDaemonProcess trac python-home=</home/deli/trac> display-name=%{GROUP}

WSGIScriptAlias /trac /var/www/cgi-bin/trac.wsgi process-group=trac application-group=%{GLOBAL}

    <Directory "/var/www/trac/cgi-bin">
        AllowOverride None
  WSGIApplicationGroup %{GLOBAL}

        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Require all granted
    </Directory>

<Location "/trac/login">
  AuthType Basic
  AuthName "Trac"
  AuthUserFile /home/deli/env/.htpasswd
  Require valid-user
</Location>

</VirtualHost>

this line 

SetEnv PYTHONPATH /home/deli/trac
it does not solve?

Jun Omae

unread,
Nov 10, 2023, 10:52:38 AM11/10/23
to trac-...@googlegroups.com
WSGIDaemonProcess trac python-home=</home/deli/trac> display-name=%{GROUP}

should be

WSGIDaemonProcess trac python-home=/home/deli/trac display-name=%{GROUP}

Also, I've asked but no answer:

> Where is directory you've install Trac to? How have you installed?.
> --
> 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 trac-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/724ef912-1a44-4bbe-93d5-47691b1d2995n%40googlegroups.com.

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 10, 2023, 10:58:45 AM11/10/23
to Trac Users
I don't know exactly where it was installed, I used the command:
pip install Trac 

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 10, 2023, 1:23:15 PM11/10/23
to Trac Users
deli@vm-delivery:/$ pip show trac
Name: Trac
Version: 1.6
Summary: Integrated SCM, wiki, issue tracker and project environment
Home-page: https://trac.edgewall.org
Author: Edgewall Software
Author-email: trac...@googlegroups.com
License: BSD
Location: /home/deli/.local/lib/python3.10/site-packages
Requires: jinja2, setuptools
Required-by:


this info you need?

Ryan Ollos

unread,
Nov 10, 2023, 2:53:56 PM11/10/23
to trac-...@googlegroups.com
On Fri, Nov 10, 2023 at 10:23 AM MARCOS GONÇALVES TEIXEIRA <marco...@gmail.com> wrote:
deli@vm-delivery:/$ pip show trac
Name: Trac
Version: 1.6
Summary: Integrated SCM, wiki, issue tracker and project environment
Home-page: https://trac.edgewall.org
Author: Edgewall Software
Author-email: trac...@googlegroups.com
License: BSD
Location: /home/deli/.local/lib/python3.10/site-packages
Requires: jinja2, setuptools
Required-by:

Try:

$ pip list -v 

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 10, 2023, 6:54:18 PM11/10/23
to Trac Users
deli@vm-delivery:~$  pip list -v
Package                Version          Location                                       Installer

Babel                  2.8.0            /usr/lib/python3/dist-packages
Jinja2                 3.1.2            /home/deli/.local/lib/python3.10/site-packages pip
mod-wsgi               4.9.4            /usr/local/lib/python3.10/dist-packages        pip
pip                    22.0.2           /usr/lib/python3/dist-packages
Trac                   1.6              /home/deli/.local/lib/python3.10/site-packages pip
setuptools             59.6.0           /usr/lib/python3/dist-packages

and much other more...

Jun Omae

unread,
Nov 10, 2023, 8:22:55 PM11/10/23
to trac-...@googlegroups.com
On Sat, Nov 11, 2023 at 3:23 AM MARCOS GONÇALVES TEIXEIRA
<marco...@gmail.com> wrote:
>
> deli@vm-delivery:/$ pip show trac
> Name: Trac
> Version: 1.6
> Summary: Integrated SCM, wiki, issue tracker and project environment
> Home-page: https://trac.edgewall.org
> Author: Edgewall Software
> Author-email: trac...@googlegroups.com
> License: BSD
> Location: /home/deli/.local/lib/python3.10/site-packages
> Requires: jinja2, setuptools
> Required-by:
>
>
> this info you need?
> Em sexta-feira, 10 de novembro de 2023 às 12:58:45 UTC-3, MARCOS GONÇALVES TEIXEIRA escreveu:
>>
>> I don't know exactly where it was installed, I used the command:
>> pip install Trac

You've installed Trac to $HOME/.local (pip install uses --user option
by default when you don't have root privileges).
I'd suggest globally installing or installing to venv, not
$HOME/.local. Apache process typically cannot read $HOME/.local
directory.

1. Uninstall Trac in $HOME/.local

pip uninstall -y Trac Jinja2

2. Create venv and install Trac to the venv

sudo python3 -m venv /usr/local/venv/trac
sudo /usr/local/venv/trac/bin/pip install Trac

3. Create Trac Environment

sudo /usr/local/venv/trac/bin/trac-admin /var/trac
sudo chown -R www-data:www-data /var/trac

Jun Omae

unread,
Nov 10, 2023, 8:51:14 PM11/10/23
to trac-...@googlegroups.com
> 1. Uninstall Trac in $HOME/.local
>
> pip uninstall -y Trac Jinja2
>
> 2. Create venv and install Trac to the venv
>
> sudo python3 -m venv /usr/local/venv/trac
> sudo /usr/local/venv/trac/bin/pip install Trac
>
> 3. Create Trac Environment
>
> sudo /usr/local/venv/trac/bin/trac-admin /var/trac
> sudo chown -R www-data:www-data /var/trac

4. Set the venv directory to python-home of WSGIDaemonProcess

WSGIDaemonProcess trac python-home=/usr/local/venv/trac display-name=%{GROUP}

5. Set location of the Trac Environment to trac.env_path using SetEnv
in <VirtualHost *:80>

<VirtualHost *:80>
...
SetEnv trac.env_path /var/trac
...
</VirtualHost>>

6. Put the following content to /var/www/trac/cgi-bin/trac.wsgi

====
#!/usr/bin/python3
from trac.web.main import dispatch_request as application
====

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 10, 2023, 9:31:14 PM11/10/23
to Trac Users
hasn't done it yet...
First:
delivery@deli:/var$ sudo chmod 777 /usr/local/venv/trac/bin/trac-admin
delivery@deli:/var$ /usr/local/venv/trac/bin/trac-admin /var/trac initenv
Creating a new Trac environment at /var/trac
...

delivery@deli:/var/trac$ dir
README VERSION  conf  htdocs  log  plugins  templates
delivery@deli:/var/trac$ sudo /usr/local/venv/trac/bin/trac-admin . deploy /var/www/trac
Copying resources from:
  trac.web.chrome.Chrome
    /usr/local/venv/trac/lib/python3.10/site-packages/trac/htdocs
    /var/trac/htdocs
Creating scripts.


trac.wsgi:
#!/usr/bin/python3
....
....
# Author: Noah Kantrowitz <no...@coderanger.net>
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)

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
        SetEnv trac.env_path /var/trac

    <Directory "/var/www/trac/htdocs">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride None
        Require all granted
    </Directory>


        WSGIDaemonProcess trac python-home=/usr/local/venv/trac display-name=%{GROUP}

        WSGIScriptAlias /trac /var/www/trac/cgi-bin/trac.wsgi process-group=trac application-group=%{GLOBAL}


    <Directory "/var/www/trac/cgi-bin">
        AllowOverride None
        WSGIApplicationGroup %{GLOBAL}

        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Require all granted
    </Directory>
...
</VirtualHost>

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"

observation.I reinstalled the entire system ubuntu again...

Jun Omae

unread,
Nov 10, 2023, 10:17:20 PM11/10/23
to trac-...@googlegroups.com
On Sat, Nov 11, 2023 at 11:31 AM MARCOS GONÇALVES TEIXEIRA
<marco...@gmail.com> wrote:
> trac.wsgi:
> #!/usr/bin/python3
> ....
> ....
> # Author: Noah Kantrowitz <no...@coderanger.net>
> 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.

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 10, 2023, 10:40:11 PM11/10/23
to Trac Users
Ok, after adjusts:
delivery@deli:~$ cat /var/www/trac/cgi-bin/trac.wsgi
#!/usr/bin/python3

# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2023 Edgewall Software
# Copyright (C) 2008 Noah Kantrowitz <no...@coderanger.net>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at https://trac.edgewall.org/log/.
#

# Author: Noah Kantrowitz <no...@coderanger.net>
from trac.web.main import dispatch_request as application
-----------------------------------------------------------
delivery@deli:~$ cat /etc/apache2/sites-available/trac.conf
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/trac
    Alias / /var/www/trac/htdocs/common

    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 +FollowSymLinks +MultiViews

        AllowOverride None
        Require all granted
    </Directory>


    WSGIDaemonProcess trac python-home=/usr/local/venv/trac display-name=%{GROUP}
    WSGIScriptAlias /trac /var/www/trac/cgi-bin/trac.wsgi process-group=trac application-group=%{GLOBAL}

    <Directory "/var/www/trac/cgi-bin">
        AllowOverride None
WSGIApplicationGroup %{GLOBAL}

        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Require all granted
    </Directory>

<Location "/trac/login">
  AuthType Basic
  AuthName "Trac"
  AuthUserFile /etc/apache2/.htpasswd
  Require valid-user
</Location>

</VirtualHost>

browser: http://20.195.171.248/trac/chrome/common
response: 404 Not Found  T.T

Jun Omae

unread,
Nov 11, 2023, 2:01:30 AM11/11/23
to trac-...@googlegroups.com
Check enabled sites in Apache using "a2query -s" command.
If 000-default is still enabled, try to disable it or add "ServerName
server-name" to <VirtualHost *:80> in trac.conf and access with the
server name.

On Sat, Nov 11, 2023 at 12:40 PM MARCOS GONÇALVES TEIXEIRA
> --
> 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 trac-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/2773e874-1ad2-4661-a546-11e2099d4fdbn%40googlegroups.com.

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 11, 2023, 12:55:38 PM11/11/23
to Trac Users

delivery@deli:~$ a2query -s
trac (enabled by site administrator)
delivery@deli:~$ sudo a2dissite 000-default
Site 000-default already disabled

delivery@deli:~$ cat /etc/apache2/sites-available/trac.conf
<VirtualHost *:80>
    ServerAdmin trac@localhost


delivery@deli:~$ curl http://20.195.171.248/trac/chrome/common
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.52 (Ubuntu) Server at 20.195.171.248 Port 80</address>
</body></html>
delivery@deli:~$ curl http://20.195.171.248/trac
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.52 (Ubuntu) Server at 20.195.171.248 Port 80</address>
</body></html>

if 20.195.171.248/ i see only archives in folder...

MARCOS GONÇALVES TEIXEIRA

unread,
Nov 11, 2023, 5:51:41 PM11/11/23
to Trac Users
Getting it, it worked! Thank you for your patience and availability!
Reply all
Reply to author
Forward
0 new messages