• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Apache breaks because of hosts not set permanently, IPv4, hostname, 502 Bad Gateway

ok thank you @AusWeb !
I got many of this:
AH00016: Configuration Failed
[Thu Jun 06 10:45:06.992193 2019] [unique_id:alert] [pid 24546] (EAI 2)Name or service not known: AH01564: unable to find IPv4 address of "stock.ovh"

I think this is my VPS host: OVH
They create my instance of Plesk themselves when I order their VPS stack: Ubuntu 16 + Plesk Onyx
When I go to
Server Settings
System settings
Full hostname * : stock.ovh

Should I replace this with my server ( VPS ) IP address or else ?
 
Well the error message when doing the troubleshooter from the start was the inability to recreate server templates due to Apache template error in some .conf file... Sorry but this was misguiding.
 
Sorry, I'm bit confused here.

Your Apache Error log should explain you why the Apache refusing to start this time. Please troubleshoot from there.
 
Actually I am confused by this now:
# root@stock:~# service apache2 start
then:
# root@stock:~# vi /var/log/apache2/error.log
[Thu Jun 06 12:00:37.292893 2019] [unique_id:alert] [pid 4722] (EAI 2)Name or service not known: AH01564: unable to find IPv4 address of "stock.ovh"
AH00016: Configuration Failed

No indication of what you asked except this IPV4 error.
The hostname is indeed stock.ovh when I type:
# hostname

Could it be a reverse DNS thing?
 
Is this the error message you get every time you try to #service apache2 restart ?

In the error log,

Code:
[Thu Jun 06 12:00:37.292893 2019] [unique_id:alert] [pid 4722] (EAI 2)Name or service not known: AH01564: unable to find IPv4 address of "stock.ovh"

If it is,

Please check your host file,

#vi /etc/hosts

and see if there is an IPv4 address for the hostname

No, this is not related to DNS.
 
@AusWeb , you have no idea how helpful you are. Thank you so much for your time. I am yet to fix things because of the following but I am now bothering guys from OVH :)
I added this with no luck to /etc/cloud/templates/hosts.tmpl :
127.0.0.1 stock.ovh
127.0.0.1 51.75.205.100


status of apache is still not working and not willing to start due to same message of IPv4.

I am actually on Debian which seems to have created problems where ubuntu havent, such as mentioned in this digital ocean thread:
System has configured 'manage_etc_hosts' as True | DigitalOcean

vi /etc/cloud/cloud.cfg
Here I have Set :
manage_etc_hosts: false but system still says it's true :(

I'll try to come back here with an answer if I find it.
 
If it's not error.log, try
/var/log/httpd/error_log
(different path and different name). Look for the time when you try to start the web server.
 
It works @AusWeb so it is not solved entirely.. But Yay!
Indeed writing:
127.0.0.1 stock.ovh
127.0.0.1 51.75.205.100

inside /etc/hosts work, Yay!
but not inside /etc/cloud/templates/hosts.tmpl as recommended on the forum and this is probably a debian thing? As the thread on Digital Ocean said.
Now the problem persists as if I restart the server, all will disappear again it seems.
I don't know how I can permanently set my server 'manage_etc_hosts' to FALSE since the /etc/cloud/cloud.cfg did not work, neither the /etc/cloud/templates/hosts.tmpl
 
Yes I know, I did these exact steps 3 times, as I saw it from Igor's answer from the beginning of this thread.
This is where my server has issues and I am stuck with editing /etc/hosts directly in my case.
 
The best way was actually to set the host directly back to my VPS hostname and not the one that OVH set.
So I should set :

vps11111.ovh.net
instead of
stock.ovh
in Tools & Settings / General settings / Server settings
 
Back
Top