You are not logged in.

#1 2017-06-30 13:56:17

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

[SOLVED] Apache Unable to Load After Update

I just upgraded Apache as a part of a full system update. It went from version 2.4.25-3 to 2.4.26-1. After updating, Apache is not restarting. I see the following when I run "systemctl status httpd." I should also note that I have the webserver set up with TLS/SSL for https support.

● httpd.service - Apache Web Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2017-06-30 13:52:29 UTC; 1min 7s ago
  Process: 2489 ExecStop=/usr/bin/httpd -k graceful-stop (code=exited, status=0/SUCCESS)
  Process: 2334 ExecStart=/usr/bin/httpd -k start -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 2334 (code=exited, status=1/FAILURE)

Jun 30 13:51:41 krondi.com systemd[1]: Started Apache Web Server.
Jun 30 13:51:57 krondi.com httpd[2334]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using krondi.com. Set the 'ServerName' directive globally to suppress this message
Jun 30 13:51:57 krondi.com httpd[2334]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
Jun 30 13:52:13 krondi.com systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Jun 30 13:52:29 krondi.com httpd[2489]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using krondi.com. Set the 'ServerName' directive globally to suppress this message
Jun 30 13:52:29 krondi.com httpd[2489]: httpd (no pid file) not running
Jun 30 13:52:29 krondi.com systemd[1]: httpd.service: Unit entered failed state.
Jun 30 13:52:29 krondi.com systemd[1]: httpd.service: Failed with result 'exit-code'.

Last edited by tony5429 (2017-06-30 19:48:14)

Offline

#2 2017-06-30 14:09:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,581
Website

Re: [SOLVED] Apache Unable to Load After Update

The error message seems pretty clear.  There's a problem with your http configs (and possibly hostname settings).  The ServerName should be set in /etc/httpd/conf/httpd.conf or /etc/httpd/conf/extra/http-vhosts.conf.  I also suspect krondi.com is not your FQDN which would suggest a problem with your hostname settings.  What is the output of `hostnamectl` and the content of /etc/hosts?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2017-06-30 18:22:47

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Apache Unable to Load After Update

Hmm... does this help?

[root@krondi ~]# more /etc/httpd/conf/httpd.conf | grep ServerName
# ServerName gives the name and port that the server uses to identify itself.
#ServerName www.example.com:80
[root@krondi ~]# more /etc/httpd/conf/extra/httpd-vhosts.conf | grep -v "#" | sed '/^$/d'
<VirtualHost *:80>
        ServerName krondi.com
        Redirect permanent / https://krondi.com/
</VirtualHost>
[root@krondi ~]# hostnamectl | grep hostname
   Static hostname: krondi.com
[root@krondi ~]# more /etc/hosts | grep -v '#' | sed '/^$/d'
127.0.0.1       localhost.localdomain   localhost
::1             localhost.localdomain   localhost
[root@krondi ~]# more /etc/hostname
krondi.com

I tried uncommenting the ServerName line in httpd.conf (and switching it to www.krondi.com:80), changing krondi.com to www.krondi.com in /etc/hostname, and changing krondi.com to www.krondi.com in the ServerName line in /etc/httpd/conf/extra/httpd-vhosts.conf but none of this seemed to make a difference...

Offline

#4 2017-06-30 18:45:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,581
Website

Re: [SOLVED] Apache Unable to Load After Update

Well, that's so extensively grepped it doesn't give a full picture.  Assuming you inclue the vhosts conf you do not need the ServerName set in the main http.conf.  But assuming this is true, it leaves two obvious problems: one you do not list your hostname in /etc/hosts, and two, your virtual host redirected everything to https (on port 443) which is good, but it is not listening on port 443, so all the traffic goes nowhere.

Also note, "www" is generally not part of a server name anymore*, but is good to have as a ServerAlias.  For example, here's a working vhosts.conf just with email and domain name revised:

<VirtualHost *:80>
    ServerAdmin me@mydomain.org
    ServerName mydomain.org
    ServerAlias www.mydomain.org
    Redirect permanent / https://mydomain.org/
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin me@mydomain.org
    DocumentRoot "/srv/mydomain"
    ServerName mydomain.org
    ServerAlias www.mydomain.org
    ErrorLog "/var/log/httpd/error_log"
    CustomLog "/var/log/httpd/access_log" common
    <Directory "/srv/mydomain">
        Require all granted
    </Directory>
    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/mydomain.org/fullchain.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/mydomain.org/privkey.pem"
</VirtualHost>

*note: it can be if you actually have separate (virtual) hosts for www.krondi.com and krondi.com, but most people would want these to go to the same place.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2017-06-30 19:05:31

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Apache Unable to Load After Update

Thanks, Trilby. I am including the vhosts conf, and I do have both a "Listen 80" and a "Listen 443" line in httpd.conf. OK, I just updated /etc/hosts as follows and tried restarting Apache, but I'm still getting the same errors:

[root@krondi ~]# more /etc/hosts
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       localhost.localdomain   localhost
::1             localhost.localdomain   localhost
66.37.4.218     krondi.com              krondi.com

# End of file

Offline

#6 2017-06-30 19:08:24

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] Apache Unable to Load After Update

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443

That is the problem. Something (maybe previous instance of apache) is listening port 443. Check who is listening the port:

# netstat --listen

Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#7 2017-06-30 19:08:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,581
Website

Re: [SOLVED] Apache Unable to Load After Update

You need to listen to 443 on your virtual host (you don't actually need to be listening on 443 in the main config) - but I really can't play guessing games anymore.  Post your actual configs (here or linked to a file sharing site) if you want help.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2017-06-30 19:10:36

WyRe
Member
Registered: 2015-09-26
Posts: 26

Re: [SOLVED] Apache Unable to Load After Update

I've got exactly the same issue, waiting feedback big_smile

anatolik wrote:

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443

That is the problem. Something (maybe previous instance of apache) is listening port 443. Check who is listening the port:

# netstat --listen

In my case there is not any app listening that ports, this could prove it:

┌—————[wyre]—————[~]
└> $ sudo lsof -i:80
┌—————[wyre]—————[~]
└> $ sudo lsof -i:443
┌—————[wyre]—————[~]
└> $ sudo systemctl restart httpd.service
┌—————[wyre]—————[~]
└> $ systemctl status httpd.service
● httpd.service - Apache Web Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2017-06-30 21:14:26 CEST; 7s ago
  Process: 1429 ExecStop=/usr/bin/httpd -k graceful-stop (code=exited, status=0/SUCCESS)
  Process: 1427 ExecStart=/usr/bin/httpd -k start -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 1427 (code=exited, status=1/FAILURE)

jun 30 21:14:25 PentiumServer systemd[1]: Started Apache Web Server.
jun 30 21:14:25 PentiumServer httpd[1427]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
jun 30 21:14:25 PentiumServer systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
jun 30 21:14:26 PentiumServer httpd[1429]: httpd (no pid file) not running
jun 30 21:14:26 PentiumServer systemd[1]: httpd.service: Unit entered failed state.
jun 30 21:14:26 PentiumServer systemd[1]: httpd.service: Failed with result 'exit-code'.
┌—————[wyre]—————[~]
└> $

Last edited by WyRe (2017-06-30 19:14:48)

Offline

#9 2017-06-30 19:13:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,581
Website

Re: [SOLVED] Apache Unable to Load After Update

Instead of "waiting" and bumping the thread with a pointless post, you could respond with your configs or the ouput you get from the command anatolik provided.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2017-06-30 19:13:47

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Apache Unable to Load After Update

anatolik: What should I install to be able to use that command?

Trilby, I'll upload them somewhere and provide links. One moment.

WyRe: Glad to hear I'm not alone!

Offline

#11 2017-06-30 19:15:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,581
Website

Re: [SOLVED] Apache Unable to Load After Update

pacman -Fs netstat

(I think I need to leave this thread be lest I TGN or bin it for continuing in a downward trajectory: good luck, my servers updated without issue)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2017-06-30 19:17:38

WyRe
Member
Registered: 2015-09-26
Posts: 26

Re: [SOLVED] Apache Unable to Load After Update

Also I must say I've found a httpd-ssl.conf.pacnew in extra/ folder what I've renamed to (in the same way I've renamed the old httpd-ssl.conf as httpd-ssl.conf.pacold, obviously) but apache doesn't restart either.

I found so frustrating this because the software should not broke due upgrading.

Thank you so much.

Offline

#13 2017-06-30 19:20:34

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Apache Unable to Load After Update

/etc/httpd/conf/httpd.conf - https://pastebin.com/biJQ7E8j

/etc/httpd/conf/extra/httpd-vhosts.conf - https://pastebin.com/LA88yDVM

Offline

#14 2017-06-30 19:21:52

WyRe
Member
Registered: 2015-09-26
Posts: 26

Re: [SOLVED] Apache Unable to Load After Update

I've downgraded apache to apache-2.4.25-3 version and works so fine, so ... there is something wrong in the new version of apache or in my config files according to that new version.


Trilby wrote:

[...] my servers updated without issue)


Maybe you are not using ssl.

Last edited by WyRe (2017-06-30 19:26:34)

Offline

#15 2017-06-30 19:25:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,581
Website

Re: [SOLVED] Apache Unable to Load After Update

Tony, you still haven't addressed my comment in post #7

EDIT: Yes, I'm using SSL, that is readily apparent from the config I posted.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#16 2017-06-30 19:27:15

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Apache Unable to Load After Update

Trilby wrote:
pacman -Fs netstat

(I think I need to leave this thread be lest I TGN or bin it for continuing in a downward trajectory: good luck, my servers updated without issue)

[root@krondi ~]# pacman -S netstat
error: target not found: netstat
[root@krondi ~]# pacman -Fs netstat
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist

Offline

#17 2017-06-30 19:28:48

WyRe
Member
Registered: 2015-09-26
Posts: 26

Re: [SOLVED] Apache Unable to Load After Update

Trilby wrote:

You need to listen to 443 on your virtual host (you don't actually need to be listening on 443 in the main config) - but I really can't play guessing games anymore.  Post your actual configs (here or linked to a file sharing site) if you want help.


So ... we need to add "Listen 443" to all our vhosts config files?

EDIT: No, that doesn't work either.

here an example of one of my several vhosts:

 
<VirtualHost *:80>

    ServerAdmin wyre@electro.lentium.xyz
    DocumentRoot "/home/wyre/public_html/Aplayer"
    ServerName electro.lentium.xyz:443
    ServerAlias electro.lentium.xyz:443
    <Directory "/home/wyre/public_html/Aplayer">
        Require all granted
    </Directory>

    Redirect "/" "https://electro.lentium.xyz/"

</VirtualHost>

<VirtualHost *:443>

    ServerAdmin wyre@electro.lentium.xyz
    DocumentRoot "/home/wyre/public_html/Aplayer"
    ServerName electro.lentium.xyz:443
    ServerAlias electro.lentium.xyz:443
    <Directory "/home/wyre/public_html/Aplayer">
        Require all granted
    </Directory>

    RewriteEngine On

    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/lentium.xyz/fullchain.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/lentium.xyz/privkey.pem"

</VirtualHost>

Last edited by WyRe (2017-06-30 19:41:01)

Offline

#18 2017-06-30 19:39:28

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Apache Unable to Load After Update

Trilby wrote:

Tony, you still haven't addressed my comment in post #7

EDIT: Yes, I'm using SSL, that is readily apparent from the config I posted.

Thanks, Trilby! That fixed it! WyRe, set up your vhosts with the 443 section Trilby has included, drop the "Listen 443" line from your httpd.conf, and restart Apache. It worked for me.

Offline

#19 2017-06-30 19:41:14

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Apache Unable to Load After Update

This part on the Arch wiki page for Apache HTTP Server should probably be updated...

Don't forget to add Port 443 to your listen ports in /etc/httpd/conf/httpd.conf
Listen 443

Offline

#20 2017-06-30 19:42:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Apache Unable to Load After Update

tony: `man pacman`

WyRe: please don't expect to have your hand held here; make some effort to help yourself.


TGN'ed...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#21 2017-06-30 19:43:52

WyRe
Member
Registered: 2015-09-26
Posts: 26

Re: [SOLVED] Apache Unable to Load After Update

tony5429 wrote:
Trilby wrote:

Tony, you still haven't addressed my comment in post #7

EDIT: Yes, I'm using SSL, that is readily apparent from the config I posted.

Thanks, Trilby! That fixed it! WyRe, set up your vhosts with the 443 section Trilby has included, drop the "Listen 443" line from your httpd.conf, and restart Apache. It worked for me.

mmmm, I've already have got that section in my case I've just needed remove "Listen 443" line form my httpd.conf


Thank you, it's solved.

Offline

#22 2017-06-30 19:48:01

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Apache Unable to Load After Update

JasonWryan: This post was TGN'd just as both of the users (myself and WyRe) suffering from the problem were able to resolve it with Trilby's help. Can it be moved back to the Networking section in case someone else runs into the same problem?

Offline

#23 2017-06-30 19:50:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Apache Unable to Load After Update

Restored to Networking on appeal.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#24 2017-06-30 19:59:00

WyRe
Member
Registered: 2015-09-26
Posts: 26

Re: [SOLVED] Apache Unable to Load After Update

tony5429 wrote:

This part on the Arch wiki page for Apache HTTP Server should probably be updated...

Don't forget to add Port 443 to your listen ports in /etc/httpd/conf/httpd.conf
Listen 443

I think the same.

Offline

#25 2017-06-30 20:04:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,581
Website

Re: [SOLVED] Apache Unable to Load After Update

Tony I'm glad that helped in the end.  Please note that we probably could have arrived at the solution *much* faster had the following happened:
1) you provided the config files the first time you were asked for them.
2) you worked to address *every* point in posts directed to you (troubleshooting often takes bifurcating paths, you need to be able to follow a couple in parallel until one can be ruled out).
3) You take initiative to work through trivial issues like not having netstat installed that were only a means to an end in the first place (figuring out how to identify what package provides a program is easily googled and covered in man and wiki pages).

This thread was a success in the end, but it's really almost 20 posts of examples of how troubleshooting threads go wrong.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB