Hi, I try that "open_environment" function and let you know the improvements.
Second thing, below is my virtual host configuration. Please go through it and help me to fix any wrong configuration that I have made. #To force daemon mode WSGIRestrictEmbedded On <VirtualHost *:80> ServerName subdomain.domainname.com Redirect / https://subdomain.domainname.com </VirtualHost> <VirtualHost *:443> ServerName subdomain.domainname.com Protocols h2 h2c http/1.1 # uat conf WSGIScriptAlias /auth /path/to/DJANGO/WSGI/file WSGIDaemonProcess uat user=www-data group=www-data threads=25 python- path=/path/to/DJANGO/environment/Sourcecode WSGIProcessGroup uat SSLEngine on SSLCertificateFile /path/to/cert/file SSLCertificateKeyFile /path/to/key/file SSLCertificateChainFile /path/to/chain/file SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH SSLHonorCipherOrder On SSLCompression off SSLSessionTickets off RewriteEngine On <Directory "/path/to/DJANGO/source"> <Files wsgi.py> Require all granted </Files> </Directory> Alias /static /path/to/DJANGO/source/static <Directory "/path/to/DJANGO/source/static"> Require all granted </Directory> #Trac instance configuration WSGIScriptAlias / /usr/share/trac/trac.wsgi <Directory "/opt/TracProjects"> WSGIApplicationGroup %{GLOBAL} Options Indexes FollowSymLinks Order allow,deny Allow from all <IfModule mod_authz_core.c> Require all granted </IfModule> </Directory> # Mapping Static files Alias /PMO/chrome /var/www/html/htdocs/htdocs AliasMatch "^/([^/]*)/chrome/(.*)$" "/var/www/html/htdocs/htdocs/$2" <Directory "/var/www/html/htdocs/htdocs"> Options -Indexes <IfModule mod_authz_core.c> Require all granted </IfModule> </Directory> # Secure headers <IfModule mod_headers.c> Header set X-Content-Type-Options "nosniff" Header set X-XSS-Protection "1;mode = block" Header always append X-Frame-Options SAMEORIGIN Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure </IfModule> Alias /authtimesheet "/var/www/html/A_PHP_site/public" <Directory /var/www/html/A_PHP_site/public> Options Indexes FollowSymLinks DirectoryIndex index.php AllowOverride All Require all granted </Directory> ErrorLog /var/log/apache2/error.log LogLevel info CustomLog /var/log/apache2/access.log combined </VirtualHost> So if you see, here I have covered a few instances all together. 1. https://subdomain.domainname.com - This is the main site. This is mostly our Trac, implemented with Trac 1.0.15. But inside it we have hooked apps of two other frameworks. 2. We have a DJANGO app hooked and a PHP_site(Zend framework) hooked. We hooked them with Trac by creating different menus for them and then redirecting the tracffic to those pages. Whenever the user hits the url https://subdomain.domainname.com/auth apache will direct user to DJANGO app. Then if the user clicks one the menu there, he will be directed to the Trac site I am running. For your information, I have already created a separate thread about "Mapping the static resources" for this site here https://groups.google.com/d/msgid/trac-users/f06818d2-701f-4904-b8cc-2051939e0719%40googlegroups.com?utm_medium=email&utm_source=footer Of course, I have installed my plugins globally, and I have only one single Trac instance in the server. So mapped the static resources as seen in the above virtualhost conf file. Now, tell me should I run the trac-admin deploy command for all those projects?(number is growing, for now 1000+ projects). Second how can I change the conf file to make the site faster? Does this configuration affect logging the same lines multiple times? I welcome all your suggestions to improve this site! Thank you in advance. On Wednesday, November 13, 2019 at 11:05:26 PM UTC+5:30, RjOllos wrote: > > > > On Wednesday, November 6, 2019 at 9:36:34 PM UTC-8, Velu Narasimman wrote: >> >> I used that statement inside of a plugin. I am managing multiple >> Environments(projects) here. So I used the generic logging form like, >> *self.log.debug("write >> this to log file") . * >> >> In some other places due to the need I imported the environment >> specifically like this, >> >> >> * from trac.env import Environment * >> * current_env = Environment("/path/to/environment") # environment is a >> Project* >> * current_env.log.debug("Some text to the log file")* >> >> I have used this second method at many places. >> > > If run that code that from the command line, I assume only one log line > will be written. > > > If that's true, then there is likely an issue with your web server > configuration that is leading to the request being processed multiple > times. I assume that is related to the slowness. > > Sharing your web server configuration may be a good next step. > > It's strange you would need to construct an Environment instance in a > plugin, since it can be accessed in a Component instance as self.env. In > the rare instance that it's necessary you probably want to use > "open_environment" from trac.env, with use_cache=True. > > https://www.edgewall.org/docs/branches-1.2-stable/html/api/trac_env.html#functions > > You may want to temporarily disable your plugins and see if the duplicate > logging ceases. Some of your plugins may not be implemented correctly. > > - Ryan > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/a1fba168-669c-4434-9202-1b53fcb67518%40googlegroups.com.