Skip to content

Instantly share code, notes, and snippets.

@derrekbertrand
Last active February 10, 2017 21:15
Show Gist options
  • Save derrekbertrand/a93abbbec82bf3585cf68fc5c877fceb to your computer and use it in GitHub Desktop.
Save derrekbertrand/a93abbbec82bf3585cf68fc5c877fceb to your computer and use it in GitHub Desktop.
A CentOS 7 web dev checklist.

To Set Up PostgreSQL:

  • 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 the host 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 with sudo -i -u postgres
  • You can get a SQL prompt with psql; exit SQL prompt by typing \q
  • Postgres user also has the createuser and createdb 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.

Create a new web account:

  • 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

Working With Laravel 5.0:

Don't forget:

  • Configure your DNS for any applicable subdomains
  • Restart the server when you're done to finalize any package installs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment