Mailing List Archive

Deploy trac with error
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?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/eefbd879-5f10-4fac-94a2-939e78912d61n%40googlegroups.com.
Re: Deploy trac with error [ In reply to ]
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!
Em quinta-feira, 9 de novembro de 2023 às 13:52:57 UTC-3, MARCOS GONÇALVES
TEIXEIRA escreveu:

> 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?
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/f799a465-6148-4914-b5fa-8e0c96aff657n%40googlegroups.com.
Re: Deploy trac with error [ In reply to ]
On Thursday, November 9, 2023 at 8:52:57?AM UTC-8 marco...@gmail.com wrote:

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?


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

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/6c687ea2-71c3-47da-8755-48e117e422e4n%40googlegroups.com.
Re: Deploy trac with error [ In reply to ]
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...
Em quinta-feira, 9 de novembro de 2023 às 21:56:30 UTC-3, RjOllos escreveu:

> On Thursday, November 9, 2023 at 8:52:57?AM UTC-8 marco...@gmail.com
> wrote:
>
> 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?
>
>
> 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
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/ba313f7a-241c-4776-9998-6154b253f97fn%40googlegroups.com.
Re: Re: Deploy trac with error [ In reply to ]
On Fri, Nov 10, 2023 at 10:58?AM MARCOS GONÇALVES TEIXEIRA
<marcosaru86@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 <jun66j5@gmail.com> (?? ?)

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMahqrTw1py_nt_JSZW5AprSPGq%3DpYJfrA78OW22WPFY%3D8w%40mail.gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
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...
Em sexta-feira, 10 de novembro de 2023 às 09:56:30 UTC-3, Jun Omae escreveu:

> 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> (?? ?)
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/d718f3d9-4ea3-449f-af8b-d086339ae994n%40googlegroups.com.
Re: Re: Deploy trac with error [ In reply to ]
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 <jun66j5@gmail.com> (?? ?)

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/1cb1adcb-b9b4-498a-9b54-53900b20137b%40gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
On Fri, Nov 10, 2023 at 10:30?PM Jun Omae <jun66j5@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.

--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMagMd-_xZCwGW59hCYe-izuoqa44HfsVeshNUX95itWr7g%40mail.gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
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?
Em sexta-feira, 10 de novembro de 2023 às 11:08:22 UTC-3, Jun Omae escreveu:

> 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.
>
> --
> Jun Omae <jun...@gmail.com> (?? ?)
>

--
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+unsubscribe@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.
Re: Re: Deploy trac with error [ In reply to ]
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?.

On Sat, Nov 11, 2023 at 12:45?AM MARCOS GONÇALVES TEIXEIRA
<marcosaru86@gmail.com> wrote:
>
> 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?
> Em sexta-feira, 10 de novembro de 2023 às 11:08:22 UTC-3, Jun Omae escreveu:
>>
>> 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.
>>
>> --
>> Jun Omae <jun...@gmail.com> (?? ?)
>
> --
> 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+unsubscribe@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.



--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMagH4LryHOE-QKzYsqiQ9%2BnGKx1zQSKu480fSm0UDynueg%40mail.gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
I don't know exactly where it was installed, I used the command:
pip install Trac

Em sexta-feira, 10 de novembro de 2023 às 12:52:38 UTC-3, Jun Omae escreveu:

> 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?.
>
> On Sat, Nov 11, 2023 at 12:45?AM MARCOS GONÇALVES TEIXEIRA
> <marco...@gmail.com> wrote:
> >
> > 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?
> > Em sexta-feira, 10 de novembro de 2023 às 11:08:22 UTC-3, Jun Omae
> escreveu:
> >>
> >> 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.
> >>
> >> --
> >> Jun Omae <jun...@gmail.com> (?? ?)
> >
> > --
> > 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
> .
>
>
>
> --
> Jun Omae <jun...@gmail.com> (?? ?)
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/b406a986-5920-4429-9af2-c0408affbd47n%40googlegroups.com.
Re: Re: Deploy trac with error [ In reply to ]
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-dev@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
>
> Em sexta-feira, 10 de novembro de 2023 às 12:52:38 UTC-3, Jun Omae
> escreveu:
>
>> 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?.
>>
>> On Sat, Nov 11, 2023 at 12:45?AM MARCOS GONÇALVES TEIXEIRA
>> <marco...@gmail.com> wrote:
>> >
>> > 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?
>> > Em sexta-feira, 10 de novembro de 2023 às 11:08:22 UTC-3, Jun Omae
>> escreveu:
>> >>
>> >> 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.
>> >>
>> >> --
>> >> Jun Omae <jun...@gmail.com> (?? ?)
>> >
>> > --
>> > 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.
>>
>>
>>
>>
>> --
>> Jun Omae <jun...@gmail.com> (?? ?)
>>
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/ea720551-12ff-43ae-a685-966250248220n%40googlegroups.com.
Re: Re: Deploy trac with error [ In reply to ]
On Fri, Nov 10, 2023 at 10:23?AM MARCOS GONÇALVES TEIXEIRA <
marcosaru86@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-dev@googlegroups.com
> License: BSD
> Location: /home/deli/.local/lib/python3.10/site-packages
> Requires: jinja2, setuptools
> Required-by:
>

Try:

$ pip list -v

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CA%2BBGpn-3Td-TRoS0q6dO1YqgD5kFxzn_VDiDWnKnyk%3D1cx2mjQ%40mail.gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
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...

Em sexta-feira, 10 de novembro de 2023 às 16:53:56 UTC-3, Ryan Ollos
escreveu:

> 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
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/68cf0384-57a0-4b01-be3b-d027501b76edn%40googlegroups.com.
Re: Re: Deploy trac with error [ In reply to ]
On Sat, Nov 11, 2023 at 3:23?AM MARCOS GONÇALVES TEIXEIRA
<marcosaru86@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-dev@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 <jun66j5@gmail.com> (?? ?)

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMaj_77DrCYnQSGz9S0D3F52YWFwyH7eXZ2YL97DFL5fQZw%40mail.gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
> 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
====


--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMahAZwjvnpT3TFwthUSMk-CovVr0kmNDPcizAJ1W%2BC%3Dpvg%40mail.gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
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 <noah@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...
Em sexta-feira, 10 de novembro de 2023 às 22:51:14 UTC-3, Jun Omae escreveu:

> > 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
> ====
>
>
> --
> Jun Omae <jun...@gmail.com> (?? ?)
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/a75e6fff-c178-4e56-80c1-582f6b6591c7n%40googlegroups.com.
Re: Re: Deploy trac with error [ In reply to ]
On Sat, Nov 11, 2023 at 11:31?AM MARCOS GONÇALVES TEIXEIRA
<marcosaru86@gmail.com> wrote:
> trac.wsgi:
> #!/usr/bin/python3
> ....
> ....
> # Author: Noah Kantrowitz <noah@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.


--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMajZGJuFZThFpa%3DNocOPWBo6qUDe82AWKPbaTBxOwEUq-A%40mail.gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
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 <noah@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 <noah@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
Em sábado, 11 de novembro de 2023 às 00:17:20 UTC-3, Jun Omae escreveu:

> 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.
>
>
> --
> Jun Omae <jun...@gmail.com> (?? ?)
>

--
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+unsubscribe@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.
Re: Re: Deploy trac with error [ In reply to ]
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
<marcosaru86@gmail.com> wrote:
>
> 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 <noah@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 <noah@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
> Em sábado, 11 de novembro de 2023 às 00:17:20 UTC-3, Jun Omae escreveu:
>>
>> 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.
>>
>>
>> --
>> Jun Omae <jun...@gmail.com> (?? ?)
>
> --
> 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+unsubscribe@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.



--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMagQOfFYpAO3PPPQEA_rrzSyVUv72gQ6_OLQDWZGC%3DVixg%40mail.gmail.com.
Re: Re: Deploy trac with error [ In reply to ]
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
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>


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...
Em sábado, 11 de novembro de 2023 às 04:01:30 UTC-3, Jun Omae escreveu:

> 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
> <marco...@gmail.com> wrote:
> >
> > 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
> > Em sábado, 11 de novembro de 2023 às 00:17:20 UTC-3, Jun Omae escreveu:
> >>
> >> 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.
> >>
> >>
> >> --
> >> Jun Omae <jun...@gmail.com> (?? ?)
> >
> > --
> > 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
> .
>
>
>
> --
> Jun Omae <jun...@gmail.com> (?? ?)
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/fec838e6-0721-4cf0-86e0-3e9a4a6d9cean%40googlegroups.com.
Re: Re: Deploy trac with error [ In reply to ]
Getting it, it worked! Thank you for your patience and availability!
Em sábado, 11 de novembro de 2023 às 14:55:38 UTC-3, MARCOS GONÇALVES
TEIXEIRA escreveu:

>
> 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
>
> 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>
>
>
> 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...
> Em sábado, 11 de novembro de 2023 às 04:01:30 UTC-3, Jun Omae escreveu:
>
>> 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
>> <marco...@gmail.com> wrote:
>> >
>> > 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
>> > Em sábado, 11 de novembro de 2023 às 00:17:20 UTC-3, Jun Omae escreveu:
>> >>
>> >> 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.
>> >>
>> >>
>> >> --
>> >> Jun Omae <jun...@gmail.com> (?? ?)
>> >
>> > --
>> > 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.
>>
>>
>>
>>
>> --
>> Jun Omae <jun...@gmail.com> (?? ?)
>>
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/2b176d35-1731-4698-9444-4acbc08dfbb0n%40googlegroups.com.