Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section Modification & Patches
  • Search

apache + php-fpm works but no backend template in gui Topic is solved

Section with modification and patches for Vesta
Locked
  • Print view
Advanced search
7 posts • Page 1 of 1
Clouseau
Posts: 20
Joined: Fri Mar 04, 2016 8:39 pm

apache + php-fpm works but no backend template in gui

Post by Clouseau » Fri Mar 04, 2016 8:49 pm

I have modified install script to install apache and php-fpm successfully. I have manually created pools and add my own apache template and it works. So does webmail and phpmyadmin, with seperate php-fpm pool created for (admin) user. And now I can use Apache new mpm-event with php-fpm which is nice. mpm-event heavily outperforms prefork and with php-fpm it is working very good and fast. It would be nice if this was added as an option because it isn't that complicate to implement and it would be great to have an option to run apache with php-fpm.

Only thing that I didn't manage to get working is backend template option shown in Vesta gui so I can add those php-fpm pools through Vesta. Can someone help with the following? Where to look and what to modifiy. Is it even possible without heavy modifying the code?
Top

skamasle
Collaborator
Posts: 592
Joined: Mon Feb 29, 2016 6:36 pm

Re: apache + php-fpm works but no backend template in gui

Post by skamasle » Fri Mar 04, 2016 9:57 pm

What errors you get ?
Top

Clouseau
Posts: 20
Joined: Fri Mar 04, 2016 8:39 pm

Re: apache + php-fpm works but no backend template in gui

Post by Clouseau » Sat Mar 05, 2016 3:49 pm

I added WEB_BACKEND='php-fpm' and there were no templates available in GUI under WEB templates, drop down was empty. Backend template section is missing. I run: v-list-web-templates and it show error:
ls: cannot access /usr/local/vesta/data/templates/web/apache/php-fpm/: No such file or directory
Templates
----------

So I added symlinks in /usr/local/vesta/data/templates/web/:
apache -> httpd/
And in httpd I added:
php-fpm -> ../httpd/

And I got web templates in Vesta GUI shown. But backend template option is not shown. Probably due to some "if then else" in Vesta panel code.

This shows good: v-list-web-templates-backend
Templates
----------
default
no-php
socket

I do not see any errors in /var/log/vesta/*
Top

skamasle
Collaborator
Posts: 592
Joined: Mon Feb 29, 2016 6:36 pm

Re: apache + php-fpm works but no backend template in gui

Post by skamasle » Sat Mar 05, 2016 7:15 pm

You need add 3 files here

Code: Select all

/usr/local/vesta/data/templates/web/httpd/
.sh
.tpl
.stpl

If you dont add that 3 files vesta dont show nothing on menu.
Top

Clouseau
Posts: 20
Joined: Fri Mar 04, 2016 8:39 pm

Re: apache + php-fpm works but no backend template in gui

Post by Clouseau » Sun Mar 06, 2016 6:05 pm

I added all the templates from httpd directory to apache and Web templates are shown. But there is no "Backend template" section in GUI so I cannot select any of php-fpm templates, there is no drop down to select anything.

Also adding backend through CLI works: "v-add-web-domain-backend admin test.com socket" this creates php-fpm pool. The problem is there is no Backup template secion in GUI. There must be some hardcoded check if there is nginx set for web_system or something. This is my vesta.conf:

WEB_SYSTEM='apache'
WEB_RGROUPS='apache'
WEB_PORT='80'
WEB_SSL_PORT='443'
WEB_SSL='mod_ssl'
WEB_BACKEND='php-fpm'
STATS_SYSTEM='webalizer,awstats'
FTP_SYSTEM='vsftpd'
DNS_SYSTEM='named'
MAIL_SYSTEM='exim'
ANTIVIRUS_SYSTEM='clamav'
ANTISPAM_SYSTEM='spamassassin'
IMAP_SYSTEM='dovecot'
CRON_SYSTEM='crond'
BACKUP_SYSTEM='local'
LANGUAGE='en'
VERSION='0.9.8'
DB_SYSTEM='mysql'
Top

Clouseau
Posts: 20
Joined: Fri Mar 04, 2016 8:39 pm

Re: apache + php-fpm works but no backend template in gui

Post by Clouseau » Sun Mar 06, 2016 7:04 pm

I have to comment this in /usr/local/vesta/web/edit/web/index.php:

// List backend templates
//if (!empty($_SESSION['WEB_BACKEND'])) {
exec (VESTA_CMD."v-list-web-templates-backend json", $output, $return_var);
$backend_templates = json_decode(implode('', $output), true);
unset($output);
//}

Do you have an idea why SESSION variable WEB_BACKEND is not set?
Top

Clouseau
Posts: 20
Joined: Fri Mar 04, 2016 8:39 pm

Re: apache + php-fpm works but no backend template in gui

Post by Clouseau » Sun Mar 06, 2016 9:43 pm

Ok, I fixed it. It just need to log out and to log in to set new session vars :)
Top


Locked
  • Print view

7 posts • Page 1 of 1

Return to “Modification & Patches”



  • 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