.htaccess RewriteRule hates "Portfolio" word - .htaccess

so this is my .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Now, domain.com/About is calling to file About.php just fine same as domain.com/portfolio works with portfolio.php.
Problem - domain.com/Portfolio does not work with Potfolio.php, error:
/Portfolio/.php was not found on this server.
I have no idea why it does this just with this one particular word, it gives headache already. Any ideas?
PS. There is no Portfolio folder
Update: error.log
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add path info postfix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip per-dir prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/ -> Portfolio/
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] applying pattern '^([^\\.]+)$' to uri 'Portfolio/'
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace4] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] RewriteCond: input='C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio' pattern='!-f' => matched
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace2] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] rewrite 'Portfolio/' -> 'Portfolio/.php'
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add per-dir prefix: Portfolio/.php -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace2] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip document_root prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php -> /New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace1] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] internal redirect with /New_Era/new_era_V20/betaV2/Portfolio/.php [INTERNAL REDIRECT]
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff8b68/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add path info postfix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff8b68/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip per-dir prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php -> Portfolio/.php
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff8b68/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] applying pattern '^([^\\.]+)$' to uri 'Portfolio/.php'
[Fri Jul 10 12:26:46.304340 2015] [rewrite:trace1] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff8b68/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] pass through C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio
[Fri Jul 10 12:26:46.304340 2015] [:error] [pid 4924:tid 1660] [client ::1:50145] script 'C:/xampp/htdocs/notfound.php' not found or unable to stat
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add path info postfix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip per-dir prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/ -> Portfolio/
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] applying pattern '^([^\\.]+)$' to uri 'Portfolio/'
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace4] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] RewriteCond: input='C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio' pattern='!-f' => matched
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace2] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] rewrite 'Portfolio/' -> 'Portfolio/.php'
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add per-dir prefix: Portfolio/.php -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace2] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip document_root prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php -> /New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace1] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] internal redirect with /New_Era/new_era_V20/betaV2/Portfolio/.php [INTERNAL REDIRECT]
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2b50/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add path info postfix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2b50/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip per-dir prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php -> Portfolio/.php
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2b50/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] applying pattern '^([^\\.]+)$' to uri 'Portfolio/.php'
[Fri Jul 10 12:26:47.911142 2015] [rewrite:trace1] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2b50/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] pass through C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio
[Fri Jul 10 12:26:47.911142 2015] [:error] [pid 4924:tid 1660] [client ::1:50145] script 'C:/xampp/htdocs/notfound.php' not found or unable to stat
[Fri Jul 10 12:26:48.051543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add path info postfix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/
[Fri Jul 10 12:26:48.051543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip per-dir prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/ -> Portfolio/
[Fri Jul 10 12:26:48.051543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] applying pattern '^([^\\.]+)$' to uri 'Portfolio/'
[Fri Jul 10 12:26:48.051543 2015] [rewrite:trace4] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] RewriteCond: input='C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio' pattern='!-f' => matched
[Fri Jul 10 12:26:48.051543 2015] [rewrite:trace2] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] rewrite 'Portfolio/' -> 'Portfolio/.php'
[Fri Jul 10 12:26:48.051543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add per-dir prefix: Portfolio/.php -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:48.051543 2015] [rewrite:trace2] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip document_root prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php -> /New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:48.051543 2015] [rewrite:trace1] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2a50/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] internal redirect with /New_Era/new_era_V20/betaV2/Portfolio/.php [INTERNAL REDIRECT]
[Fri Jul 10 12:26:48.067143 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffab70/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add path info postfix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:48.067143 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffab70/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip per-dir prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php -> Portfolio/.php
[Fri Jul 10 12:26:48.067143 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffab70/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] applying pattern '^([^\\.]+)$' to uri 'Portfolio/.php'
[Fri Jul 10 12:26:48.067143 2015] [rewrite:trace1] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffab70/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] pass through C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio
[Fri Jul 10 12:26:48.067143 2015] [:error] [pid 4924:tid 1660] [client ::1:50145] script 'C:/xampp/htdocs/notfound.php' not found or unable to stat
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add path info postfix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip per-dir prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/ -> Portfolio/
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] applying pattern '^([^\\.]+)$' to uri 'Portfolio/'
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace4] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] RewriteCond: input='C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio' pattern='!-f' => matched
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace2] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] rewrite 'Portfolio/' -> 'Portfolio/.php'
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add per-dir prefix: Portfolio/.php -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace2] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip document_root prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php -> /New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace1] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ffaa70/initial] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] internal redirect with /New_Era/new_era_V20/betaV2/Portfolio/.php [INTERNAL REDIRECT]
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2b50/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] add path info postfix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio -> C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2b50/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] strip per-dir prefix: C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio/.php -> Portfolio/.php
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace3] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2b50/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] applying pattern '^([^\\.]+)$' to uri 'Portfolio/.php'
[Fri Jul 10 12:26:48.207543 2015] [rewrite:trace1] [pid 4924:tid 1660] mod_rewrite.c(475): [client ::1:50145] ::1 - - [localhost/sid#434100][rid#2ff2b50/initial/redir#1] [perdir C:/xampp/htdocs/New_Era/new_era_V20/betaV2/] pass through C:/xampp/htdocs/New_Era/new_era_V20/betaV2/Portfolio
[Fri Jul 10 12:26:48.223143 2015] [:error] [pid 4924:tid 1660] [client ::1:50145] script 'C:/xampp/htdocs/notfound.php' not found or unable to stat
[Fri Jul 10 12:26:56.413157 2015] [ssl:warn] [pid 5620:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 10 12:26:56.459957 2015] [core:warn] [pid 5620:tid 260] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Jul 10 12:26:56.647158 2015] [ssl:warn] [pid 5620:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 10 12:26:56.693958 2015] [mpm_winnt:notice] [pid 5620:tid 260] AH00455: Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.19 configured -- resuming normal operations
[Fri Jul 10 12:26:56.693958 2015] [mpm_winnt:notice] [pid 5620:tid 260] AH00456: Apache Lounge VC11 Server built: Jul 17 2014 11:50:08
[Fri Jul 10 12:26:56.693958 2015] [core:notice] [pid 5620:tid 260] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Fri Jul 10 12:26:56.693958 2015] [mpm_winnt:notice] [pid 5620:tid 260] AH00418: Parent: Created child process 5088
[Fri Jul 10 12:26:57.458359 2015] [ssl:warn] [pid 5088:tid 272] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 10 12:26:57.692360 2015] [ssl:warn] [pid 5088:tid 272] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 10 12:26:57.739160 2015] [mpm_winnt:notice] [pid 5088:tid 272] AH00354: Child: Starting 150 worker threads.

Try Adding this before your rewriteRule:
DirectorySlash Off

Related

To force use python3.9 after install libapache2-mod-wsgi-py3 django

I installed libapache2-mod-wsgi-py3 but It seems good for python3.6. My problem is set mod-wsgi for use python3.9 because my app django has all modules installed for this version.
How can I do?
I attach error log
[Fri Oct 21 10:22:21.549718 2022] [wsgi:error] [pid 8227] mod_wsgi (pid=8227): Target WSGI script '/var/www/html/elastic_queries/python/djangosite/giustiziasite/giustiziasite/wsgi.py' cannot be loaded as Python module.
[Fri Oct 21 10:22:21.549795 2022] [wsgi:error] [pid 8227] mod_wsgi (pid=8227): Exception occurred processing WSGI script '/var/www/html/elastic_queries/python/djangosite/giustiziasite/giustiziasite/wsgi.py'.
[Fri Oct 21 10:22:21.550458 2022] [wsgi:error] [pid 8227] Traceback (most recent call last):
[Fri Oct 21 10:22:21.550517 2022] [wsgi:error] [pid 8227] File "/var/www/html/elastic_queries/python/djangosite/giustiziasite/giustiziasite/wsgi.py", line 18, in <module>
[Fri Oct 21 10:22:21.550522 2022] [wsgi:error] [pid 8227] application = StaticFilesHandler(get_wsgi_application())
[Fri Oct 21 10:22:21.550528 2022] [wsgi:error] [pid 8227] File "/usr/local/lib/python3.6/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Fri Oct 21 10:22:21.550532 2022] [wsgi:error] [pid 8227] django.setup(set_prefix=False)
[Fri Oct 21 10:22:21.550537 2022] [wsgi:error] [pid 8227] File "/usr/local/lib/python3.6/dist-packages/django/__init__.py", line 24, in setup
[Fri Oct 21 10:22:21.550541 2022] [wsgi:error] [pid 8227] apps.populate(settings.INSTALLED_APPS)
[Fri Oct 21 10:22:21.550546 2022] [wsgi:error] [pid 8227] File "/usr/local/lib/python3.6/dist-packages/django/apps/registry.py", line 114, in populate
[Fri Oct 21 10:22:21.550550 2022] [wsgi:error] [pid 8227] app_config.import_models()
[Fri Oct 21 10:22:21.550555 2022] [wsgi:error] [pid 8227] File "/usr/local/lib/python3.6/dist-packages/django/apps/config.py", line 301, in import_models
[Fri Oct 21 10:22:21.550558 2022] [wsgi:error] [pid 8227] self.models_module = import_module(models_module_name)
[Fri Oct 21 10:22:21.550563 2022] [wsgi:error] [pid 8227] File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Fri Oct 21 10:22:21.550567 2022] [wsgi:error] [pid 8227] return _bootstrap._gcd_import(name[level:], package, level)
[Fri Oct 21 10:22:21.550572 2022] [wsgi:error] [pid 8227] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Fri Oct 21 10:22:21.550577 2022] [wsgi:error] [pid 8227] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Fri Oct 21 10:22:21.550583 2022] [wsgi:error] [pid 8227] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Fri Oct 21 10:22:21.550588 2022] [wsgi:error] [pid 8227] File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Fri Oct 21 10:22:21.550594 2022] [wsgi:error] [pid 8227] File "<frozen importlib._bootstrap_external>", line 678, in exec_module
[Fri Oct 21 10:22:21.550599 2022] [wsgi:error] [pid 8227] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Fri Oct 21 10:22:21.550605 2022] [wsgi:error] [pid 8227] File "/var/www/html/elastic_queries/python/djangosite/giustiziasite/pygiustizia/models/__init__.py", line 2, in <module>
[Fri Oct 21 10:22:21.550608 2022] [wsgi:error] [pid 8227] from pygiustizia.models.model_judgements import CivileDocument
[Fri Oct 21 10:22:21.550613 2022] [wsgi:error] [pid 8227] File "/var/www/html/elastic_queries/python/djangosite/giustiziasite/pygiustizia/models/model_judgements.py", line 1, in <module>
[Fri Oct 21 10:22:21.550617 2022] [wsgi:error] [pid 8227] from elasticsearch import Elasticsearch
[Fri Oct 21 10:22:21.550645 2022] [wsgi:error] [pid 8227] ModuleNotFoundError: No module named 'elasticsearch'

htaccess rewrite slow... better way of doing this?

I need to sort out my htaccess rules as i think this is the cause for many slow requests...
I have done the following that works but not sure if theres a better and efficient way other than the way i am doing it right now...
i cant really change the structure before, so i have to do this way and change the way i structure it better in future .
I wanted it dynamic, without having to change the existing URLs, that alot of people are aware of and indexed already ages ago... Also, i dont want to permanently redirect....
My file structure, (all in the same folder)
# If requested resource exists as a file or directory go to it
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) - [L]
RewriteRule ^sitemap\.xml$ /sitemap.php [L]
# i dynamically change the page to AMP if /amp/pagename.php is accessed....
RewriteRule ^amp/(.*) /$1 [NC,QSA,L]
#i have added this one rule again as the amp page for the home page is just /amp and the rule above with the trailing slash, didnt execute...
RewriteRule ^amp(.*) /$1 [NC,QSA,L]
RewriteRule ^car-price-(.*)-([0-9]+).php$ _car-price-mn-yr.php?gpimnt=$1&gpiyr=$2 [QSA,L]
#car-price-january-2018.php <- multiple urls: all months, years from 2009 to now...
RewriteRule ^car-price-([0-9]+).php$ _car-price-yr.php?gpiyr=$1 [QSA,L]
#car-price-2009.php <- yearly summary, many urls: 2009 till now.
RewriteRule ^car-price-([A-Za-z-]+).php$ _car-price-wildcard.php?_gpwilcvar=$1 [NC,QSA,L]
#car-price-london.php <- similar to the above, making it confusing.... many cities...car-price-scotland.php etc
RewriteRule ^car-price-([\w-]+).php$ _car-price-wildcard.php?_gpwilcvar=$1 [NC,QSA,L]
#gbp-rate-today-usa.php <- i have different urls for e.g. cad.rate-today-usa.php, etc...
RewriteRule ^([\w-]+).php$ _car-price-wildcard.php?_gpwilcvar=$1 [NC,QSA,L]
#why-do-diesel-cars-cost-more.php <-i have many articles that does not have a prefix or some sort to make this easier..
these rules are making my website 4 seconds longer to load.... is there a better set of rules which can help, or is this the only way?
MOD REWRITE LOG:
[Sun Mar 04 22:21:55.879811 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] strip per-dir prefix: /media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php -> car-price-kolkata.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.879861 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] applying pattern '(.*)' to uri 'car-price-kolkata.php', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.879992 2018] [rewrite:trace4] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] RewriteCond: input='/media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php' pattern='-f' => not-matched, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880117 2018] [rewrite:trace4] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] RewriteCond: input='/media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php' pattern='-d' => not-matched, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880128 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] strip per-dir prefix: /media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php -> car-price-kolkata.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880135 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] applying pattern '^sitemap\\.xml$' to uri 'car-price-kolkata.php', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880144 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] strip per-dir prefix: /media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php -> car-price-kolkata.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880151 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] applying pattern '^amp/(.*)' to uri 'car-price-kolkata.php', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880159 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] strip per-dir prefix: /media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php -> car-price-kolkata.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880166 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] applying pattern '^amp(.*)' to uri 'car-price-kolkata.php', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880178 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] strip per-dir prefix: /media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php -> car-price-kolkata.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880195 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] applying pattern '^car-price-(.*)-([0-9]+).php$' to uri 'car-price-kolkata.php', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880204 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] strip per-dir prefix: /media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php -> car-price-kolkata.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880211 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] applying pattern '^car-price-([0-9]+).php$' to uri 'car-price-kolkata.php', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880219 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] strip per-dir prefix: /media/sf_repo/carPriceusa.comNEW/car-price-kolkata.php -> car-price-kolkata.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880226 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] applying pattern '^car-price-([A-Za-z-]+).php$' to uri 'car-price-kolkata.php', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880235 2018] [rewrite:trace2] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] rewrite 'car-price-kolkata.php' -> '_car-price-wildcard.php?_gpwilcvar=kolkata', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880243 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] split uri=_car-price-wildcard.php?_gpwilcvar=kolkata -> uri=_car-price-wildcard.php, args=_gpwilcvar=kolkata, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880250 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] add per-dir prefix: _car-price-wildcard.php -> /media/sf_repo/carPriceusa.comNEW/_car-price-wildcard.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880259 2018] [rewrite:trace2] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] strip document_root prefix: /media/sf_repo/carPriceusa.comNEW/_car-price-wildcard.php -> /_car-price-wildcard.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880266 2018] [rewrite:trace1] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c37370a0/initial] [perdir /media/sf_repo/carPriceusa.comNEW/] internal redirect with /_car-price-wildcard.php [INTERNAL REDIRECT], referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880509 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c372d028/initial/redir#1] [perdir /media/sf_repo/carPriceusa.comNEW/] strip per-dir prefix: /media/sf_repo/carPriceusa.comNEW/_car-price-wildcard.php -> _car-price-wildcard.php, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880519 2018] [rewrite:trace3] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c372d028/initial/redir#1] [perdir /media/sf_repo/carPriceusa.comNEW/] applying pattern '(.*)' to uri '_car-price-wildcard.php', referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880744 2018] [rewrite:trace4] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c372d028/initial/redir#1] [perdir /media/sf_repo/carPriceusa.comNEW/] RewriteCond: input='/media/sf_repo/carPriceusa.comNEW/_car-price-wildcard.php' pattern='-f' => matched, referer: http://carpriceusav2.local/silver-price-usa.php
[Sun Mar 04 22:21:55.880758 2018] [rewrite:trace1] [pid 11803] mod_rewrite.c(476): [client 192.168.0.17:51780] 192.168.0.17 - - [carpriceusav2.local/sid#7fe0c37f2140][rid#7fe0c372d028/initial/redir#1] [perdir /media/sf_repo/carPriceusa.comNEW/] pass through /media/sf_repo/carPriceusa.comNEW/_car-price-wildcard.php, referer: http://carpriceusav2.local/silver-price-usa.php
Combine the /amp rules:
RewriteRule ^amp(/.+)? /$1 [NC,QSA,L]
As a general rule of thumb, avoid using the .* matching, as the * is greedy and creates a larger backtracking.
Next, instead of having separate PHP scripts accepting the optional gpimnt parameter, you can do this in a single PHP file. If the value for the same is not present, proceed with only the gpiyr value received. This can again be combined with conditional gpwilcvar parameter etc. and reducing the total number of patterns your URL will be matched against. A single defined() (or isset()) call inside PHP is faster than pattern matching.

htaccess rule not working without R=301 flag?

My quest to understand htaccess continues. I haven't read anything useful in the documentation for this problem. This is my .htaccess:
RewriteEngine On
RewriteBase /
# e.g. Rewrite 'contact' to 'index.php/main/lessons'
RewriteRule ^contact$ index.php/main/lessons
The rule does not work, it is as if the rewrite doesn't even take place. The url is unchanged as just get a blank page. I want to redirect any request to /contact to /index.php/main/contact. However, when I add the [R=301] flag,
it works. I see the permanent redirect request in chrome developer tools and I end up at the right page. Any help?
Thanks.
This is what I get from my error log with LogLevel alert rewrite:trace3 in my httpd.conf:
[Sat Jan 24 21:50:29.243747 2015] [rewrite:trace3] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0] [rid#73716b5310/initial] [perdir C:/Sites/mysite/] applying pattern '^contact$' to uri 'contact'
[Sat Jan 24 21:50:29.243747 2015] [rewrite:trace2] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0] [rid#73716b5310/initial] [perdir C:/Sites/mysite/] rewrite 'contact' -> 'index.php/main/lessons'
[Sat Jan 24 21:50:29.243747 2015] [rewrite:trace3] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0] [rid#73716b5310/initial] [perdir C:/Sites/mysite/] add per-dir prefix: index.php/main/lessons -> C:/Sites/mysite/index.php/main/lessons
[Sat Jan 24 21:50:29.243747 2015] [rewrite:trace2] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#73716b5310/initial] [perdir C:/Sites/mysite/] trying to replace prefix C:/Sites/mysite/ with /
[Sat Jan 24 21:50:29.243747 2015] [rewrite:trace1] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#73716b5310/initial] [perdir C:/Sites/mysite/] internal redirect with /index.php/main/lessons [INTERNAL REDIRECT]
[Sat Jan 24 21:50:29.248751 2015] [rewrite:trace3] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#737168f168/initial/redir#1] [perdir C:/Sites/mysite/] add path info postfix: C:/Sites/mysite/index.php -> C:/Sites/mysite/index.php/main/lessons
[Sat Jan 24 21:50:29.248751 2015] [rewrite:trace3] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#737168f168/initial/redir#1] [perdir C:/Sites/mysite/] strip per-dir prefix: C:/Sites/mysite/index.php/main/lessons -> index.php/main/lessons
[Sat Jan 24 21:50:29.248751 2015] [rewrite:trace3] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#737168f168/initial/redir#1] [perdir C:/Sites/mysite/] applying pattern '^contact$' to uri 'index.php/main/lessons'
[Sat Jan 24 21:50:29.248751 2015] [rewrite:trace1] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#737168f168/initial/redir#1] [perdir C:/Sites/mysite/] pass through C:/Sites/mysite/index.php
[Sat Jan 24 21:50:29.249748 2015] [rewrite:trace3] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#73716af2e0/subreq] [perdir C:/Sites/mysite/] add path info postfix: C:/Sites/mysite/main -> C:/Sites/mysite/main/lessons
[Sat Jan 24 21:50:29.249748 2015] [rewrite:trace3] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#73716af2e0/subreq] [perdir C:/Sites/mysite/] strip per-dir prefix: C:/Sites/mysite/main/lessons -> main/lessons
[Sat Jan 24 21:50:29.249748 2015] [rewrite:trace3] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#73716af2e0/subreq] [perdir C:/Sites/mysite/] applying pattern '^contact$' to uri 'main/lessons'
[Sat Jan 24 21:50:29.249748 2015] [rewrite:trace1] [pid 5028:tid 908] mod_rewrite.c(475): [client ::1:61103] ::1 - - [mysite/sid#73702837d0][rid#73716af2e0/subreq] [perdir C:/Sites/mysite/] pass through C:/Sites/mysite/main
I should also note that I am using CodeIgniter.
Using code igniter you can just define redirections in "application/config/routes.php"
Just add this line:
$route['contact'] = 'main/contact';

uWSGI suddenly won't start again after server crash on Debian

After my server crashed i am unable to start uWSGI again, and keep getting following errors on unlink() and bind().
I start my service as root, so it makes it even more strange.
Sun Nov 16 15:25:24 2014 - *** Starting uWSGI 1.2.3-debian (64bit) on [Sun Nov 16 15:25:24 2014] ***
Sun Nov 16 15:25:24 2014 - compiled with version: 4.7.2 on 06 July 2013 12:20:09
Sun Nov 16 15:25:24 2014 - detected number of CPU cores: 1
Sun Nov 16 15:25:24 2014 - current working directory: /
Sun Nov 16 15:25:24 2014 - writing pidfile to /run/uwsgi/app/myserver_dev/pid
Sun Nov 16 15:25:24 2014 - detected binary path: /usr/bin/uwsgi-core
Sun Nov 16 15:25:24 2014 - setgid() to 33
Sun Nov 16 15:25:24 2014 - setuid() to 33
Sun Nov 16 15:25:24 2014 - writing pidfile to /var/www/servers/myserver/development/logs/myserver.pid
Sun Nov 16 15:25:24 2014 - your memory page size is 4096 bytes
Sun Nov 16 15:25:24 2014 - detected max file descriptor number: 1024
Sun Nov 16 15:25:24 2014 - lock engine: pthread robust mutexes
Sun Nov 16 15:25:24 2014 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/myserver_dev/socket fd 3
Sun Nov 16 15:25:24 2014 - unlink(): Permission denied [socket.c line 75]
Sun Nov 16 15:25:24 2014 - bind(): Address already in use [socket.c line 107]
nginx servers:
server {
access_log /var/www/servers/example/development/logs/nginx_access.log;
error_log /var/www/servers/example/development/logs/nginx_error.log;
listen 8181;
server_name example.com;
charset utf-8;
}
server {
listen 80;
server_name *.example.com;
return 301 http://example.com$request_uri;
}
server {
access_log /var/www/servers/example/production/logs/nginx_access.log;
error_log /var/www/servers/example/production/logs/nginx_error.log;
listen 80;
server_name example.com;
charset utf-8;
}
server {
listen 7777;
server_name example.com;
charset utf-8;
root /var/www/servers/phpmyadmin;
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
location ~ .php$ {
allow 2.110.234.34;
deny all;
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
uWSGI config development:
[uwsgi]
master = true
workers = 2
socket = /var/www/servers/example/development/sockets/example.sock
chmod-socket = 666
log-date = true
uid = www-data
gid = www-data
chdir = /var/www/servers/example/development/webapp
wsgi-file = /var/www/servers/example/development/webapp/webapp/wsgi.py
virtualenv = /var/www/servers/example/development/env
vacuum = true
env = DJANGO_SETTINGS_MODULE=webapp.settings
pidfile2 = /var/www/servers/example/development/logs/example.pid
uWSGI config production
[uwsgi]
master = true
workers = 2
socket = /var/www/servers/example/production/sockets/example.sock
chmod-socket = 666
log-date = true
uid = www-data
gid = www-data
chdir = /var/www/servers/example/production/webapp
wsgi-file = /var/www/servers/example/production/webapp/webapp/wsgi.py
virtualenv = /var/www/servers/example/production/env
vacuum = true
env = DJANGO_SETTINGS_MODULE=webapp.settings
pidfile2 = /var/www/servers/example/production/logs/example.pid
Albeit you run the server as root it drops privileges to 33 (presumibly www-data). This user (33) must own the right to remove /var/www/servers/example/production/sockets/example.sock.
Probably the crash corrupted the inode that now has wrong attributes. Fix them and it should work again.

sails lift causes error ENOENT (No such file or Directory)

Im trying to launch this project https://github.com/lucj/sails-oauth2-api to learn from it however im having trouble getting it to work.
I installed the prerequisites with:
npm install
in the terminal at the project directory
when i do:
strace -f -e trace=process sails lift
it gives me the following debugging output.
execve("/usr/bin/sails", ["sails", "lift"], [/* 64 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x7f4017319740) = 0
execve("/usr/local/sbin/node", ["node", "/usr/bin/sails", "lift"], [/* 64 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/node", ["node", "/usr/bin/sails", "lift"], [/* 64 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/sbin/node", ["node", "/usr/bin/sails", "lift"], [/* 64 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/bin/node", ["node", "/usr/bin/sails", "lift"], [/* 64 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x7f204315b780) = 0
clone(child_stack=0x7f2043172f70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CL ONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f20431739d0, tls=0x7f2043173700, child_tidptr=0x7f20431739d0) = 5575
Process 5575 attached
[pid 5574] clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f204315ba50) = 5576
Process 5576 attached
[pid 5576] execve("/usr/bin/nodejs", ["/usr/bin/nodejs", "/home/vern/sails-oauth2- api-deve"..., "default", "--gdsrc=/home/vern/sails-oauth2-"..., "--environment=development", "--baseurl=http://localhost:1337", "--signalpath=/___signal"], [/* 66 vars */]) = 0
[pid 5576] arch_prctl(ARCH_SET_FS, 0x7fc1da6b1780) = 0
[pid 5576] clone(child_stack=0x7fc1da6c8f70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CL ONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7fc1da6c99d0, tls=0x7fc1da6c9700, child_tidptr=0x7fc1da6c99d0) = 5577
Process 5577 attached
[pid 5574] clone(child_stack=0x7f2041b39f70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CL ONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f2041b3a9d0, tls=0x7f2041b3a700, child_tidptr=0x7f2041b3a9d0) = 5578
[pid 5574] clone(child_stack=0x7f2041338f70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CL ONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f20413399d0, tls=0x7f2041339700, child_tidptr=0x7f20413399d0) = 5579
[pid 5574] clone(child_stack=0x7f2040b37f70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CL ONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f2040b389d0, tls=0x7f2040b38700, child_tidptr=0x7f2040b389d0) = 5580
Process 5580 attached
Process 5579 attached
Process 5578 attached
[pid 5574] clone(child_stack=0x7f203bffef70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CL ONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f203bfff9d0, tls=0x7f203bfff700, child_tidptr=0x7f203bfff9d0) = 5581
Process 5581 attached
trustedTestClient already exists
- client_id: NC2OKCDJAI
- client_secret: JNRL6Rlw6NDPEXPBFgFRkQ4EybQYFu
- redirectURI: http://localhost:1338
untrustedTestClient already exists
- client_id: TR5U2NKLJO
- client_secret: hq0Qgm2NpQ6KRbd91Dwy7Ao1Jlcv6E
- redirectURI: http://localhost:1339
info:
info:
info: Sails.js <|
info: v0.9.11 |\
info: /|.\
info: / || \
info: ,' |' \
info: .-'.-==|/_--'
info: `--'-------'
info: __---___--___---___--___---___--___
info: ____---___--___---___--___---___--___-__
info:
info: Server lifted in `/home/vern/sails-oauth2-api-develop`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.
debug: --------------------------------------------------------
debug: :: Fri Jun 13 2014 05:00:49 GMT-0700 (PDT)
debug:
debug: Environment : development
debug: Port : 1337
debug: --------------------------------------------------------
debug: Lowering sails...
[pid 5576] --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=5574, si_uid=1000} ---
[pid 5577] +++ killed by SIGHUP +++
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open 'logs/application.log'
[pid 5579] _exit(0) = ?
[pid 5580] _exit(0) = ?
[pid 5581] _exit(0) = ?
[pid 5580] +++ exited with 0 +++
[pid 5581] +++ exited with 0 +++
[pid 5579] +++ exited with 0 +++
[pid 5576] +++ killed by SIGHUP +++
[pid 5574] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=5576, si_status=SIGHUP, si_utime=86, si_stime=26} ---
[pid 5578] _exit(0) = ?
[pid 5574] exit_group(8) = ?
[pid 5575] +++ exited with 8 +++
[pid 5578] +++ exited with 8 +++
+++ exited with 8 +++
The top 6 lines mean something but i dont know what it means and how i need to fix it. I have a selfmade project that works perfectly when i use sails lift.
P.S. The project supposedly created 2 clients which i can find back in the debug output but the application crashes later on.
So its something with this project that causes the problem but what?
It says Error: ENOENT, open 'logs/application.log'.
This means it's trying to open logs/application.log but that it doesn't exist. Try creating the file and lifting again:
mkdir logs && cd $_ && touch application.log && cd .. && sails lift

Resources