[SOLVED] Apache localhost error 503

[SOLVED] Apache localhost error 503

Postby flink » Nov 22nd, '24, 16:38

The Apache localhost does not work any more.

https://localhost

503

/var/log/httpd/error_log:

[Fri Nov 22 15:36:05.736555 2024] [proxy:error] [pid 2053:tid 2053] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php-fpm/php-fpm.sock (localhost:8000) failed
[Fri Nov 22 15:36:05.736591 2024] [proxy_fcgi:error] [pid 2053:tid 2053] [client ::1:43078] AH01079: failed to make connection to backend: localhost
[Fri Nov 22 15:36:05.835638 2024] [proxy:error] [pid 2054:tid 2054] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php-fpm/php-fpm.sock (localhost:8000) failed
[Fri Nov 22 15:36:05.835671 2024] [proxy_fcgi:error] [pid 2054:tid 2054] [client ::1:43092] AH01079: failed to make connection to backend: localhost, referer: https://localhost/



http://localhost gives the same error.
Last edited by flink on Nov 23rd, '24, 18:31, edited 2 times in total.
flink
 
Posts: 207
Joined: Mar 3rd, '12, 19:23

Re: Apache localhost error 503

Postby doktor5000 » Nov 22nd, '24, 20:46

So should we try to guess what you have in your apache config currently ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18039
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Apache localhost error 503

Postby flink » Nov 23rd, '24, 14:08

I have now deactivated all other Apache config files (renamed them into *.bak).

Ony these are active now:

local.conf:

Code: Select all
<Directory /var/www/html>
    Require all granted
    Allowoverride all
</Directory>

<VirtualHost *:80>
    DocumentRoot "/var/www/html"
    ServerName localhost
    ServerAdmin franz@ttproducts.de
    ErrorLog "/var/log/httpd/error_log_localhost"
    CustomLog "/var/log/httpd/access_log_localhost" combined
</VirtualHost>


00_default_vhosts.conf:
Code: Select all
<VirtualHost _default_:80>
    ServerAdmin root@localhost
    ServerName localhost
</VirtualHost>


00_default_ssl_vhost.conf:

Code: Select all
<VirtualHost _default_:443>
    # general configuration
    ServerAdmin root@localhost
    ServerName localhost

    # SSL configuration
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/httpd.pem
    SSLCertificateKeyFile /etc/pki/tls/private/httpd.pem
    CustomLog logs/ssl_request_log \
        "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>
flink
 
Posts: 207
Joined: Mar 3rd, '12, 19:23

Re: Apache localhost error 503

Postby doktor5000 » Nov 23rd, '24, 16:04

What about the configuration for the php fpm module for which you have the errors in error_log ? As root
Code: Select all
systemctl status php-fpm.service -al
systemctl restart php-fpm.service
systemctl status php-fpm.service -al
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18039
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Apache localhost error 503

Postby flink » Nov 23rd, '24, 18:26

doktor5000 wrote:What about the configuration for the php fpm module for which you have the errors in error_log ?

I do not realize, that I have this probably installed because of some recommendation.

Code: Select all
[franz@franz-820 sites.d]$ systemctl status php-fpm.service -al
○ php-fpm.service - The PHP FastCGI Process Manager
     Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; preset: disabled)
     Active: inactive (dead)



Code: Select all
[franz@franz-820 sites.d]$ systemctl restart php-fpm.service
[franz@franz-820 sites.d]$ systemctl status php-fpm.service -al
● php-fpm.service - The PHP FastCGI Process Manager
     Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; preset: disabled)
     Active: active (running) since Sat 2024-11-23 17:22:02 CET; 10s ago

   Main PID: 441078 (php-fpm)
     Status: "Processes active: 0, idle: 20, Requests: 0, slow: 0, Traffic: 0.00req/sec"
      Tasks: 21 (limit: 19006)
     Memory: 22.8M
        CPU: 195ms
     CGroup: /system.slice/php-fpm.service
             ├─441078 "php-fpm: master process (/etc/php-fpm.conf)"
             ├─441079 "php-fpm: pool www"
             ├─441080 "php-fpm: pool www"
             ├─441081 "php-fpm: pool www"
             ├─441082 "php-fpm: pool www"
             ├─441083 "php-fpm: pool www"
             ├─441084 "php-fpm: pool www"
             ├─441085 "php-fpm: pool www"
             ├─441086 "php-fpm: pool www"
             ├─441087 "php-fpm: pool www"
             ├─441088 "php-fpm: pool www"
             ├─441089 "php-fpm: pool www"
             ├─441090 "php-fpm: pool www"
             ├─441091 "php-fpm: pool www"




Now it is fixed! Only a 404 error because I have turned off the other Apache config files and must make them available again.

Why did PHP-FPM not start automatically after a reboot?
Last edited by doktor5000 on Nov 23rd, '24, 23:57, edited 1 time in total.
Reason: fixed code tags
flink
 
Posts: 207
Joined: Mar 3rd, '12, 19:23

Re: Apache localhost error 503

Postby flink » Nov 23rd, '24, 18:31

PHP-FPM must be activated in the Services and daemons.
Attachments
Screenshot from 2024-11-23 17-28-42.png
services add PHP-FPM
Screenshot from 2024-11-23 17-28-42.png (25.21 KiB) Viewed 7042 times
flink
 
Posts: 207
Joined: Mar 3rd, '12, 19:23

Re: Apache localhost error 503

Postby doktor5000 » Nov 23rd, '24, 23:58

flink wrote:Why did PHP-FPM not start automatically after a reboot?


Because it's not enabled by default:

[franz@franz-820 sites.d]$ systemctl status php-fpm.service -al
○ php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; preset: disabled)
Active: inactive (dead)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18039
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron