Adding a New Application - marist-sga/documentation GitHub Wiki
Prerequisites:
- How to
sshonto the server. Checkout Server Guide - On the server we have: Composer, MySQL, Apache2, PHP7 installed
First, ssh on our server in the data/sga_webapps/htdocs folder. Here. we. go.
-
git clonethe repository of the application you want to add -
lsto make sure the application folder was added -
cdinto that folder so if it wassga-websiteyou'll runcd sga-website - Run a
composer updatenow I can guarantee you'll get a permissions error for thecomposer.lockfile. To get rid of this runsudo chmod 777 composer.lockand run acomposer updateagain - Depending on your db setup (I hope you used migrations) you can run
php artisan migrateto create all the tables (make sure your database is created first). Checkout Database guide if you don't know what the hell our database is - If you're a Laravel God (like Frank Siderio) you also have seeders so run
php artisan db:seed - Okay if you've made it this far congrats!
- Create the
.envfile by runningsudo vi .env - Copy the contents from
.env.exampleand change the database username and password to our db username and password (see CommonKey) - Run
php artisan key:generate - Run
sudo vi /etc/apache2/vhosts.d/lxsga.confthis is the apache configuration file - You'll need to add this:
Alias /test /data/sga_webapps/htdocs/sga-website/public
<Directory "/data/sga_webapps/htdocs/sga-website/public">
Options Includes FollowSymlinks Multiviews AllowOverride All
Order allow,deny
Allow from all
</Directory>What this is saying is when you visit /test it will run the index file in /data/sga_webapps/htdocs/sga-website/public
For any Laravel application you'll need to set the path in the /public folder because the index.php file is in that directory.
- In this example navigate to
/testand see if you get errors (you probably will) - You will have to give permissions to the
/storageand/bootstrapfolders
sudo chmod 777 -R /storageand same for/boostrap
- This will add these files to git so just check them out we do not want to commit them
Its good to run php artisan serve to see if you get an errors through that. Most of the errors you'll get you can Google and find on Laracasts or StackOverflow.