Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-19 Thread Anthony K

On 16/6/20 5:34 pm, Anthony K wrote:
The new way to do this is exactly what Gordon suggested - using 
`systemctl edit ` creates an override in 
`/etc/systemd/system/httpd.service.d/override.conf`.


The only issue is that there is no `systemctl` related command to 
remove this override - you will have to remember to `rm -rf 
/etc/systemd/system/httpd.service.d` if/when you want to remove that 
override.


Let me educate myself - `systemctl revert ` is the correct 
way to remove an override.


* I learn something new everyday...
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-16 Thread Alan McRae via CentOS

Thank you Gordon. That works for me. 8.2 needs the same fix.

Alan

On 16/06/2020 16:21, Gordon Messmer wrote:

On 6/15/20 7:06 PM, Jay Hart wrote:
If I do 'systemctl start httpd', apache will start right up.  But 
during boot, it doesn't and I

get the resulting errors below.

Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested 
address: AH00072: make_sock: could

not bind to address 10.20.30.11:80



httpd is starting before an interface has been configured with 
10.20.30.11.


The default configuration starts httpd after "network.target" but you 
want to start it after "network-online.target".


IIRC: run "systemctl edit httpd.service" and insert:

[Unit]
After=network-online.target

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-16 Thread Jay Hart
Thanks to all that responded. Gordon's suggestion worked brilliantly.  I ran 
the suggested
command, saved the file, rebooted, apache came right up.

Can't thank you guys enough.

Now, lets try to solve my intermittent connectivity issue, more on that later...

Jay

> On 16/6/20 4:15 pm, Alessandro Baggi wrote:
>>
>> Note: when you will get update for httpd package all could be reverted
>> to the original status, so to avoid that your modified httpd.service
>> will get an overwrite, create an alternative httpd.service in
>> /etc/systemd/system (if I'm not wrong).
>>
>> Probably there is a new way to do this.
>>
> The new way to do this is exactly what Gordon suggested - using
> `systemctl edit ` creates an override in
> `/etc/systemd/system/httpd.service.d/override.conf`.
>
> The only issue is that there is no `systemctl` related command to remove
> this override - you will have to remember to `rm -rf
> /etc/systemd/system/httpd.service.d` if/when you want to remove that
> override.
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
>


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-16 Thread Anthony K

On 16/6/20 4:15 pm, Alessandro Baggi wrote:


Note: when you will get update for httpd package all could be reverted 
to the original status, so to avoid that your modified httpd.service 
will get an overwrite, create an alternative httpd.service in 
/etc/systemd/system (if I'm not wrong).


Probably there is a new way to do this.

The new way to do this is exactly what Gordon suggested - using 
`systemctl edit ` creates an override in 
`/etc/systemd/system/httpd.service.d/override.conf`.


The only issue is that there is no `systemctl` related command to remove 
this override - you will have to remember to `rm -rf 
/etc/systemd/system/httpd.service.d` if/when you want to remove that 
override.

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-16 Thread John Pierce
Just a wild guess, but it sounds like Apache is being started before the
network is online.Is this host simple static Ethernet or DHCP, or is it
something more complicated like WiFi?

I believe you can set service dependencies with systemd, ideally your
apache service isn't started before the network is online.

If you are using WiFi, running a webserver is a bit ugly, perhaps
configuring Apache to listen to 0.0.0.0 (all interfaces) would be a better
choice?
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-16 Thread Simon Matter via CentOS
>
>
> Il 16/06/20 08:11, Alessandro Baggi ha scritto:
>>
>>
>> Il 16/06/20 06:21, Gordon Messmer ha scritto:
>>> On 6/15/20 7:06 PM, Jay Hart wrote:
 If I do 'systemctl start httpd', apache will start right up.  But
 during boot, it doesn't and I
 get the resulting errors below.

 Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested
 address: AH00072: make_sock: could
 not bind to address 10.20.30.11:80
>>>
>>>
>>> httpd is starting before an interface has been configured with
>>> 10.20.30.11.
>>>
>>> The default configuration starts httpd after "network.target" but you
>>> want to start it after "network-online.target".
>>>
>>> IIRC: run "systemctl edit httpd.service" and insert:
>>>
>>> [Unit]
>>> Afteretwork-online.target
>>>
>>> ___
>>> CentOS mailing list
>>> CentOS@centos.org
>>> https://lists.centos.org/mailman/listinfo/centos
>>
>>
>> +1
>>
>> This happened to me with ssh.
>
> Note: when you will get update for httpd package all could be reverted
> to the original status, so to avoid that your modified httpd.service
> will get an overwrite, create an alternative httpd.service in
> /etc/systemd/system (if I'm not wrong).

That's half right now, but still not good enough. If the RPM provided file
changes, your copy won't get those changes. To make this work better,
don't put the full file in /etc/systemd/system but just add an
override.conf there which is like a diff to the original file. That way
updates of the RPM are handled correctly.

Simon


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-15 Thread Alessandro Baggi




Il 16/06/20 08:11, Alessandro Baggi ha scritto:



Il 16/06/20 06:21, Gordon Messmer ha scritto:

On 6/15/20 7:06 PM, Jay Hart wrote:
If I do 'systemctl start httpd', apache will start right up.  But 
during boot, it doesn't and I

get the resulting errors below.

Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested 
address: AH00072: make_sock: could

not bind to address 10.20.30.11:80



httpd is starting before an interface has been configured with 
10.20.30.11.


The default configuration starts httpd after "network.target" but you 
want to start it after "network-online.target".


IIRC: run "systemctl edit httpd.service" and insert:

[Unit]
After=network-online.target

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos



+1

This happened to me with ssh.


Note: when you will get update for httpd package all could be reverted 
to the original status, so to avoid that your modified httpd.service 
will get an overwrite, create an alternative httpd.service in 
/etc/systemd/system (if I'm not wrong).


Probably there is a new way to do this.
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-15 Thread Alessandro Baggi




Il 16/06/20 06:21, Gordon Messmer ha scritto:

On 6/15/20 7:06 PM, Jay Hart wrote:
If I do 'systemctl start httpd', apache will start right up.  But 
during boot, it doesn't and I

get the resulting errors below.

Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested 
address: AH00072: make_sock: could

not bind to address 10.20.30.11:80



httpd is starting before an interface has been configured with 10.20.30.11.

The default configuration starts httpd after "network.target" but you 
want to start it after "network-online.target".


IIRC: run "systemctl edit httpd.service" and insert:

[Unit]
After=network-online.target

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos



+1

This happened to me with ssh.
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-15 Thread Gordon Messmer

On 6/15/20 7:06 PM, Jay Hart wrote:

If I do 'systemctl start httpd', apache will start right up.  But during boot, 
it doesn't and I
get the resulting errors below.

Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested address: 
AH00072: make_sock: could
not bind to address 10.20.30.11:80



httpd is starting before an interface has been configured with 10.20.30.11.

The default configuration starts httpd after "network.target" but you 
want to start it after "network-online.target".


IIRC: run "systemctl edit httpd.service" and insert:

[Unit]
After=network-online.target

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-15 Thread Kenneth Porter

On 6/15/2020 7:06 PM, Jay Hart wrote:

Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested address: 
AH00072: make_sock: could
not bind to address 10.20.30.11:80


Could some transient service be holding port 80 at that time?

You could probably arrange to run a script that runs "lsof -i" and "ip 
addr show", dumping the output to a temp file, just before httpd runs to 
see what's not set up right.

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Apache (httpd) fails to start at boot - Centos 8.1

2020-06-15 Thread Alan McRae via CentOS
I have always had exactly the same problem. I had to write a script and 
run it at boot time:


sleep 10
/usr/bin/systemctl start httpd

Must be some timing problem with the interface addresses not being set 
up in time.


Alan

On 16/06/2020 14:06, Jay Hart wrote:

If I do 'systemctl start httpd', apache will start right up.  But during boot, 
it doesn't and I
get the resulting errors below.

Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested address: 
AH00072: make_sock: could
not bind to address 10.20.30.11:80
Jun 15 21:17:28 dream httpd[1534]: no listening sockets available, shutting down
Jun 15 21:17:28 dream httpd[1534]: AH00015: Unable to open logs
Jun 15 21:17:29 dream systemd[1]: httpd.service: Main process exited, 
code=exited, status=1/FAILURE
Jun 15 21:17:29 dream systemd[1]: httpd.service: Failed with result 'exit-code'.

the box's ip address is 10.20.30.11, and I am trying to get http (80), and 
https (443) going.

Firewall is turned on. The listen parameter in httpd.conf is 10.20.30.11:80  
The log files in
/var/log/httpd are all owned by root.  Httpd runs as user 'apache'.

Google searches have not returned anything that looks remotely promising.

Got any suggestions?

Thanks in advance,

Jay

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos