aboutsummaryrefslogtreecommitdiff
path: root/travis
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2020-01-27 19:49:01 +0100
committerMarc Alexander <admin@m-a-styles.de>2020-01-27 19:49:01 +0100
commit0bbe959fbd7cd8c91830e47e4931b2b2e69cc37e (patch)
tree00fcd6eeba2b7f0f05a6ed7afba5cb09b3b2d645 /travis
parentMerge branch '3.3.x' (diff)
parentMerge pull request #5825 from AlfredoRamos/ticket/16313 (diff)
downloadphpbb-0bbe959fbd7cd8c91830e47e4931b2b2e69cc37e.tar.gz
phpbb-0bbe959fbd7cd8c91830e47e4931b2b2e69cc37e.tar.bz2
phpbb-0bbe959fbd7cd8c91830e47e4931b2b2e69cc37e.zip
Merge branch '3.3.x'
Diffstat (limited to 'travis')
-rwxr-xr-xtravis/setup-webserver.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
index fd87d97449..68bcd6ac00 100755
--- a/travis/setup-webserver.sh
+++ b/travis/setup-webserver.sh
@@ -22,6 +22,7 @@ PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB")
NGINX_SITE_CONF="/etc/nginx/sites-enabled/default"
NGINX_CONF="/etc/nginx/nginx.conf"
APP_SOCK=$(realpath "$DIR")/php-app.sock
+NGINX_PHP_CONF="$DIR/nginx-php.conf"
# php-fpm
PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm"
@@ -45,13 +46,21 @@ sudo $PHP_FPM_BIN \
--fpm-config "$DIR/php-fpm.conf"
# nginx
-cat $DIR/../phpBB/docs/nginx.sample.conf \
-| sed "s/root \/path\/to\/phpbb/root $(echo $PHPBB_ROOT_PATH | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/g" \
-| sed -e '1,/The actual board domain/d' \
-| sed -e '/If running php as fastcgi/,$d' \
-| sed -e "s/fastcgi_pass php;/fastcgi_pass unix:$(echo $APP_SOCK | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g');/g" \
-| sed -e 's/#listen 80/listen 80/' \
-| sudo tee $NGINX_SITE_CONF
sudo sed -i "s/user www-data;/user $USER;/g" $NGINX_CONF
+sudo cp "$DIR/../phpBB/docs/nginx.sample.conf" "$NGINX_SITE_CONF"
+sudo sed -i \
+ -e "s/example\.com/localhost/g" \
+ -e "s|root /path/to/phpbb;|root $PHPBB_ROOT_PATH;|g" \
+ $NGINX_SITE_CONF
+# Generate FastCGI configuration for Nginx
+echo "
+upstream php {
+ server unix:$APP_SOCK;
+}
+" > $NGINX_PHP_CONF
+
+sudo mv "$NGINX_PHP_CONF" /etc/nginx/conf.d/php.conf
+
+sudo nginx -T
sudo service nginx start