Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

only nginx?

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
17 posts
  • Previous
  • 1
  • 2
ken
Posts: 15
Joined: Fri Feb 28, 2014 5:20 am

Re: only nginx?
  • Quote

Post by ken » Fri Mar 14, 2014 1:09 am

ninja0n3 wrote:While I think Vesta is a nice piece of software, waiting until June for the next version is a bit too much and I'm too impatient...

For those still interested, I've managed to get Nginx running on its own with php-fpm by replacing the vesta template files for nginx config files - now instead of running as proxy, it will run as the main server.
For more information on installing php-fpm, please refer to: https://www.digitalocean.com/community/ ... n-centos-6

You can have those files here along with the installation instructions: https://github.com/autronix/Vesta-0.9.8-with-nginx-only

Please note that the next update may break those files.

Hope this helps.
It's nice that Vesta is non-invasive like that so you can make such changes. Thanks for the contribution.
Top

ninja0n3
Posts: 4
Joined: Wed Mar 12, 2014 2:15 pm

Re: only nginx?
  • Quote

Post by ninja0n3 » Sun Mar 16, 2014 11:21 pm

As a word of caution, I would advise those who go the nginx + php-fpm route to modify their /etc/php-fpm.d/www.conf to the following (or change permissions accordingly):

Code: Select all

#php_value[session.save_path] = /var/lib/php/session
php_value[session.save_path] = /tmp
This seemed to prevent php sessions from being established.

Finally, as an added bonus, here is the config file for phpMyAdmin and phpPgAdmin (if you want to use postgresql) - in /etc/nginx/conf.d/your_server_ip.conf put the following:

Code: Select all

server {
        listen   xxx.yyy.zzz.aaa:80;
        server_name  _;
        error_log  /var/log/nginx/error.log error;

                location /phpMyAdmin {
                root /usr/share/;
                index index.php index.html index.htm;
                location ~ ^/phpMyAdmin/(.+\.php)$ {
                        try_files $uri =404;
                        root /usr/share/;
                        fastcgi_pass 127.0.0.1:9000;
                        fastcgi_index index.php;
                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                        include /etc/nginx/fastcgi_params;
                }
                location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                        root /usr/share/;
                }
        }
        location /phpmyadmin {
                rewrite ^/* /phpMyAdmin last;
        }

        location /phpPgAdmin {
                root /usr/share/;
                index index.php index.html index.htm;
                location ~ ^/phpPgAdmin/(.+\.php)$ {
                        try_files $uri =404;
                        root /usr/share/;
                        fastcgi_pass 127.0.0.1:9000;
                        fastcgi_index index.php;
                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                        include /etc/nginx/fastcgi_params;
                }
                location ~* ^/phpPgAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                        root /usr/share/;
                }
        }
        location /phppgadmin {
                rewrite ^/* /phpPgAdmin last;
        }

        location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|css|zip|tgz|gz|rar|bz2|exe|pdf|doc|xls|ppt|txt|odt|ods|odp|odf|tar|bmp|rtf|js|mp3|avi|mpeg|flv|html|htm)$ {
                root           /var/www/html;
                access_log     /var/log/nginx/access.log combined;
                access_log     /var/log/nginx/access.bytes bytes;
                expires        max;
                #try_files      $uri;
        }

        location ~ \.php$ {
                root           /var/www/html;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }

        location ~ /\.ht    {return 404;}
        location ~ /\.svn/  {return 404;}
        location ~ /\.git/  {return 404;}
        location ~ /\.hg/   {return 404;}
        location ~ /\.bzr/  {return 404;}
}
Hope this helps save a bit of trouble to those who are trying to use this method.

I have also managed to get Rails working with nginx+puma, if anyone wants more details, let me know.
Top

VestaLover
Posts: 36
Joined: Thu Dec 05, 2013 10:55 am

Re: only nginx?
  • Quote

Post by VestaLover » Mon Mar 17, 2014 12:55 am

ninja0n3 wrote:While I think Vesta is a nice piece of software, waiting until June for the next version is a bit too much and I'm too impatient...

For those still interested, I've managed to get Nginx running on its own with php-fpm by replacing the vesta template files for nginx config files - now instead of running as proxy, it will run as the main server.
For more information on installing php-fpm, please refer to: https://www.digitalocean.com/community/ ... n-centos-6

You can have those files here along with the installation instructions: https://github.com/autronix/Vesta-0.9.8-with-nginx-only

Please note that the next update may break those files.

Hope this helps.
Totally agree on that. VestaCP has bright future here. Long live Open Source Control Panel :p
Anyway, Your NGINX hacks is a good alternative.
Top

iraton
Posts: 8
Joined: Thu May 22, 2014 7:51 pm

Re: only nginx?
  • Quote

Post by iraton » Thu May 22, 2014 8:20 pm

ninja0n3 wrote:While I think Vesta is a nice piece of software, waiting until June for the next version is a bit too much and I'm too impatient...

For those still interested, I've managed to get Nginx running on its own with php-fpm by replacing the vesta template files for nginx config files - now instead of running as proxy, it will run as the main server.
For more information on installing php-fpm, please refer to: https://www.digitalocean.com/community/ ... n-centos-6

You can have those files here along with the installation instructions: https://github.com/autronix/Vesta-0.9.8-with-nginx-only

Please note that the next update may break those files.

Hope this helps.
i managed to follow your instructions, replaced files and keep getting 500 error. php-fpm, nginx runing, apache stopped
Top

mrjay
Posts: 1
Joined: Tue Aug 12, 2014 11:59 pm

Re: only nginx?
  • Quote

Post by mrjay » Wed Aug 13, 2014 12:01 am

iraton wrote:
ninja0n3 wrote:While I think Vesta is a nice piece of software, waiting until June for the next version is a bit too much and I'm too impatient...

You can have those files here along with the installation instructions: https://github.com/autronix/Vesta-0.9.8-with-nginx-only

Please note that the next update may break those files.

Hope this helps.
i managed to follow your instructions, replaced files and keep getting 500 error. php-fpm, nginx runing, apache stopped
Here the same problem as iraton getting 500 error for php-fpm requests...
Top

ludwig
Posts: 1
Joined: Fri Sep 25, 2015 9:35 am

Re: only nginx?
  • Quote

Post by ludwig » Fri Sep 25, 2015 9:54 am

Is it possible to use vestacp with only nginx yet?

I couldn't get it working using the files provided on Github (see the previous post).
I get 502 when apache is stopped. When I remove the line

Code: Select all

proxy_pass  http://84.200.44.180:8080;
in /etc/nginx/conf.d/my_ip.conf I get 400.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: only nginx?
  • Quote

Post by skurudo » Fri Sep 25, 2015 2:50 pm

ludwig wrote:Is it possible to use vestacp with only nginx yet?
Yes, but you need to decide what will you do after nginx? Nginx can't execute nothing more than html, you need something like php-fpm at least.
Top


Post Reply
  • Print view

17 posts
  • Previous
  • 1
  • 2

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password