HELP: site2.com is blank while site1.com is OK

After installing easyengine, migrated 2 wordpress sites, and configured DNS, site1.com is accessible but site2.com is blank.

I tried editing the /etc/hosts to set the two sites by adding myIPaddes site1.com and myIPaddress site2.com. For few minutes both sites were working but after logging in to my WP-admin, site2.com is REDIRECTED to site1.com.

But after few minutes, site2.com was now again not accessible. Sometimes, site1.com is NOT accessible but site2.com is accessible.

Please help. I don’t know what to do.

It may help if you could provide the output from each of the following commands:

cat /etc/hostname

…and…

cat /etc/hosts

cat /etc/hostname

ivote

cat /etc/hosts

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
127.0.1.1 ivote ivote
127.0.0.1 localhost
128.199.133.115 ivoteph.com
128.199.133.115 vintanews.com

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

What Linux Distro and version are you using?

Who is your host?

I used Ubuntu 14.04 x64 and the host is Digital Ocean.

I have not had this exact issue, though I have seen it pop up a few places, on the internet. I suspect it has to do with Cloud Managed Hosts, vs what I call Locally Managed Hosts (I.E. /etc/hostname and /etc/hosts) - in any event I think its related to how the initial configuration of new droplets is done.

Maybe I’m wrong, but there has been some conversation in your hosts Community Support Area about this (or a similar) issue. Check-out the conversation, here: http://bamajr.us/1ExQPsB

Let me know if the information found there, provides any resolution to your problem. If not, I’ll be happy to dig around some more.

I’ve tried the suggestions provided by the link, but I think I missed something. Can you please provide here the direct suggestion provided by them?

I don’t understand what they were talking about.

@proffsg I will try to clarify as best as I can.

From what I know of using Ubuntu 14.04 in the cloud, if manage_etc_hosts is true and you edit the /etc/hosts file, the hostname will be reset on VM reboot. I understand this happens because the VM is getting its configuration data via the cloud-init process. However, even if your VM hasn’t been rebooted, I suspect changes to /etc/hosts will not persist between reboots, based on how various processes may use the /etc/hosts file.

As indicated in the output of:

cat /etc/hosts

…you provided above, you can:

  1. Make changes to the master file in /etc/cloud/templates/hosts.tmpl (instead of /etc/hosts), or:

  2. Change the value of manage_etc_hosts in /etc/cloud/cloud.cfg or cloud-config from user-data, by changing:

    manage_etc_hosts: true

…to:

manage_etc_hosts: false

If the second option is chosen, you may also want to change the value of preserve_hostname in /etc/cloud/cloud.cfg by changing:

preserve_hostname: false

…to:

preserve_hostname: true

I did this but to no avail.

cat /etc/hosts

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
127.0.1.1 ivote ivote
127.0.0.1 localhost
128.199.133.115 ivoteph.com
128.199.133.115 vintanews.com

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

/etc/cloud/cloud.cfg

datasource_list: [ DigitalOcean, None ]
datasource:
 DigitalOcean:
   retries: 5
   timeout: 10

preserve_hostname: true
manage_etc_hosts: false

vendor_data:
   enabled: True

RESULT: site1.com is OK but site2.com is blank. Presently, vintanews.com (site2.com) is pointed to my IP address with ivote as hostname.

Later, I revert back site2.com (vintanews.com) to another IP address.

Maybe, I need to manually install SERVER BLOCKS and leave EasyEngine. I hate installing a lot of software unlike EasyEngine.

Quick question… Did you restart the web server after making these changes?

nginx -t && service nginx reload

Yes, I did.

Still vintanews.com is blank. Only ivoteph.com is accessible.

Before this post, the two websites (ivoteph.com and vintanews.com) are both now NOT accessible.

After few minutes, ivoteph.com is now accessible again.

Sorry @proffsg, I had work, away from my office and computer today.

I’m going to try and replicate this problem with my own VM. I’ll report back soon!

Hello;

did you fix this? am having same problem.