Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - vnet

Pages: [1]
1
CentOS-WebPanel Bugs / Re: CWP pro user login error
« on: June 22, 2024, 11:53:54 AM »
Hello,
I hope someone could help me, since monday I can't login to any existing user panel, I always get an HTTP 500 error and this error in the log:

Code: [Select]
2024/06/21 17:27:07 [error] 947#0: *13228 FastCGI sent in stderr: "PHP message: PHP Warning:  main(): open_basedir restriction in effect. File(/usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/CWPUserIndex.php) is not within the allowed path(s): (/home/gep:/tmp:/usr/local/cwpsrv/var/services/users:/usr/local/cwpsrv/var/services/twig/:) in /usr/local/cwpsrv/var/services/users/index.php on line 0
PHP message: PHP Warning:  main(/usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/CWPUserIndex.php): failed to open stream: Operation not permitted in /usr/local/cwpsrv/var/services/users/index.php on line 0
PHP message: PHP Warning:  main(): open_basedir restriction in effect. File(/usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/classes/CWPAuth.php) is not within the allowed path(s): (/home/gep:/tmp:/usr/local/cwpsrv/var/services/users:/usr/local/cwpsrv/var/services/twig/:) in /usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/CWPUserIndex.php on line 0
PHP message: PHP Warning:  main(/usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/classes/CWPAuth.php): failed to open stream: Operation not permitted in /usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/CWPUserIndex.php on line 0
PHP message: PHP Fatal error:  main(): Failed opening required '/usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/classes/CWPAuth.php' (include_path='.:/usr/local/cwp/php71/lib/php') in /usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/CWPUserIndex.php on line 0" while reading response header from upstream, client: 79.60.165.171, server: localhost, request: "POST /gep/ HTTP/1.1", upstream: "fastcgi://unix:/usr/local/cwp/php71/var/sockets/gep.sock:", host: "zeus.kiway.it:2083", referrer: "https://zeus.kiway.it:2083/login/?acc=logon"

If I create a new user the login works for it.

I already followed every guide on this forum or online but with no luck =(

Anyone is facing the same issue?

Thank you

Error Analysis

The error message indicates that PHP is trying to access files located in /usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/, but these paths are not allowed according to the open_basedir settings configured in PHP. This restriction is in place to enhance security by limiting which files PHP scripts can access on the server.

1. Check open_basedir Configuration:
  • You need to adjust the open_basedir directive in your PHP configuration to include the necessary paths where CWP files are located. Typically, this involves editing your PHP-FPM configuration file.

2. Locate PHP-FPM Configuration File:
  • Identify the PHP-FPM pool configuration file for your website or user panel. It's usually found in /etc/php-fpm.d/ directory or similar location depending on your server setup.

3.Edit PHP-FPM Configuration:

Open the PHP-FPM configuration file (e.g., example.conf) with a text editor
Code: [Select]
sudo nano /etc/php-fpm.d/example.conf
4.Update open_basedir Directive:

Locate the php_admin_value[open_basedir] directive within the file. It might look something like this:
Code: [Select]
php_admin_value[open_basedir] = /home/gep:/tmp:/usr/local/cwpsrv/var/services/users:/usr/local/cwpsrv/var/services/twig/:/usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/
Ensure that /usr/local/cwpsrv/var/services/user_files/modules/cwp_framework/ (and any other relevant directories) is included in the open_basedir directive.
5. Restart php-fpm
Code: [Select]
sudo systemctl restart php-fpm

Test by attempting to log in to the existing user panels again. The HTTP 500 error and the PHP warnings should no longer appear if the open_basedir settings are correctly configured.

Additional Considerations
Security Implications: Be cautious when adjusting open_basedir as it directly affects PHP's ability to access files. Only include directories that are necessary for your application to function.

Backup: Before making changes, consider backing up your PHP-FPM configuration file to revert changes if necessary.

2
PHP / Re: PHP-FPM number of processes per user
« on: June 22, 2024, 11:38:19 AM »
In Manage WebServers Configuration we have PHP-FPM default template config where we can select the number of processes each user, however I don't find any place where I can set a specific number of processes for a specific user.

Where can I select for example the processes-50 for a specific user without apply it to all other users?

Open file user config /usr/local/cwp/php71/php-fpm.d/exampleuser.conf
Code: [Select]
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

After making the changes, save the file and exit the text editor. In nano, you can do this by pressing CTRL + O to write the changes and CTRL + X to exit

Restart PHP-FPM Service:
Code: [Select]
sudo systemctl restart php-fpm

Replace as needed to suit your requirements.

Pages: [1]