Skip to content

Instantly share code, notes, and snippets.

@manishjaingit
Created October 7, 2018 09:48
Show Gist options
  • Save manishjaingit/5c1297a9dadbe9e1288b00e1a50905ba to your computer and use it in GitHub Desktop.
Save manishjaingit/5c1297a9dadbe9e1288b00e1a50905ba to your computer and use it in GitHub Desktop.
ubuntu 16.04 install php + postgres + nginx
# https://www.circuidipity.com/php-nginx-postgresql/
sudo apt install php php-fpm php-apcu php-curl php-cli php-pgsql php-gd php-mcrypt php-mbstring php-fdomdocument php-intl
# Improve security by editing /etc/php/*/fpm/php.ini and modifying pathinfo to 0 …
# cgi.fix_pathinfo=0
sudo systemctl restart php7.0-fpm
# 1. Nginx
# first uninstall apache
sudo apt --purge remove *apache*
# install nginx
sudo apt install nginx-common
sudo apt install nginx
sudo systemctl start nginx
#verify it is installed and should work by hiting by ip or domain.
# 2 Install postgres
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo -u postgres psql postgres
postgres=# \password postgres
Enter new password: [newpasswd]
Enter it again: [newpasswd]
postgres=# \quit
# Example: Create a new username www-data and database ttrss
sudo -u postgres psql postgres
postgres=# CREATE USER "www-data" WITH PASSWORD 'newpasswd';
postgres=# CREATE DATABASE ttrss WITH OWNER "www-data";
postgres=# GRANT ALL PRIVILEGES ON DATABASE ttrss to "www-data";
postgres=# \quit
#Reload server and check status …
sudo systemctl restart postgresql
systemctl status postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment