0

Before starting, I'd like to ssay this is my first experience with VPS, I have an Ubuntu 18.04 64bit minimal server.

For everything I tried so far I didn't tried using complex application. Just plain html file with Hello message and WordPress blank installation.

To begin with, I'm installing Vesta Panel because it's easier for me to control some basic tasks and configurations. In order to install this panel, I'm using nginx + php-ftpm. After I install WordPress with this configuration I'm getting 500 error with this message:

2020/06/23 23:09:09 [error] 12335#12335: *11 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "example.com"

This error only appears when I try to access the WordPress index page, or any file with the naem index.php, if it's an index.html file it loads properly.


After that I restored the VPS and installed Vesta Panel using nginx + apache. With this configuration, WordPress is working as expected. When I access my domain example.com the steps to create an WordPress website appears as expected.

With both configurations, the folder holding all the websites files is /home/admin/web/{domain.com}/public_html.


Edit: As requested in the comments, I'm adding more information to the question.

systemctl status php-fpm.service returns:

php-fpm.service - LSB: starts php7.2-fpm
Loaded: loaded (/etc/init.d/php-fpm; generated)
Active: active (exited) since Wed 2020-06-24 01:44:40 UTC; 10h ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 614)
CGroup: /system.slice/php-fpm.service

Jun 24 01:44:40 agdevision.com.br systemd[1]: Starting LSB: starts php7.2-fpm...
Jun 24 01:44:40 agdevision.com.br systemd[1]: Started LSB: starts php7.2-fpm.

sudo journalctl -u php-fpm.service returns:

-- Logs begin at Fri 2019-03-08 08:44:31 UTC, end at Wed 2020-06-24 12:08:35 UTC. --
Jun 24 01:44:40 agdevision.com.br systemd[1]: Starting LSB: starts php7.2-fpm...
Jun 24 01:44:40 agdevision.com.br systemd[1]: Started LSB: starts php7.2-fpm.
  • 1
    Welcome to Unix & Linux! We probably need more information to help you out. What does your NGINX configuration look like? Does netstat -tn show a running php-fpm process on port 9001? – Martin Konrad Jun 24 at 1:19
  • @MartinKonrad About nginx config, where exactly is this information located? About netstat -tn, I'm not seeing anything related to port 9001. – celsomtrindade Jun 24 at 1:47
0

The php-fpm service is running but it does not listen on port 9001. Please check your FPM configuration (usually in /etc/php/7.2/fpm/pool.d/www.conf on Debian/Ubuntu systems). The important parameter is the following:

listen = 127.0.0.1:9001

Don't forget to restart the FPM service by running sudo systemctl restart php-fpm.service after editing the file.

| improve this answer | |
  • Inside this folder there is 2 files www.conf and with my domain name, like domain.com.conf. Both files have this listen = 127.0.0.1:9000 already set. Also, the file with my domain name already have listen = 127.0.0.1:9001. Anyway, I followed your steps and changed the www.conf file to add that line, reestarted the server but it didn't worked. – celsomtrindade Jun 24 at 18:46
  • Please check your FPM log files in /var/log to see if it is reporting any errors during start. – Martin Konrad Jun 24 at 20:18
  • I didn't knew where this log was. Thanks. It has this error [pool www] unable to set listen address as it's already used in another pool 'domain.com' ERROR: failed to post process the configuration ERROR: FPM initialization failed – celsomtrindade Jun 24 at 20:26
  • 1
    Inside Vesta Panel, under Web configuration, there is an option called Backend Template (php-fpm), it has 3 options default | no-php | socket. I changed it to socket and now evrything is working. I removed the changes we've made before. Should I turn this into an answer? – celsomtrindade Jun 24 at 21:01
  • Yes, please add this as an answer so it's obvious to others that this question has an answer. – Martin Konrad Jun 24 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.