Reverse-proxy NGINX + Apache on Directadmin powered server with CB 2.x

That must be an improper configuration. Please PM me logins to your server, if you'd like me to fix it for free.
 
So you didn't suddenly "run" into the 502 bad gateway error but the server never worked in the first place? ;)
 
directory does not exists.

I tried to get php-fpm working by running a custombuild, but stumbled upon 'php-fpm' is not supported with the nginx_apache webserver. Use mod_php instead.

I had no problems converting the box to use nginx_apache. It might be that "./build rewrite_confs" command wasn't executed after "./build nginx_apache".
 
How fix?

Stopping nginx: nginx: [error] invalid PID number "" in "/var/run/nginx.pid"

Thank you.
 
on my website

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

fixed with ./build rewrite_confs
 
Last edited:
Also get this error on websites when install nginx

Warning: session_start(): open(/tmp/sess_3cs8osh7p5olg781mavh7mdch3, O_RDWR) failed: Permission denied (13)

fixed remove all /tmp files started with sess_
 
Last edited:
Hello,

To set it back to apache:

Code:
./build update
./build set webserver apache
./build apache
./build rewrite_confs
 
thanks !

Hi Martinas,
my 1st post is for you, its great, thanks a lot :)
Incredible tips for non power users :)
 
Hi, why the http headers said "apache/2" for serving the content ?

Code:
HTTP/1.1 200 OK
Date: Wed, 07 Jan 2015 10:11:25 GMT
Server: Apache/2
X-Powered-By: PHP/5.3.28
Set-Cookie: bb_lastvisit=1420625485; expires=Thu, 07-Jan-2016 10:11:25 GMT; path=/
Set-Cookie: bb_lastactivity=0; expires=Thu, 07-Jan-2016 10:11:25 GMT; path=/
Set-Cookie: PHPSESSID=4453835d753c6939b572452d00638985; path=/
Cache-Control: max-age=0, no-cache
Pragma: private
X-UA-Compatible: IE=Edge
Set-Cookie: bb_pl_ismobile=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/
X-Mod-Pagespeed: 1.6.29.7-3566
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 27092
Content-Type: text/html; charset=ISO-8859-1
 
When running nginx+apache combination, PHP is served by Apache, and static content is served by Nginx.
 
Hi, why the http headers said "apache/2" for serving the content ?

Hello,

You seem to still run Apache on 80 port.

Did you run

Code:
./build nginx_apache
./build rewrite_confs

If not then try it again? Do you have custom apache templates in /usr/local/directadmin/data/templates/custom/?
 
hi all,
when I try to know the Custom Build version, there is the answer :
./build version
1.2.41

It should be the problem ?

Thanks !
 
Hi all,
sorry for my bad english, i think I've a big mistake... :(
I've tried to update my custombuil from 1.x to 2.0 using this tutorial : http://help.directadmin.com/item.php?id=555
I had APC installed before update, and modpagespeed.
When everything was ok and the service rebooted, impossible to access website where APC is activated, so, I try to put the original custombuild, and now, HTTPD cant start, with this start error :

PHP:
service httpd start
Starting httpd: Syntax error on line 39 of /etc/httpd/conf/extra/httpd-mpm.conf:
Invalid command 'MaxRequestWorkers', perhaps misspelled or defined by a module not included in the server configuration

All my websites are down :(
Anyone can help me please :(

Regards.
Charles, France.
 
after many operations, i have successfully came back with a fresh install of custombuild 1.2 ...
Its too dangerous to make this an update like this for a beginner like me :)
I'm a webmarketer :D :D :D

Thansk to all, have a good day !!!
 
Good to know you've managed to bring the things back to normal operating. I'm ready to help you with migrating to CB 2.0, feel free to contact me.
 
I'm configuring a new server wanted to use nginx. Setup:
KVM VPS
Centos 7
DA
After standard DA setup I ran the instructions to install nginx from zEitEr in post #1. All went well and the first test site is working fine besides 2 strange things that I will try to work out myself before asking here.

The only thing that I can't get to work is opcache.

I enabled in /usr/local/php56/lib/php.ini (there is a whole [opcache] segment)
opcache.enable=On
opcache.enable_cli=On

and added:
zend_extension=/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/opcache.so

But no luck! "The Zend OPcache extension does not appear to be installed"

Do I need to "./configure" something? If so will it break my nginx setup?
What is the appropriate ./configure sequence?

Or is there a simpler way?

Never mind!! A server reboot did the trick. I thought restarting httpd was enough!
 
Last edited:
Or is there a simpler way?

Never mind!! A server reboot did the trick. I thought restarting httpd was enough!

Custombuild supports opcache:

Code:
cd /usr/local/directadmin/custombuild
./build update
./build set opcache yes
./build php n

and if you run PHP-FPM you should restart PHP-FPM daemon, server reboot was not nesessary to do.
 
Back
Top