Apache results in Service Unavailable after installing nginx and hhvm

0

I have installed Nginx and HHVM to test the Hack language. All perfect, I can program in Hack and PHP using this set.

However, by giving stop in Nginx and HHVM and start in Apache 2 it throws Erro 503 Service Unavailable .

In error.log it throws this:

  

[Fri Mar 27 16: 29: 42.300830 2015] [proxy: error] [pid 26561]   (111) Connection refused: AH00957: FCGI: attempt to connect to   127.0.0.1:9000 (*) failed [Fri Mar 27 16: 29: 42.300853 2015] [proxy_fcgi: error] [pid 26561] [client 127.0.0.1:58766] AH01079:   failed to make connection to backend: 127.0.0.1

Can anyone help me?

(Using Ubuntu 14.04)

EDIT: Log and settings as requested in the questions: link

When starting apache : / var / log / apache2 $ sudo service apache2 start  * Starting web server apache2 AH00558: Apache2: Could not reliably determine the server's fully-qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message  *

    
asked by anonymous 27.03.2015 / 20:38

2 answers

0

After a lot of research and with the help of the staff here I finally managed to come up with a solution.

When installing HHVM it has already configured nginx and apache, but I did not want apache working with hhvm since it is already loading a PHP module.

Fernando Cordeiro told me the following:

  

Now I would first of all throw a static file into / var / www / web and test it, something like 127.0.0.1/file.txt

So I came up with an idea that I had not thought of before: see if the / etc / hhvm directory exists, and it has.

Within this directory you have the file server.ini . Within this file I discovered why to give communication error in 127.0.0.1:9000 on the following line: hhvm.server.port = 9000

Then I was in /etc/apache2/mods-enabled/hhvm_proxy_fcgi.conf which has a single line:

ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/$1

What I did was just comment on that line.

Now when I start nginx I work with php + hack, when starto apache2 I am able to work with php5 that I installed.

    
31.03.2015 / 21:20
1

Raul, duplicate default server means that your configuration file is buggy.

About the confusion, put the settings of both servers to check.

Taking advantage of the cue: who is using the 9000 port is HHVM, not PHP-FPM. This error.log is not nginx? Has error_log of Apache?

Append the Apache configuration file, and confirm that commenting or removing this entry resolves the 'duplicate default server' (not sure if it binds ipv6 using only the port):

    listen [::]:80 default_server ipv6only=on;

If it does not resolve, check that /etc/nginx/nginx.conf has a server { (...) } entry with listen (...) default_server . If there is, there is your mistake. It tries to bind the name defauult_server to two server {} different.

    
28.03.2015 / 08:37