- Run
yum install postgresql-server postgresql-contrib
; installs PostgreSQL and some utilities - Run
postgresql-setup initdb
; sets up the default config - Near line ~82 in
/var/lib/pgsql/data/pg_hba.conf
, change the method from ident to md5 on thehost
lines - Run
systemctl start postgresql
to start the SQL server - Run
systemctl enable postgresql
to enable it as a service - Setup created a postgres "root" user called
postgres
you can become that user withsudo -i -u postgres
- You can get a SQL prompt with
psql
; exit SQL prompt by typing\q
- Postgres user also has the
createuser
andcreatedb
commands available; by default, it matches user accounts and database names by the user account that is accessing it. So you will likely need to add a user and a db named after an existing UNIX account. - Once you have a user, you can add a password for them in the
psql
prompt:\password username
; it will prompt you to set a password for the user.
- If you are using laravel, then the web folder should be the folder in your project called 'public'. So you will probably end up with something like /home/account/web/public; Where you put it is up to you, but your actual Laravel installation should be outside the user's web root folder.
- Run
chown -R account:account /home/account/site_folder
in order to ensure that the user can write to his files. You must do this to your Laravel project folder to ensure that the storage folder is writable. - Run
service php5-fpm restart
- If you have any SSH keys to add, now is the time
-
You'll need to install composer:
wget -q -O - https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer
-
Ensure you read this
- Configure your DNS for any applicable subdomains
- Restart the server when you're done to finalize any package installs