PHP-FPM and non-ASCII domain

Post Reply
wah
Posts: 10
Joined: Thu Dec 29, 2022 4:26 pm

A 404 error is returned on the Cyrillic domain and the line "File not found." appears on an empty screen. I came to the conclusion that php-fpm does not get the correct file path (due to the site directory in the form of a Cyrillic domain).
Since it was not possible to find a normal solution, I had to rename the site directory (in ASCII) and change this path in the configuration files:
/etc/php/7.4/fpm/pool.d/domain.rf.conf
and in the conf directory (/home/user/conf/web/):
domain.rf.apache2.conf
domain.rf.apache2.ssl.conf
domain.rf.nginx.conf
domain.rf.nginx.ssl.conf
Everything works, but I can't use the vestacp panel anymore.
Maybe someone has a more adequate solution, please advise?

Tags:
User avatar
myVesta
Site Admin
Posts: 963
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 10 times
Been thanked: 6 times

domain.rf.apache2.conf
domain.rf.apache2.ssl.conf
domain.rf.nginx.conf
domain.rf.nginx.ssl.conf
will be overwritten when something gets changed in the configuration of domain, even when LetsEncrypt renewing occur.

I suggest you remove the domain, check /etc/bind/named.local to ensure that empty quotes are not there (remove that line if you see it and restart bind9), and then try to add the domain via SSH:

Code: Select all

v-add-domain USER DOMAIN
P.S. Just in case:

Code: Select all

chmod a+rwx /etc/exim4/domains/
because removing such a domain can remove privileges from that folder.
wah
Posts: 10
Joined: Thu Dec 29, 2022 4:26 pm

myVesta wrote: Mon Jul 22, 2024 10:55 am domain.rf.apache2.conf
domain.rf.apache2.ssl.conf
domain.rf.nginx.conf
domain.rf.nginx.ssl.conf
will be overwritten when something gets changed in the configuration of domain, even when LetsEncrypt renewing occur.
I understand, but there is no other solution yet.
I suggest you remove the domain, check /etc/bind/named.local to ensure that empty quotes are not there (remove that line if you see it and restart bind9), and then try to add the domain via SSH:

Code: Select all

v-add-domain USER DOMAIN
I don't use bind, I use an external DNS server.

I also tried adding a site with a Cyrillic domain to punycode (like xn--d1acufc.xn--p1ai ), but vestacp swears, does not find the directory.
wah
Posts: 10
Joined: Thu Dec 29, 2022 4:26 pm

Here is what is recorded in the logs:
[proxy_fcgi:error] AH01071: Got error 'Primary script unknown'"
wah
Posts: 10
Joined: Thu Dec 29, 2022 4:26 pm

I managed to find out that apache2 is to blame, which recodes the domain from DocumentRoot to percent-encoding. Therefore, PHP-FPM cannot find the script.
Attempts to find a normal solution were unsuccessful, so I came up with a not very aesthetic, but working solution:
I have created a symlink of the site directory in percen-encoding. Like this: %D0%B4%D0%BE%D0%BC%D0%B5%D0%BD.%D1%80%D1%84
It looks terrible, but it works. In this case, all settings can be returned to normal (or not touched). And config updates will not be able to break the site.
Perhaps this solution will help someone.
Post Reply