Created
October 7, 2018 09:48
-
-
Save manishjaingit/5c1297a9dadbe9e1288b00e1a50905ba to your computer and use it in GitHub Desktop.
ubuntu 16.04 install php + postgres + nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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