Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Nginx+Apache2

Got problems with your B2 or B3? Share and get helped!
toukie
Posts: 115
Joined: 13 Jan 2012, 12:22

Re: Nginx+Apache2

Post by toukie »

The thing is that I can't get http://b3.local/admin att all but I can get https://b3.local/admin anytime.
Gordon
Posts: 1470
Joined: 10 Aug 2011, 03:18

Re: Nginx+Apache2

Post by Gordon »

Okay...

Let's try get back to basics first then. Create a file 'info.php' in /home/web and add the following content:

Code: Select all

<? phpinfo(); ?>
Now enter the address http://b3.local/info.php in your browser. What do you see?

And if you see an error than you should really start with stopping Nginx and fix what you changed in the Apache configuration. Get everything the way it was and start working from there.
toukie
Posts: 115
Joined: 13 Jan 2012, 12:22

Re: Nginx+Apache2

Post by toukie »

What I see is 404 not found.
I know how it looks like when it works.
Last edited by toukie on 26 Apr 2013, 13:23, edited 2 times in total.
toukie
Posts: 115
Joined: 13 Jan 2012, 12:22

Re: Nginx+Apache2

Post by toukie »

When I do the same with https://b3.local/info.php I see the whole page. Apache2 is there and nginx is there and I am on Virtual Server according to "Configuration, apache2handler" in info.php

My second domain seems to be back too, right now it doesn't complain about redirects or 404 or 503 or 502.

I would like to know why my /home/web has become ssl-only, it has got there on its own somehow. The other domain I put in /home/www, it doesn't behave the same way.

I have them on two separate ports, I don't use 8080.
Gordon
Posts: 1470
Joined: 10 Aug 2011, 03:18

Re: Nginx+Apache2

Post by Gordon »

If your other domain can be accessed, you should be able to open /admin on that domain too. That is because the admin page is a global definition. As far as /home/web not working is concerned this may be related to a misconfiguration of the Listen directive and the VirtualHost port definition. That's what I've been trying to tell you: Excito wants apache on port 80. You're messing with their system setup and in my opinion it's not fair from you to expect them to consider the fact that you want their system management tool to listen on a different port so that you can proxy towards it. I told you a way to work around the issue, and there's probably a million other ways to do it as well, but if you insist on following the path you originally started I really can't be of much assistance.
toukie
Posts: 115
Joined: 13 Jan 2012, 12:22

Re: Nginx+Apache2

Post by toukie »

Quite right! From the other domain I can get B3 admin.

If the risk is the downloads from Excito, one could change the configuration before an upgrade, they don't come every other day. Would that not be possible?

I was doing the workaround but got the errors I named.

I'm new to these things which can complicate the process in some degree.

It was good to get the information about the risk! It would be sad with such a crash.
Gordon
Posts: 1470
Joined: 10 Aug 2011, 03:18

Re: Nginx+Apache2

Post by Gordon »

Misunderstood.

It's not that whatever you change now that will prevent updates, but updates that will undo everything you change this moment and by doing so will either kill your access to /admin like it does now, or kill apache completely. What the exact effects will be is hard to predict at this moment because I do not know what changes are enforced, but I do know for a fact that /etc/apache2/sites-available/bubba, /etc/apache2/sites-enabled/bubba and /etc/apache2/conf.d/admin.conf are maintained by the bubba-frontend package. Whether this package also controls the content of ports.conf I do not know, but why risk breaking any part of it if you can avoid it? Like I said before: you're bound to remember what you did tomorrow and be able to repair it, but will that still be true if it breaks next year?

In any case: if you're content with the operation of your second site, I'd suggest you redo what you did for that site to create a third site that also uses /home/web as its root and accept the 404 error on bubba's default site definition as a gift.
toukie
Posts: 115
Joined: 13 Jan 2012, 12:22

Re: Nginx+Apache2

Post by toukie »

I finally got it working:

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443 127.0.0.1 (/etc/apache2/sites-enabled/bubba:1)
*:80 is a NameVirtualHost
default server 127.0.0.1 (/etc/apache2/sites-enabled/bubba:44)
port 80 namevhost 127.0.0.1 (/etc/apache2/sites-enabled/bubba:44)
port 80 namevhost my_second_site.com (/etc/apache2/sites-enabled/that_site:3)
port 80 namevhost my_b3_site.myownb3.com (/etc/apache2/sites-enabled/some_name:1)
port 80 namevhost 127.0.0.1 (/etc/apache2/sites-enabled/xwz:1)
Syntax OK

With Firebug I can see that nginx serves static files and passes the rest to Apache2. I use two instances of Word Press and I get everything else in /home/web too. Is there possibly something wrong with the configuration? It works anyway.

I get the B3 admin page for each site but I would like to know how to get rid of it where I don't want to have it.
toukie
Posts: 115
Joined: 13 Jan 2012, 12:22

Re: Nginx+Apache2

Post by toukie »

Gordon wrote: ...In any case: if you're content with the operation of your second site, I'd suggest you redo what you did for that site to create a third site that also uses /home/web as its root and accept the 404 error on bubba's default site definition as a gift.
There are only two at the moment but I might add one more , both the easyfind address and the new domain are virtual hosts and they use /home/web. Bubba file in /etc/apache2/sites-enabled has not been touched, I only added my own files to the same place. My second site has Page Speed Score 100/100, the easyfind address has 92/100.

I used these instructions as basis: http://www.dikant.de/2008/07/10/nginx-a ... or-apache/

Newer versions of nginx one can get from: http://www.dotdeb.org/

netstat -tulpn | grep :80
tcp 0 0 my_external_static_ip:80 0.0.0.0:* LISTEN 6508/nginx
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1308/apache2

My /etc/apache2/ports.conf has:

NameVirtualHost *:80
Listen 127.0.0.1:80

<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>
toukie
Posts: 115
Joined: 13 Jan 2012, 12:22

Re: Nginx+Apache2

Post by toukie »

A still better setup is NVA - nginx varnish apache. It is very easy to add varnish, proxy_pass address in /etc/nginx/sites-enabled changes to http://127.0.0.1:6081; that's about all.

The command for to watch varnish working live is: varnishlog

http://www.linuxpinguin.de/2011/09/nva- ... sh-apache/
Post Reply