Webinoly is just the perfect tool for NGINX experts. Give it a try!
0 votes
6.1k views
by
Getting a 502

PHP, NGINX, MariaDB, Redis, all services running fine.

When I run

sudo site an-example-domain.com -wp -cache

It tells me everything is installed and working fine. I can see the site structure.

But getting the error.

Pity really, I am writing a blog post for the Alibaba Tech Share Cloud blog, doing a comparison with EasyEngine, but if I can't get it working I won't be able to finish the article

Cheers
by

Me again -

Webinoly -info output:

[SYSTEM]
sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
Operating System: Linux version 4.4.0-62-generic (buildd@lcy01-30) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017
sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
Description:    Ubuntu 16.04.3 LTS
sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
Codename:    xenial
Cores: 1
RAM: 1016096kb
SWAP: 1048572kb
sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
File descriptors: 304828

[Disk Usage]
sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/vda1      ext4   40G  3.4G   34G  10% /

[NGINX]
sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
nginx version: nginx/1.12.1
Nginx file descriptors: 198138
worker_processes: auto
worker_connections: 8192
worker_rlimit_nofile: 198138
client_max_body_size: 100m

[CACHE]
FastCGI 200: 30d
FastCGI 3xx/4xx: 1m
FastCGI inactive: 7d
FastCGI max-size: 193m
open_file_cache_valid: 3m
open_file_cache max: 66046
open_file_cache inactive: 5m

[PHP]
PHP 7.2.0-2+ubuntu16.04.1+deb.sury.org+2 (cli) (built: Dec 7 2017 20:14:31) ( NTS )
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
memory_limit:
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
post_max_size:
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
upload_max_filesize:
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
max_file_uploads:
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
max_execution_time:

[MYSQL]
sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
mysql  Ver 15.1 Distrib 10.2.11-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
PhpMyAdmin: true

[Raw Conf]
sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
tools-port:22222
app-version:1.2.0
pre-packs:true
nginx:true
swap-owner:webinoly
linux-optim:true
server-version:1.0
nginx-optim:true
nginx-tool:true
php-ver:7.1
php:true
php-optim:true
web-tool:true
php-tool:true
mysql-client:true
mysql-root:WVpLbzByQk0K
mysql-admin:d2VRUzQ1Q0EK
mysql:true
mysql-tool:true

Webinoly -verify output:

root@iZ0xi9cnxne0wxs16l1l4aZ:~# webinoly -verify
 Verifying integrity of the entire Webinoly system...

[WARNING] File: /etc/nginx/.htpasswd not found!
[ERROR] File: /etc/php/7.1/fpm/php.ini not found!
[ERROR] File: /etc/php/7.1/fpm/php-fpm.conf not found!
[ERROR] File: /etc/php/7.1/fpm/pool.d/debug.conf not found!
[ERROR] File: /etc/php/7.1/fpm/pool.d/www.conf not found!

*******************************************************
********      > > >  E R R O R < < <        ***********
********   System could not work properly   ***********
*******************************************************

It looks like the same problem as here:
https://webinoly.com/support/23/linode-vps-installation-failed

But the answer there:
 

Two packages was missing in Linode Ubuntu distribution.

sudo apt-get install software-properties-common python-software-properties

It was causing issues when Webinoly try to install PHP.

Is not the case with me:

<code>

root@iZ0xi9cnxne0wxs16l1l4aZ:~# apt-get install software-properties-common python-software-properties
Reading package lists... Done
Building dependency tree
Reading state information... Done
software-properties-common is already the newest version (0.96.20.7).
python-software-properties is already the newest version (0.96.20.7).
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
root@iZ0xi9cnxne0wxs16l1l4aZ:~#
<code>

by

So...

since php7.1-fpm isn't being installed, I decided to install it by hand.

now when i run

webinoly -verify

I only get one error:

root@iZ0xi9cnxne0wxs16l1l4aZ:/etc/php/7.1# webinoly -verify
 Verifying integrity of the entire Webinoly system...

[WARNING] File: /etc/nginx/.htpasswd not found!
[ERROR] File: /etc/php/7.1/fpm/pool.d/debug.conf not found!

*******************************************************
********      > > >  E R R O R < < <        ***********
********   System could not work properly   ***********
*******************************************************
root@iZ0xi9cnxne0wxs16l1l4aZ:/etc/php/7.1#

What is in the debug.conf file? Can I add it by hand?

Cheers

Jeff 

by
I can put off the article for a couple of days, in the hope of debugging this.

3 Answers

0 votes
by Expert

Hi Jeff,

I have no experience using Alibaba Cloud, but it seems like you are having an issue with the Ubuntu Image they are using.

sudo: unable to resolve host iZ0xi9cnxne0wxs16l1l4aZ
This is a known error when /etc/hosts is misconfigured.
That's why Webinoly is not running properly.

Can you please check the content of /etc/hosts and see if your hostname is in there?

by
HI there,

Thanks for the assist, will do and let you know
by Expert
Also, please check the content of /etc/hostname
by
etc/host

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1 localhost
172.22.209.145 iZ0xi9cnxne0wxs16l1l4aZ

(172.22.209.145 is the private IP address)

etc/hostname

iZ0xi9cnxne0wxs16l1l4aZ
by Expert

Definitely, this is an error related to your host and network configuration, seems like you are running only with ipv6 capabilities but I don't really know how alibaba its supposed to work.

Please, try to fix it before install Webinoly.

Check this thread: https://github.com/Microsoft/WSL/issues/491

by
So I changed the hostname at the provider, from the crazy string to:

webinoly

Anyway, reloaded everything from scratch, same problem persists:

root@webinoly:~# webinoly -info

Operating System: Linux version 4.4.0-62-generic (buildd@lcy01-30) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017

Description: Ubuntu 16.04.3 LTS

Codename: xenial

Cores: 1

RAM: 1016096kb

SWAP: 1048572kb

File descriptors: 304828

[Disk Usage]

Filesystem     Type  Size  Used Avail Use% Mounted on

/dev/vda1      ext4   40G  3.4G   34G  10% /

[NGINX]
nginx version: nginx/1.12.1
Nginx file descriptors: 198138
worker_processes: auto
worker_connections: 8192
worker_rlimit_nofile: 198138
client_max_body_size: 100m

[CACHE]
FastCGI 200: 30d
FastCGI 3xx/4xx: 1m
FastCGI inactive: 7d
FastCGI max-size: 193m
open_file_cache_valid: 3m
open_file_cache max: 66046
open_file_cache inactive: 5m

[PHP]
PHP 7.2.0-2+ubuntu16.04.1+deb.sury.org+2 (cli) (built: Dec 7 2017 20:14:31) ( NTS )
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
memory_limit:
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
post_max_size:
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
upload_max_filesize:
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
max_file_uploads:
grep: /etc/php/7.1/fpm/php.ini: No such file or directory
max_execution_time:

[MYSQL]
mysql  Ver 15.1 Distrib 10.2.11-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
PhpMyAdmin: true

[Raw Conf]
tools-port:22222
app-version:1.2.0
pre-packs:true
nginx:true
swap-owner:webinoly
linux-optim:true
server-version:1.0
nginx-optim:true
nginx-tool:true
php-ver:7.1
php:true
php-optim:true
web-tool:true
php-tool:true
mysql-client:true
mysql-root:Y3ltUThFU3kK
mysql-admin:WmZra1VUMzgK
mysql:true
mysql-tool:true
 

root@webinoly:~# webinoly -verify
 Verifying integrity of the entire Webinoly system...

[WARNING] File: /etc/nginx/.htpasswd not found!
[ERROR] File: /etc/php/7.1/fpm/php.ini not found!
[ERROR] File: /etc/php/7.1/fpm/php-fpm.conf not found!
[ERROR] File: /etc/php/7.1/fpm/pool.d/debug.conf not found!
[ERROR] File: /etc/php/7.1/fpm/pool.d/www.conf not found!

*******************************************************
********      > > >  E R R O R < < <        ***********
********   System could not work properly   ***********
*******************************************************
by Expert

Ok, that's fine.

Its just Webinoly that was installed with errors before.

Please, uninstall the stack:

sudo stack -purge-server-all

and then re-install everything again:

sudo stack -lemp

by
Now we are getting somewhere.... :)

root@webinoly:~# webinoly -verify
 Verifying integrity of the entire Webinoly system...

[WARNING] File: /etc/nginx/.htpasswd not found!

***********************************************************************************************************
********      [ W A R N I N G ] System seems to be corrupted and could not work properly        ***********
***********************************************************************************************************
by Expert
Everything should be working fine now.

Crete a site and then add an httpauth user to remove that warning. :)
by
You beauty

Okay, site install worked now, I have the 5 minute installation.

There is still that Error, but I don't know if it means anything.

Assuming all goes well, need to wipe it all down and start from scratch to get pristine screenshots, I will get this article done, and let you guys know when it goes live!

Much appreciated

Jeff
by Expert

That error (Warning) means that you don't have http authentication credentials needed to access admin sections.

sudo httpauth -add

The "unable to resolve host" issues should be addressed to Alibaba Cloud Support, that's not a normal behavior, something should be missed in your network configuration.

Please Jeff, don't hesitate to ask any questions.

Regards.

by Expert

Just one more suggestion.

For the article purpose, it might be better if you use the "-wp=default" option to avoid the questions about DB data during installation process.

sudo site an-example-domain.com -wp=default -cache

by

Hey again.

First regarding using:

sudo site an-example-domain.com -wp=default -cache

I did originally try that, but I get this error:

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-example-domain_com' at line 1
============================================
    [Error]: Database creation failed.
===========================================

It is wanting to use my domain name as the database name, but 'an-example-domain.com' (my testing domain) doesn't play nice.

In the final article I will just say use this, since most of the other readers likely won't have a problem. I will add a note that my specific domain had an issue.


Secondly... Bad News and Good news - Yesterdays error persists, but so does the solution

If I try to use:

wget -qO weby qrok.es/wy && sudo bash weby 3 

or

wget -qO weby qrok.es/wy && sudo bash weby 0

sudo stack -lemp

I get:

root@webinoly:~# webinoly -verify
 Verifying integrity of the entire Webinoly system...

[WARNING] File: /etc/nginx/.htpasswd not found!
[ERROR] File: /etc/php/7.1/fpm/php.ini not found!
[ERROR] File: /etc/php/7.1/fpm/php-fpm.conf not found!
[ERROR] File: /etc/php/7.1/fpm/pool.d/debug.conf not found!
[ERROR] File: /etc/php/7.1/fpm/pool.d/www.conf not found!

*******************************************************
********      > > >  E R R O R < < <        ***********
********   System could not work properly   ***********
*******************************************************

But if I then:

sudo stack -purge-server-all

And then reinstall the LEMP stack with:

sudo stack -lemp

The errors go away and I'm left with the warning:

root@webinoly:~# webinoly -verify
 Verifying integrity of the entire Webinoly system...

[WARNING] File: /etc/nginx/.htpasswd not found!

***********************************************************************************************************
********      [ W A R N I N G ] System seems to be corrupted and could not work properly        ***********
***********************************************************************************************************

So I can install my sites, and apply your fix for this warning.

But it seems a little weird, no?


The article they have asked for needs to be written as the situation stands. I am going to write it purely as showing how to get these things up and running.

I have done articles about setting up an LEMP stack component by component, so webinoly is still a lot easier than that. 

With regards to both Webinoly and EasyEngine, neither of the Lets Encrypt installations are working with Alibaba. This has also been true of testing with RunClouds Lets Encrypt.

In both articles I am having to install Cerbot from:

add-apt-repository ppa:certbot/certbot

Then configure the cron jobs manually.


Regarding getting things working together, I am writing these tutorials because I was originally asked to contribute to their knowledge base re WordPress by one of their 'Cloud architects' whilst I was sorting out a China facing site. They seemed keen and open, so if one of the Devs of Webinoly is interested I can facilitate opening a dialogue with their tech staff?

Jeff

0 votes
by

Yeb, i have same error 502 with Webinoly v1.2.0

With v1.1.0 all work perfectly

I try Vultr, Google Cloud all same error 502

And i see it say "Apache2 Ubuntu Default Page"

by

When I follow Jeff

sudo stack -purge-server-all

And then reinstall the LEMP stack with:

sudo stack -lemp

I works 

by

Hmm, maybe sudo stack -lemp
is v1.1.0 because I see it  /etc/php/7.1/fpm/php.ini

by Expert
Do you guys can confirm if you are seeing some errors during the initial installation process?
by

Yeb, i try 

wget -qO weby qrok.es/wy && sudo bash weby 3

and

site mydomain.com -wp

It error 502

by
with v1.1.0 all work perfectly

Only see in v1.2.0
by
This log:

root@bibica-review-webinoly:~# sudo log -error
==> /var/log/nginx/22222.error.log <==

==> /var/log/nginx/error.log <==
2018/01/05 15:12:10 [notice] 4029#4029: signal process started
2018/01/05 15:14:34 [notice] 6324#6324: signal process started
2018/01/05 15:14:34 [notice] 6353#6353: signal process started
2018/01/05 15:21:15 [notice] 31970#31970: signal process started
2018/01/05 15:21:40 [notice] 32059#32059: signal process started

==> /var/log/nginx/webinoly.bibica.review.error.log <==
2018/01/05 15:21:57 [error] 32061#32061: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 1.54.28.72, server: webinoly.bibica.review, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "webinoly.bibica.review"
by Expert
We finally reproduce and fix this Issue.

Webinoly v1.2.1 has been released and everything must work just fine.

It was just a small bug affecting fresh installs causing PHP failing during first install.

Please, try this new version.

Sorry for the inconvenience.
by
How to fixed it?
 

Yeb, i love Webinoly, i better
by Expert

This issue was just affecting Fresh Installs, so if you have a new instance/server now you gonna get the new version.

If you have an older installation (specially v1.2.0), just update webinoly:

sudo webinoly -update

by
OK, waiting

Im re setup new VPS and test again :(
0 votes
by Expert
We finally reproduce and fix this Issue.

Webinoly v1.2.1 has been released and everything must work just fine.

It was just a small bug affecting fresh installs causing PHP failing during first install.

Please, try this new version.

Sorry for the inconvenience.
by
Hi again,

re the htpsswd:

Sure I appreciate the security and do it with some of my sites. But I wasn't sure if this user and password was supposed to be created during the initial site setup automatically.

I will just be adding it as a step and including some bumph about the security benefits etc etc

re the SSL:

I see. I actually didn't try it separately (subsequently), I did with EasyEngine but it still didn't work, I will spin up the server again and check to see if it works.

Jeff
by

I agree with Jeff about the htpsswdI have written a tutorial to install Webinoly

1.  wget -qO weby qrok.es/wy && sudo bash weby 3

2. httpauth -wp-admin-off <--- yes, it step 2 :D

3. site webinoly.bibica.review -wp

4. site webinoly.bibica.review -ssl-on

It all :P

by Expert

Hi bibica,

You still need it to access tools like PhpMyAdmin and all the other things in yourdomain.com:22222

by

The password generated by webinoly is hard to remember, when i need to access tools, i type 

sudo httpauth -add :D 

It is easier to remember and more effective

by Expert

Hi bibica,

That difficult password are for MySQL users (admin, root, etc), the HTTPAUTH user and password is for HTTP Authentication.

MySQL users are needed for setup your WP site to access your DB (Webinoly does it automatically), for instance. HTTP Authentication is needed for that sections or pages that are protected and your browser ask you to enter a user and password.

Example:

Go to:

yourdomain.com:22222/pma

First, your browser will ask you for http authentication, then you will need your mysql user "admin" to access PMA.

Welcome to the Community site for Webinoly.

Our Optimized LEMP Web Server is a powerful set of commands for doing just about anything you could wish.

With Webinoly you can set up your NGINX web server in just one step.

* * * * * * *

To report a bug, please create a new issue on GitHub or ask a question here with the bug tag.
Webinoly Support Paypal Donations

PayPal · GitHub Sponsors · Bitcoin

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...