Apache results in Unavailable Service after installing Nginx and hhvm

Asked

Viewed 312 times

0

I installed the Nginx and the HHVM to test the language Hack. Everything perfect, I can program in Hack and PHP using that set.

However, in giving stop in the Nginx and HHVM and start in the Apache 2 he casts Erro 503 Service Unavailable.

In the error log. he launches 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 someone help me?

(Using Ubuntu 14.04)

EDIT: Log and settings as requested in questions: http://pastebin.com/L5LnHKHf

Startin' the 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 *

  • Open a terminal (CTRL+Alt+T) and type: netstat -tulpn | grep 9000 what appears on the screen?

  • When I’m with Nginx + hhvm: tcp6 0 0 :::9000 :::* LISTEN 3614/hhvm

  • When I start apache2 nothing appears

  • [PHP-FPM](sudo service php5-fpm Restart) is not running. Do the following and open the configuration file gedit /etc/php5/fpm/pool.d/www.conf, look for a line that starts with LISTEN and switch to listen = 127.0.0.1:9000. Hail. Then execute the command: sudo service php5-fpm restart. Now try to start Apache again.

  • Now you are not running Nginx either, nor open the page. in the error log this: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default~:21

  • My default configuration file is http://pastebin.com/zhFjEPzT

  • NOTE: I don’t have PHP-FPM installed, I didn’t have to run it before and after the installation, but now neither of the two Servers (apache giving the error informed and Nginx+hhvm does not start)

  • Oh yes, so disregard the above message and undo it. I’ll keep looking for something about.

  • @Raul3k, upload the Apache and Nginx configuration files, and the apache log that theoretically is access_log. I have some servers in production, including Ubuntu and Debian, with Nginx and apache. With the files I debug here for you. D

  • @Fernandocordeiro Thank you, the link with all the files is at the end of the question, thank you.

Show 5 more comments

2 answers

1

Raul, duplicate default server means your configuration file is bugged.

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

Taking the cue: who’s using the door 9000 is HHVM, not PHP-FPM. This error.log is not from Nginx? Has the error_log apache?

Attach the Apache configuration file, and confirm if you comment or remove this entry resolves the `Duplicate default server (I’m not sure if it connects ipv6 using only the port):

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

If it does not resolve, check whether the /etc/nginx/nginx.conf has an entrance server { (...) } with the listen (...) default_server. If there is, there is your mistake. He tries to link the name defauult_server to two server {} different.

  • Hello, while commenting on nothing, so I also commented on the line: listen 80 default_server; and ran Nginx. So I tried to change the port to 8090 and now Nginx is attached to port 80 and port 8090. listen 8090 default_server;
 #listen [::]:80 default_server ipv6only=on;

  • Remove both listen disables the entire block, so this indicates that there must be a block server in the /etc/nginx/nginx.conf using a listen with default_server. I suggest removing from the nginx.conf and leave the configuration on sites-enabled/default, no matter what code you put there.

  • Hello, this is my sites-enabled/default, it is the only file that has the block "server", note that I removed all the 'Listen': http://pastebin.com/WCJL4LvP

  • And the hhvm.conf? If he has a "Isten" that could be the reason. The configuration files of Nginx and apache sometimes become quite chaotic, the secret is to understand the hierarchy and investigate what is occurring. Each include means another file to investigate, and a good first step is to understand the "standard" way of working with the files to avoid this kind of confusion. That’s why I wanted to see the set of files, and help organize, in order to make it clearer how the main commands work. : D

  • Just score, in your specific case, the listen is what defines that block server will respond to the browser. So simply remove is not the solution. We need to understand why it gave the error, for the configuration to work.

  • In the question is the link with all conf files. hhvm.conf is this: http://pastebin.com/s0hVAnFr I didn’t find any Systems in it rsrs For me it was more organized than in previous versions rs

  • I don’t know if it’s relevant but: PORT STATE SERVICE
80/tcp open http
139/tcp open netbios-ssn
445/tcp open microsoft-ds
631/tcp open ipp
3306/tcp open mysql
5432/tcp open postgresql
9000/tcp open cslistener

  • Check in the folder /etc/nginx/conf.d there is some file. I suggest going back to Listen without the default_server can fix it. By apache error and by configuration file I imagine there is an apache conf file in sites-enabled/ (Inside the apache folder) with configuration, and possibly one or more files in mods-enabled/. Any of these files say that "php" goes to port 9000. But how did you give stop in the hhvm the apache goes unanswered.

  • In /etc/nginx/conf.d there is no file. In sites-enabled has a file yes, its contents are here: http://pastebin.com/ZeT336c5 . In mods-enabled has a lot of files, http://pastebin.com/VVcNjqja

  • Speaking on port 9000 found 2 files: /etc/nginx/hhvm.conf content: http://pastebin.com/s0hVAnFr and on /etc/apache2/mods-enabled\hhvm_proxy_fcgi.conf Contents: http://pastebin.com/AgskNrgc

  • Now Apache displays the media 404 File Not Found when I try to access it (127.0.0.1) while hhvm is enabled.

  • @Raul3k, the hhvm_proxy_fcgi.conf assumes that the Site is on /var/www. Apache configuration points to which folder? (apache/sites-enabled/*.conf) It’s the right paste?

  • When I turn on the Nginx it goes to /usr/share/nginx/html, works normally php and hack in this folder. In Apache2 should be pointing to /var/www/web 
dev1@dev1-MS-7636:/etc/apache2$ grep -ri /var/www/web *
sites-available/000-default.conf: DocumentRoot /var/www/web. Well, I don’t know where else he’d be pointing but to this.

  • On Nginx-enabled websites I left only listen 8095;, theoretically he should only listen to 8095 and not to 80, right? If yes, he’s listening to both of them yet.

Show 10 more comments

0


After much research and with the help of the staff here I finally managed to reach a solution.

When installing HHVM it has already configured Nginx and apache, but I didn’t 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 play a static file on /var/www/web and test, something like 127.0.0.1/.txt file

Then an idea came to me that I hadn’t thought of before: to see if there is a directory /etc/hhvm, and has.

Inside this directory has the file server.ini. Inside this file I discovered why to give communication error in 127.0.0.1:9000 in the following line: hhvm.server.port = 9000

So I went on /etc/apache2/mods-enabled/hhvm_proxy_fcgi.conf that 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 I start apache2 I am able to work with php5 that I installed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.