Jump to content
Froxlor Forum
  • 0
veto

debian 9 stretch with php7 and php56

Question

have now successfully a default froxlor + apache2 + mod_apache + php7  running.

the problem is now that some php webapps are not supporting php7.

i read the debian9 can run multiple php version 

and i installed php 5.6 with

apt-get install apt-transport-https
curl https://packages.sury.org/php/apt.gpg | apt-key add -
echo 'deb https://packages.sury.org/php/ stretch main' > /etc/apt/sources.list.d/deb.sury.org.list
apt-get update

https://pehapkari.cz/blog/2017/03/27/multiple-php-versions-the-easy-way/

the manual is for nginx.

i want now to run all virtual host with the default mod_php apache2 setting from froxlor but for some virtualhosts

use another php handler like  php5.6-cgi or php5.6-fmp.

there so many different setting possible and with the decaying search quality it difficult to find a staring point

 

 

 

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Multiple php Versions can be used using fcgid (Apache only) as you can define the PHP binary to be executed.

Share this post


Link to post
Share on other sites
  • 0

thanks,

its working,

i used  a combination of proxy_fcgi and php-fpm

install :
apt-get install php5.6-fpm php5.6

activate:

a2enmod proxy_fcgi proxy

and in froxlor in the text box Own vHost-settings of the domain settings i added:

 <FilesMatch "\.php$">
    SetHandler  "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://foo.com/"
</FilesMatch>

Share this post


Link to post
Share on other sites
  • 0
3 minutes ago, veto said:

and in froxlor in the text box Own vHost-settings of the domain settings i added:

 <FilesMatch "\.php$">
    SetHandler  "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://foo.com/"
</FilesMatch>

Or even better, go to fpm settings, at the bottom, and just activate "use proxy_fcgi"....Or else you won't have the socket run by the user and you will have read/write problems cause of owner/group mismatch

Share this post


Link to post
Share on other sites
  • 0

the activation of fpm and the than the proxy_fcgi made   my php-sites unaccessible.

i will try this now with new a server

 

 

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, veto said:

i will try this now with new a server

So, you gonna try the exact same things on a new machine and expect something else to happen? Why not first check logs and vhosts and configs etc.?

Share this post


Link to post
Share on other sites
  • 0

not the same.

its working for this one php5.6 webapp for now.

no production site on the new server so peace of mind.

i think i did not install libnss-mysql (required for FCGID/php-fpm/mpm-itk) on the first server.

 

 

 

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, veto said:

i think i did not install libnss-mysql (required for FCGID/php-fpm/mpm-itk) on the first server.

Error log would've told you that (unknown user for example)

Share this post


Link to post
Share on other sites
  • 0

i got this error:

Tue Aug 15 18:26:32.621996 2017] [proxy:error] [pid 31544] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/apache2/fastcgi/froxlor.pa\
nel-serverdomain.com-php-fpm.socket (*) failed
[Tue Aug 15 18:26:32.622037 2017] [proxy_fcgi:error] [pid 31544] [client 1.47.132.48:8651] AH01079: failed to make connection to backend: httpd-UDS
[Tue Aug 15 18:27:04.808228 2017] [mpm_prefork:notice] [pid 29580] AH00171: Graceful restart requested, doing restart

 

so i linked

/var/lib/apache2/fastcgi/froxlor.pa\
nel-foo.com-php-fpm.socket  to

/var/run/php/php5.6-fpm.sock

 

to login to froxlor again and disable the proxy-fcgi with fpm

 

 

 

 

Share this post


Link to post
Share on other sites
  • 0

You know that froxlor itself creates the pool-configs for fpm and with them the sockets...please check your pool-configs (are they being generated to the correct location and included?); check the domains webserver vhosts, etc.etc.etc.

Share this post


Link to post
Share on other sites
  • 0

thanks,

but same error

[Wed Aug 16 09:46:26.503876 2017] [proxy_fcgi:error] [pid 24298] [client 61.19.42.229:1739] AH01079: failed to make connection to backend: httpd-UDS
[Wed Aug 16 09:46:53.687903 2017] [proxy:error] [pid 24300] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/apache2/fastcgi/foo.com-php-fpm.socket (*) failed

 

maybe because i don't have

libapache2-mod-fastcgi in stretch anymore

but i have
libapache2-mod-fcgid

Share this post


Link to post
Share on other sites
  • 0

stretch uses MOD_PROXY...also, as said before, check VHOSTS and POOL-CONFIGS (or even provide them here) - also verify that these generated files are being included correctly...

Share this post


Link to post
Share on other sites
  • 0

I'm testing out Froxlor/Stretch right now, and this procedure worked for me for multiple PHP versions:

- add Debian's/Ubuntu's PHP maintainer repository

apt-get install apt-transport-https
curl https://packages.sury.org/php/apt.gpg | apt-key add -
echo 'deb https://packages.sury.org/php/ stretch main' > /etc/apt/sources.list.d/deb.sury.org.list
apt-get update
apt-get install php5.6-cgi php7.1-cgi

You may change the default php with:

update-alternatives --config php

As i use fcgi+apache 2.4+suexec the rest is easy: remove the immutable from the fcgi-starter you wish to change to a different version, and edit the starter to use a different one:

chatt -i /path/to/starter

edit the starter and change

exec /usr/bin/php-cgi -c /path/to/conf   to  exec /usr/bin/php-cgi5.6 -c /path/to/conf

As Debian delivers 7.0, you should have the choice of 5.6, 7.0 and 7.1 binaries. It would be nice to have this as an option within froxlor, but right now you have to re-edit all non-default files when froxlor rebuilds them.

 

BTW: libnss-mysql works in stretch (source build, maridb dev files required).

Share this post


Link to post
Share on other sites
  • 0

Why change the starter-file manually? it will be overwritten by the cronjob anyway. If you use FCGID you can just create another php-configuration with /usr/bin/php-cgi5.6 as php-binary and assign it to the domains you want to use php-5.6 with

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By MasterOfDeath
      Hello all,
      I deleted my old debian 7 and updated everything to new versions. However some problems exists and i cannot access my webpages.
      I did everything according to wiki pages and froxlor configurations but still some errors exists in below and not showing pages properly - only froxlor default page shown
      ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) (Result: exit-code) since Tue 2019-04-16 23:48:14 +03; 53min ago Process: 4850 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS) Process: 5958 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=1/FAILURE) Process: 4858 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 4862 (apache2) Tasks: 13 (limit: 4915) CGroup: /system.slice/apache2.service ├─4862 /usr/sbin/apache2 -k start ├─4863 /usr/sbin/apache2 -k start ├─4864 /usr/sbin/apache2 -k start ├─4867 /usr/sbin/apache2 -k start ├─4868 /usr/sbin/apache2 -k start ├─4869 /usr/bin/php-cgi -c /var/www/php-fcgi-scripts/froxlor.panel/v22000.local/ ├─4874 /usr/sbin/apache2 -k start ├─4877 /usr/sbin/apache2 -k start ├─4878 /usr/sbin/apache2 -k start ├─4879 /usr/sbin/apache2 -k start ├─4880 /usr/sbin/apache2 -k start ├─4940 /usr/sbin/apache2 -k start └─5740 /usr/sbin/apache2 -k start Apr 16 23:48:14 v2201412723521843 systemd[1]: Started The Apache HTTP Server. Apr 17 00:33:51 v2201412723521843 Froxlor[4869]: [Administrator Action admin] [information] rebuild configfiles due to changed setting Apr 17 00:34:45 v2201412723521843 Froxlor[4869]: [Administrator Action admin] [information] added user 'kaptan' Apr 17 00:35:16 v2201412723521843 Froxlor[4869]: [Administrator Action admin] [information] added domain 'kaptan.xyz' Apr 17 00:36:28 v2201412723521843 systemd[1]: Reloading The Apache HTTP Server. Apr 17 00:36:29 v2201412723521843 apachectl[5958]: AH00543: apache2: bad user name kaptan Apr 17 00:36:29 v2201412723521843 apachectl[5958]: Action 'graceful' failed. Apr 17 00:36:29 v2201412723521843 apachectl[5958]: The Apache error log may have more information. Apr 17 00:36:29 v2201412723521843 systemd[1]: apache2.service: Control process exited, code=exited status=1 Apr 17 00:36:29 v2201412723521843 systemd[1]: Reload failed for The Apache HTTP Server. ls -al /var/customers/webs/ total 1494612 drwxr-xr-x 9 root root 4096 Apr 17 00:36 . drwxr-xr-x 6 root root 4096 Apr 13 11:00 .. -rw-r--r-- 1 root root 1530439729 Apr 12 20:09 all_backup.zip drwxr-x--- 3 10009 10009 4096 Apr 17 00:39 kaptan drwxr-x--- 7 10002 10002 4096 Apr 13 18:41 kaptans drwxr-xr-x 8 root root 4096 Apr 13 18:55 NOTactiveWEB drwxr-x--- 3 10007 10007 4096 Apr 14 19:24 test  
    • By irisdina
      Warning, this is not an official guide!!!
      1.
      sudo mv /etc/apt/source.list /etc/apt/source.list.bak 1a. Create new Source.list
      sudo nano /etc/apt/source.list 1b.  insert (for Debian Stretch)
      1.2B (for Ubuntu Cosmic)
       
      1c. 
      sudo apt update && sudo apt dist-upgrade && sudo apt autoclean && sudo apt autoremove 1d. 
      sudo apt install curl wget apt-transport-https dirmngr git software-properties-common Now you can start setting up your server
      2. MariaDB install
      Warning use sudo command für this install!
      sudo apt install mariadb-server mariadb-client 2a. MariaDB 10.3 Workround (Optional)
      3. nginx install
      sudo apt install nginx 3a. 
      mkdir /etc/nginx/sites-available mkdir /etc/nginx/sites-enabled 3b. nano /etc/nginx/nginx.conf
      4. PHP install
      sudo apt-get -y install php7.3-fpm php7.3-mysql php7.3-curl php7.3-gd php7.3-intl php-pear php-imagick php7.3-imap php-memcache php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php7.3-mbstring php-gettext php7.3-mysql php7.3-curl php7.3-gd php7.3-intl php-pear php-imagick php7.3-imap php-memcache php7.3-memcached php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php7.3-mbstring php-gettext php7.3-fpm php7.3-cli php7.3-cgi php-bcmath php-zip php7.3-fpm php7.3-curl php7.3-gd php7.3-mysql php7.3-mbstring php7.3-zip php7.3-bcmath zip unzip 4a. 
      sudo service nginx restart sudo service php7.3-fpm restart Froxlor install
      There are two ways to get Froxlor. Stable (wget) and Beta Build (git / Master)
      Stable Version
      1. 
      cd /var/www/html/ 1a. 
      sudo https://files.froxlor.org/releases/froxlor-latest.tar.gz && sudo tar xzfv froxlor-latest.tar.gz or
      Git Version (Beta Version)
      sudo git clone https://github.com/Froxlor/Froxlor.git && sudo chown -HR www-data:www-data Froxlor/ sudo apt install composer  su - www-data -s /bin/bash cd /var/www/html/Froxlor/ 1a(2). Composer install in your Froxlor directory
      composer install --no-dev 1b. 
      sudo chown -R www-data:www-data Froxlor/ Set up Froxlor
      2. Open Your Browser
      2a.
      http://your IP or Hostname/Froxlor
       

      Install Froxlor finish
       3d. Move userdata (Optional) 
      sudo mv /tmp/userdata.inc.php /var/www/html/Froxlor/lib/ 2c. 
      sudo rm /etc/nginx/site-enable/default don't restart nginx!
      Froxlor Settings
      1. Cronjob
      sudo nano /etc/cron.d/froxlor insert 
      # # Set PATH, otherwise restart-scripts won't find start-stop-daemon # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # # Regular cron jobs for the froxlor package # # Please check that all following paths are correct # */5 * * * * root /usr/bin/nice -n 5 /usr/bin/php -q /var/www/html/Froxlor/scripts/froxlor_master_cronjob.php sudo chmod 0640 "/etc/cron.d/froxlor" sudo chown root:0 "/etc/cron.d/froxlor" sudo service cron restart 2. Nginx PHP Backend
      Settings > Webserver settings > Nginx PHP backend
      from 127.0.0.1:8888 to unix:/run/php/php7.3-fpm.sock
      3. 
      sudo mkdir -p /var/customers/webs/ sudo mkdir -p /var/customers/logs/ sudo mkdir -p /var/customers/tmp sudo chmod 1777 /var/customers/tmp sudo service nginx restart 4. IPs and Ports > Add IP/Port

      2a(1), SSL Port



      Wait 5min for Autimatic Start Froxlor's cronjob or start the cronjob manually
      sudo php /var/www/html/Froxlor/scripts/froxlor_master_cronjob.php --force --debug Optional
      PHP-FPM activate
      1. User/Group add
      sudo adduser froxlorlocal --disabled-password --no-create-home && sudo usermod -a -G www-data froxlorlocal 2. libnss-extrausers install 
      sudo apt install nscd libnss-extrausers sudo mkdir -p /var/lib/extrausers sudo touch /var/lib/extrausers/{passwd,group,shadow} sudo mv "/etc/nsswitch.conf" "/etc/nsswitch.conf.frx.bak" sudo nano /etc/nsswitch.conf # Make sure that `passwd`, `group` and `shadow` have mysql in their lines # You should place mysql at the end, so that it is queried after the other mechanisams # passwd: compat extrausers group: compat extrausers shadow: compat extrausers hosts: files dns networks: files dns services: db files protocols: db files rpc: db files ethers: db files netmasks: files netgroup: files bootparams: files automount: files aliases: files sudo service nscd restart sudo nscd --invalidate=group 2a. Settings > System settings > Activate > Use libnss-extrausers instead of libnss-mysql

      3. Settings > PHP-FPM > Activated:
      Change from NO to YES
      3a. PHP-FPM versions
      Change > php-fpm restart command:
      service php7.3-fpm restart and
      Configuration directory of php-fpm: > to 
      /etc/php/7.3/fpm/pool.d/ 3b. Settings > Froxlor VirtualHost settings > Activate > Enable PHP-FPM for the Froxlor vHost

      3c. 
      sudo chown -HR froxlorlocal:froxlorlocal /var/www/html/Froxlor SSL / Let's Encrypt activate
      1.
      sudo apt install certbot 1a. 
      sudo mkdir /etc/nginx/ssl && cd /etc/nginx/ssl 1b. Create SSL File
      sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt 1c. 
      sudo nano /etc/nginx/acme.conf insert
      location /.well-known/acme-challenge { alias /var/www/html/Froxlor/.well-known/acme-challenge; location ~ /.well-known/acme-challenge/(.*) { default_type text/plain; } }  
      2. Open your  Froxlor Panel
      Settings> SSL > Activated:
      Change from NO to YES
      2a. Settings > SSL > Settings
      Change your path from your certificate / Keyfile
      Path to the SSL certificate
      insert
      /etc/nginx/ssl/nginx.crt Path to the SSL Keyfile
      insert
      /etc/nginx/ssl/nginx.key 2b. Settings > SSL > Settings
      Activate > Enable Let's Encrypt

      Change Path to the acme.conf snippet to > 
      /etc/nginx/acme.conf 2c. Activate on Settings > Froxlor VirtualHost settings
      - Enable Let's Encrypt for the froxlor vhost
      - Enable SSL-redirect for the froxlor vhost
      - HTTP Strict Transport Security (HSTS)
      - Include HSTS for any subdomain






      2d. Activated HTTP2 Support on > Settings > Nginx
       
    • By tmuecksch
      Guten Tag,
      ich habe einen Debian 9 Server mit Froxlor und Apache2 am laufen. Wenn ich mit dem Kunden FTP Zugang Dateien hochlade haben diese Ordnungsgemäß das ownership 10000:10000.
      Wenn jedoch in der PHP-Weboberfläche eine Datei hochgeladen wird, wird diese mit dem ownership www-data:www-data hochgeladen. Liegt hier ein Konfigurationsfehler vor oder ist das Verhalten sogar so gewünscht? Ich kann den Fehler leider nicht entdecken. Das Problem ist nur, dass das PHP-Script dann eine Permission Denied Fehlermeldung wirft, wenn versucht wird die Datei zu lesen.
       
      Liebe Grüße
      tmuecksch
    • By Christian Vogel
      Ich habe Froxlor installiert und alle Konfigurationen ausgeführt. Dennoch kann ich nicht über Outlook oder Mail auf mein Imap Konto zugreifen. 
      Im syslog sehe ich
      Sep 10 10:11:51 vserver3130 dovecot: imap-login: Aborted login (no auth attempts in 0 secs): user=<>, rip=87.191.51.26, lip=109.73.50.135, session=<uGoEloF1eIxXvzMa>
      postconf -d und dovecot -n hab ich als Textdatei angehängt.
      Habe auch schon etwas bei Google gesucht und hier im Forum die Suchfunktion bemüht - finde aber keine Lösung. Kann mir hier jemand helfen? Werden noch andere Infos benötigt für eine Lösung?
      Danke
      Christian
       
       
      dovecot.txt
      postconf.txt
    • By LostNIL
      Greetings,
      I have Froxlor installed with PHP7.2 and need to install/enable PHP7.2-fpm. I've reviewed the wiki, The Froxlor YouTube video on the subject, and reviewed/completed the instructions within the Panel > Configuration > DB Jessie > Other > FPM and am having difficulties getting the panel to work with FPM. 
      All available instructions are written for PHP5 and when I complete the instructions and substitute PHP7.2, when the panel generates configurations there are syntax errors and the websites go down. 
       
      Does anyone have any pointers or updated instructions on enabling FPM/PHP7+ with Froxlor. 




×
×
  • Create New...