Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #124 from niiknow/master
Browse files Browse the repository at this point in the history
support php 7.4
  • Loading branch information
noogen authored Jun 1, 2020
2 parents f8d2813 + 44388d6 commit 54cfaec
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 99 deletions.
48 changes: 24 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM niiknow/docker-hostingbase:1.5.0
FROM niiknow/docker-hostingbase:1.5.2
LABEL maintainer="noogen <friends@niiknow.org>"
ENV DEBIAN_FRONTEND=noninteractive \
VESTA=/usr/local/vesta \
GOLANG_VERSION=1.13.5 \
GOLANG_VERSION=1.14.3 \
NGINX_BUILD_DIR=/usr/src/nginx \
NGINX_DEVEL_KIT_VERSION=0.3.0 NGINX_SET_MISC_MODULE_VERSION=0.32 \
NGINX_VERSION=1.16.1 \
NGINX_VERSION=1.18.0 \
NGINX_PAGESPEED_VERSION=1.13.35.2 \
NGINX_PSOL_VERSION=1.13.35.2 \
IMAGE_FILTER_URL=https://raw.githubusercontent.com/niiknow/docker-nginx-image-proxy/master/build/ngx_http_image_filter_module.c
Expand Down Expand Up @@ -44,7 +44,7 @@ RUN cd /tmp \
&& echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \
&& echo "deb-src http://nginx.org/packages/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \
&& apt-get update && apt-get -yf -o Dpkg::Options::="--force-confold" --no-install-recommends upgrade \
&& curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - \
&& curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - \
&& apt-get install -yf -o Dpkg::Options::="--force-confold" --no-install-recommends libpcre3-dev libssl-dev dpkg-dev libmaxminddb0 libmaxminddb-dev mmdb-bin libgd-dev iproute uuid-dev pwgen \
&& mkdir -p ${NGINX_BUILD_DIR} \
&& cd ${NGINX_BUILD_DIR} \
Expand Down Expand Up @@ -121,8 +121,8 @@ RUN cd /tmp \
postgresql-9.6-postgis-2.5 postgresql-9.6-pgrouting postgis postgis-gui postgresql-9.6-pgaudit \
postgresql-9.6-postgis-2.5-scripts postgresql-9.6-repack \

# install nodejs, memcached, redis-server, openvpn, mongodb, dotnet-sdk, and couchdb
&& apt-get install -yf --no-install-recommends nodejs memcached php-memcached redis-server \
# install memcached, redis-server, openvpn, mongodb, dotnet-sdk, and couchdb
&& apt-get install -yf --no-install-recommends memcached php-memcached redis-server \
openvpn mongodb-org php-mongodb couchdb dotnet-sdk-3.1 poppler-utils ghostscript \
libgs-dev imagemagick python3.7 \

Expand Down Expand Up @@ -158,9 +158,9 @@ RUN cd /tmp \
&& mv /sysprepz/admin/bin/vesta-*.sh /bin \

# install iconcube loader extension
&& /bin/vesta-ioncube-install.sh 7.3 \
&& /bin/vesta-ioncube-install.sh 7.4 \
# && /bin/vesta-ioncube-install.sh 7.4 \
&& /bin/vesta-ioncube-install.sh 7.2 \
&& /bin/vesta-ioncube-install.sh 7.3 \

# make sure we default fcgi and php to 7.2
&& mv /usr/bin/php-cgi /usr/bin/php-cgi-old \
Expand All @@ -182,23 +182,23 @@ RUN cd /tmp \
&& echo 'include /etc/nginx/conf.d/dbadmin.inc;' > /etc/nginx/conf.d/phppgadmin.inc \

# activate ini
# && echo "extension=v8js.so" > /etc/php/7.4/mods-available/v8js.ini \
# && ln -sf /etc/php/7.4/mods-available/v8js.ini /etc/php/7.4/apache2/conf.d/20-v8js.ini \
# && ln -sf /etc/php/7.4/mods-available/v8js.ini /etc/php/7.4/cli/conf.d/20-v8js.ini \
# && ln -sf /etc/php/7.4/mods-available/v8js.ini /etc/php/7.4/cgi/conf.d/20-v8js.ini \
# && ln -sf /etc/php/7.4/mods-available/v8js.ini /etc/php/7.4/fpm/conf.d/20-v8js.ini \
&& echo "extension=v8js.so" > /etc/php/7.4/mods-available/v8js.ini \
&& ln -sf /etc/php/7.4/mods-available/v8js.ini /etc/php/7.4/apache2/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.4/mods-available/v8js.ini /etc/php/7.4/cli/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.4/mods-available/v8js.ini /etc/php/7.4/cgi/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.4/mods-available/v8js.ini /etc/php/7.4/fpm/conf.d/20-v8js.ini \

&& echo "extension=v8js.so" > /etc/php/7.2/mods-available/v8js.ini \
&& ln -sf /etc/php/7.2/mods-available/v8js.ini /etc/php/7.2/apache2/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.2/mods-available/v8js.ini /etc/php/7.2/cli/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.2/mods-available/v8js.ini /etc/php/7.2/cgi/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.2/mods-available/v8js.ini /etc/php/7.2/fpm/conf.d/20-v8js.ini \

# && echo "extension=pcs.so" > /etc/php/7.4/mods-available/pcs.ini \
# && ln -sf /etc/php/7.4/mods-available/pcs.ini /etc/php/7.4/apache2/conf.d/15-pcs.ini \
# && ln -sf /etc/php/7.4/mods-available/pcs.ini /etc/php/7.4/cli/conf.d/15-pcs.ini \
# && ln -sf /etc/php/7.4/mods-available/pcs.ini /etc/php/7.4/cgi/conf.d/15-pcs.ini \
# && ln -sf /etc/php/7.4/mods-available/pcs.ini /etc/php/7.4/fpm/conf.d/15-pcs.ini \
&& echo "extension=v8js.so" > /etc/php/7.3/mods-available/v8js.ini \
&& ln -sf /etc/php/7.3/mods-available/v8js.ini /etc/php/7.3/apache2/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.3/mods-available/v8js.ini /etc/php/7.3/cli/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.3/mods-available/v8js.ini /etc/php/7.3/cgi/conf.d/20-v8js.ini \
&& ln -sf /etc/php/7.3/mods-available/v8js.ini /etc/php/7.3/fpm/conf.d/20-v8js.ini \

&& echo "extension=pcs.so" > /etc/php/7.2/mods-available/pcs.ini \
&& ln -sf /etc/php/7.2/mods-available/pcs.ini /etc/php/7.2/apache2/conf.d/15-pcs.ini \
Expand All @@ -212,11 +212,11 @@ RUN cd /tmp \
&& ln -sf /etc/php/7.3/mods-available/pcs.ini /etc/php/7.3/cgi/conf.d/15-pcs.ini \
&& ln -sf /etc/php/7.3/mods-available/pcs.ini /etc/php/7.3/fpm/conf.d/15-pcs.ini \

# && echo "extension=couchbase.so" > /etc/php/7.4/mods-available/couchbase.ini \
# && ln -sf /etc/php/7.4/mods-available/couchbase.ini /etc/php/7.4/apache2/conf.d/30-couchbase.ini \
# && ln -sf /etc/php/7.4/mods-available/couchbase.ini /etc/php/7.4/cli/conf.d/30-couchbase.ini \
# && ln -sf /etc/php/7.4/mods-available/couchbase.ini /etc/php/7.4/cgi/conf.d/30-couchbase.ini \
# && ln -sf /etc/php/7.4/mods-available/couchbase.ini /etc/php/7.4/fpm/conf.d/30-couchbase.ini \
&& echo "extension=couchbase.so" > /etc/php/7.4/mods-available/couchbase.ini \
&& ln -sf /etc/php/7.4/mods-available/couchbase.ini /etc/php/7.4/apache2/conf.d/30-couchbase.ini \
&& ln -sf /etc/php/7.4/mods-available/couchbase.ini /etc/php/7.4/cli/conf.d/30-couchbase.ini \
&& ln -sf /etc/php/7.4/mods-available/couchbase.ini /etc/php/7.4/cgi/conf.d/30-couchbase.ini \
&& ln -sf /etc/php/7.4/mods-available/couchbase.ini /etc/php/7.4/fpm/conf.d/30-couchbase.ini \

&& echo "extension=couchbase.so" > /etc/php/7.2/mods-available/couchbase.ini \
&& ln -sf /etc/php/7.2/mods-available/couchbase.ini /etc/php/7.2/apache2/conf.d/30-couchbase.ini \
Expand Down
70 changes: 5 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The ultimate control panel with docker (thanks lagun4ik for a great start)
<b>What's included?</b>
* ubuntu 16.04 lts + Vesta 0.9.8-25
* nginx (proxy) -> apache2 -> php-fcgi - high performance and flexible implementation
* ssh/sftp, letsencrypt, memcached, redis, MariaDB 10.2, postgresql 9.6, nodejs 10.x, golang 1.12.4, openvpn, mongodb, couchdb, .net core 2.2 runtime
* ssh/sftp, letsencrypt, memcached, redis, MariaDB 10.2, postgresql 9.6, nodejs 12.x, golang 1.14.x, openvpn, mongodb, couchdb, .net core 3.1
* folder redirection for data persistence and automatic daily backup provided by VestaCP
* DNS, named, dovecot/roundcube, spamassassin, clamav, etc... -- disabled by default
* vesta panel SSL (LE-issued) for mail and control panel - provide $HOSTNAME environment variable
Expand Down Expand Up @@ -52,7 +52,7 @@ FTP was not installed on purpose because it's not secure. Use SFTP instead on t
- [x] Replace phpmyadmin and phppgadmin with adminer.

### misc/tested/verified
- [x] ssh/sftp, nginx, apache2, php7.1+ & v8js
- [x] ssh/sftp, nginx, apache2, php7.2+ & v8js
- [x] log viewing in Vesta
- [x] backup and restore
- [x] Vesta FileManager
Expand All @@ -65,7 +65,7 @@ FTP was not installed on purpose because it's not secure. Use SFTP instead on t
- [x] add incron to monitor and immediately backup /etc/{passwd,shadow,gshadow,group}
- [x] nginx pagespeed module
- [x] redirect awstats
- [x] multiple php{7.1,7.2,7.3} fcgi and fpm templates
- [x] multiple php{7.2,7.3,7.4} fcgi and fpm templates

### your todo
- [ ] I recommend the following:
Expand Down Expand Up @@ -107,6 +107,8 @@ server {


## Release Notes
1.9.1 - build update for nginx 1.18.0, GoLang 1.14.3, nodejs 12, and phpv8js for php7.4

1.9.0 - remove php7.1 and add php7.4, update to GoLang 1.13.5 and dotnet 3.1

1.8.5 - build update for Vesta 0.9.8-25 and nginx 1.16.1
Expand All @@ -117,66 +119,4 @@ server {

1.5.2 - with php7.3 support.

1.4.0 - Major release! In this update, we remove support for php5.6 and 7.0 as it will no longer officially supported/at end of life (EOL): http://php.net/supported-versions.php There is no excuse. You know this day was coming.

* PHP 7.3 has not release so it's not yet available, but templates were added to prep for 7.3 release at the end of the year. We will also switch from nodejs 8.x to nodejs 10.x once it go into LTS at the end of this month.

* This release also default php to 7.2 and switch to golang 1.11.1

* I've made some attempts in 1.4.x to provide auto-upgrade with rsync but there were hickups along the way that I find may not work perfectly for everyone. Therefore, as this is a Major upgrade (consider it like a fresh install), I would suggest to perform user backup, download of backup, and restore. It's the same step as you would expect to migrate another server: https://vestacp.com/docs/#how-to-migrate-user-to-another-server

1.3.10 - finalizing stuff to get ready for 1.4.0

1.3.9 - update to 0.9.8-23, see security bulleton/notice in forum here: https://forum.vestacp.com/viewtopic.php?f=10&t=17795 The panel should have auto-updated, we're just updating the build for new user convenience.

1.3.6 - update nginx to 1.14 stable release, update dotnet

1.3.5 - update to 0.9.8-22 - REMINDER: if your server has not autoupdate to 0.9.8-22, please do so or update to this release. There is a serious security issue in 0.9.8-20.

1.3.3 - update to 0.9.8-20

1.3.1 - upgrade documentation.

```
- If you're using postgresql 9.5 then you want to backup all your users and then restore them on the new docker using vesta panel.
- If you're not using postgresql, then ssh as admin and run 'sudo bash /bin/vesta-update.shell' to upgrade everything. As always, it is best to backup all your users.
```

1.3.0 - **Breaking Changes**: update to postgresql-9.6, add pgaudit and postgis geo extension. This is the most popular postgresql version that also work best with postgis. Make sure you have all your postgresql databases backuped before updating to this version.

1.2.1 - Update to be more secure and compliance. A bunch of security issues discovered during the holidays were patched by various vendors including cpu (meltdown & spectre) and .net core issues:

```
- php 5.6 v8js no longer supported due to security issues resulting in older v8 deprecation.
- update nginx to 1.13.9 - rebuilt with latest ngx_pagespeed
- update golang 1.10
- update to dotnet-sdk-2.1.101
- update from 3.4 to 3.6 for mongodb
```

1.1.0 - starting from this version, we upgraded to MariaDB 10.2.

1.0.8 - introducing vesta 0.9.8-18, update to this docker image then run */bin/vesta-update.sh* to update Vesta.

1.0.0 - introducing the recently released php7.2

0.9.27 - update nginx-1.13.7 and nodejs 8 lts (boron)

0.9.15 - add php-fpm

0.9.7 - update nginx-1.13.6, golang 1.9.2, and php7.1 stuff

0.9.6 - fix graph

0.9.4 - upgraded to latest nginx-1.13.5, .net core 2.0, and golang 1.9

0.9.0 - On Ubuntu 16.04, we've defaulted to php7.0 for some time, as it was the ubuntu default. Since php7.1 are LTS for most php framework, it make sense to have it as the default. As you know, this image support 3 different versions of php: 5.6, 7.0, and 7.1. Default to php7.1 will help usher support for php7.2 as it become available later this year.

0.8.54 - add pagespeed and prep for next vesta release. It has been completely redone in anticipation for next VestaCP release. In order to upgrade to this image; please perform user backup, download of backup, and restore. It's the same step as you would expect to migrate another server: https://vestacp.com/docs/#how-to-migrate-user-to-another-server

The docker image has been redone to keep all users IDs the same to simplify upgrade. This means that, starting 0.8.52+, you can now simply upgrade the docker image when a new version is released.

0.8.30 - first stable image

# MIT
2 changes: 1 addition & 1 deletion rootfs/sysprepz/apache2-templates/php72fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rm -f /home/$user/web/$domain/cgi-bin/php*-fpm.conf
# restart any *running* php fpm found with ps -uaxw
# otherwise, simply use:
# find /etc/init.d/ -name 'php*-fpm*' -type f -exec basename {} \; | xargs -I{} service {} restart || true
phpfpms="7.1:7.2:7.3"
phpfpms="7.2:7.3:7.4"
set -f # avoid globbing (expansion of *).
iphpfpm=(${phpfpms//:/ })
for i in "${!iphpfpm[@]}"
Expand Down
2 changes: 1 addition & 1 deletion rootfs/sysprepz/apache2-templates/php73fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rm -f /home/$user/web/$domain/cgi-bin/php*-fpm.conf
# restart any *running* php fpm found with ps -uaxw
# otherwise, simply use:
# find /etc/init.d/ -name 'php*-fpm*' -type f -exec basename {} \; | xargs -I{} service {} restart || true
phpfpms="7.1:7.2:7.3"
phpfpms="7.2:7.3:7.4"
set -f # avoid globbing (expansion of *).
iphpfpm=(${phpfpms//:/ })
for i in "${!iphpfpm[@]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ domain="$2"
ip="$3"
home_dir="$4"
docroot="$5"
php_version="7.1"
php_version="7.4"

fpm_conf="
[$domain]
Expand Down Expand Up @@ -42,7 +42,7 @@ rm -f /home/$user/web/$domain/cgi-bin/php*-fpm.conf
# restart any *running* php fpm found with ps -uaxw
# otherwise, simply use:
# find /etc/init.d/ -name 'php*-fpm*' -type f -exec basename {} \; | xargs -I{} service {} restart || true
phpfpms="7.1:7.2:7.3"
phpfpms="7.2:7.3:7.4"
set -f # avoid globbing (expansion of *).
iphpfpm=(${phpfpms//:/ })
for i in "${!iphpfpm[@]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#<VirtualHost %ip%:%web_ssl_port%>
#
# ServerName %domain_idn%
# # php71fpm
# # php72fpm
# DocumentRoot %sdocroot%
# <Location />
# Deny from all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#<VirtualHost %ip%:%web_port%>
#
# ServerName %domain_idn%
# # php71fpm
# # php72fpm
# DocumentRoot %sdocroot%
# <Location />
# Deny from all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ PHPRC=/usr/local/lib
export PHPRC
export PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN=4
exec /usr/bin/php-cgi7.1
exec /usr/bin/php-cgi7.4
"
wrapper_file="/home/$user/web/$domain/cgi-bin/fcgi7.1"
wrapper_file="/home/$user/web/$domain/cgi-bin/fcgi7.4"

echo "$wrapper_script" > $wrapper_file
chown $user:$user $wrapper_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<Files *.php>
SetHandler fcgid-script
</Files>
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi7.1 .php
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi7.4 .php
</Directory>
<Directory %home%/%user%/web/%domain%/stats>
AllowOverride All
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Files *.php>
SetHandler fcgid-script
</Files>
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi7.1 .php
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi7.4 .php
</Directory>
<Directory %home%/%user%/web/%domain%/stats>
AllowOverride All
Expand Down

0 comments on commit 54cfaec

Please sign in to comment.