Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save talha08/2822fce71331d2ba3ca337f968569f19 to your computer and use it in GitHub Desktop.
Save talha08/2822fce71331d2ba3ca337f968569f19 to your computer and use it in GitHub Desktop.
Laravel Project setup on UBUNTU server
Execute the Steps serially
laravel 5.1
assuming domain name 'sustcse12.cf'
sudo apt-get update
sudo mkdir -p /var/www/sustcse12.cf/public_html
sudo chown -R $USER:$USER /var/www/sustcse12.cf/public_html
cd /var/www/sustcse12.cf/public_html
git clone https://github.com/talha08/sust_cse_12.git
cd sust_cse_12
composer update
Go to phpmyadmin and create a table name: sust_cse_12
nano app/config/database.php {edit database file } for 5.1 nano .env
set database as sust_cse_12 and also the password
php artisan migrate
php artisan db:seed
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/sustcse12.cf.conf
if second domain copy from first domain
sudo cp /etc/apache2/sites-available/sustcse12.xyz.conf /etc/apache2/sites-available/sustcse12.cf.conf
sudo nano /etc/apache2/sites-available/sustcse12.cf.conf
In total, our virtualhost file should look like this:
<VirtualHost *:80>
ServerAdmin mrsiddiki@gmail.com
ServerName sustcse12.cf
ServerAlias www.sustcse12.cf
DocumentRoot /var/www/sustcse12.cf/public_html/sust_cse_12/public
<Directory "/var/www/sustcse12.cf/public_html/sust_cse_12/public/">
ErrorLog /var/www/coolexample.com/error.log/error.log
CustomLog /var/www/coolexample.com/error.log/access.log combined
AllowOverride All
</VirtualHost>
Save and close the file.
sudo a2ensite sustcse12.cf.conf
sudo service apache2 restart
cd /var/www/sustcse12.cf/public_html/sust_cse_12/
sudo chmod -R 777 storage
sudo chmod -R 777 public {-- this is permission read write and execute --}
Finally Check if the site is okay ! ~~ sustcse12.cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment