• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Archives for November 2017

Install Laravel 5.5 on Ubuntu 16.04

November 28, 2017

Laravel is a MVC framework for PHP. The latest Laravel release is version 5.5 in July 2017. Laravel 5.5 requires PHP 7 and higher. The latest stable release of PHP is 7.1. The following instructions walks you through how to install Laravel 5.5 on Ubuntu 16.04 LTS.

Update

sudo apt-get update
sudo apt-get upgrade

sudo apt-get update sudo apt-get upgrade

Install Apache

# install apache
sudo apt-get install apache2
# start apache
sudo systemctl start apache2
# enable on startup
sudo systemctl enable apache2

# install apache sudo apt-get install apache2 # start apache sudo systemctl start apache2 # enable on startup sudo systemctl enable apache2

Install PHP 7

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.1 php7.1-xml php7.1-mbstring php7.1-mysql php7.1-json php7.1-curl php7.1-cli php7.1-common php7.1-mcrypt php7.1-gd libapache2-mod-php7.1 php7.1-zip

sudo apt-get install python-software-properties sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt install php7.1 php7.1-xml php7.1-mbstring php7.1-mysql php7.1-json php7.1-curl php7.1-cli php7.1-common php7.1-mcrypt php7.1-gd libapache2-mod-php7.1 php7.1-zip

Install Composer

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/bin/composer

curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/bin/composer

Change Permissions

# add new user to www-data group
sudo useradd -g www-data ubuntu
# add existing user to www-data group
sudo usermod -a -G www-data ubuntu
# change ownership
sudo chown -R ubuntu:www-data /var/www
# change permissions
sudo chmod -R g+rwx /var/www

# add new user to www-data group sudo useradd -g www-data ubuntu # add existing user to www-data group sudo usermod -a -G www-data ubuntu # change ownership sudo chown -R ubuntu:www-data /var/www # change permissions sudo chmod -R g+rwx /var/www

Install Laravel 5.5 via Composer

composer create-project laravel/laravel /var/www/html/web

composer create-project laravel/laravel /var/www/html/web

Make Storage Writeable

sudo chmod -R 777 /var/www/html/web/storage

sudo chmod -R 777 /var/www/html/web/storage

Set Document Root in Apache

sudo nano /etc/apache2/sites-available/000-default.conf
# change DocumentRoot to laravel/public
DocumentRoot "/var/www/html/laravel/public"
# Save and Exit

sudo nano /etc/apache2/sites-available/000-default.conf # change DocumentRoot to laravel/public DocumentRoot "/var/www/html/laravel/public" # Save and Exit

Restart Apache

sudo systemctl restart apache2

sudo systemctl restart apache2

There you have it. Laravel 5.5 on Ubuntu 16.04 LTS. Enjoy.

Filed Under: Linux Tagged With: laravel 5.5, ubuntu 16.05 lts

Comment Multiple Lines in BASH

November 28, 2017

If you find yourself commenting out multiple lines in BASH, there is a simple way of commenting them out using the HERE DOCUMENT feature. Typically you use the hash (#) tag to comment out each line, but that can get tiresome especially if have hundreds of lines. Here’s a better option. Use the HERE DOCUMENT feature in BASH. Anything in between the HERE DOCUMENT will be ignored by BASH and treated as comments.

#<<COMMENT - Remove the # sign to activate the HERE DOCUMENT
echo "1"
echo "3"
echo "4"
#COMMENT - Remove the # sign to activate the HERE DOCUMENT

#<<COMMENT - Remove the # sign to activate the HERE DOCUMENT echo "1" echo "3" echo "4" #COMMENT - Remove the # sign to activate the HERE DOCUMENT

If you need to reverse them, then just do the following. In this way, you only have to touch 2 lines instead of multiple lines.

Filed Under: Linux Tagged With: comment, here doc

Delete Linux Mail From Terminal

November 27, 2017

If you’re getting tired of seeing this …

$ You have new mail in /var/spool/mail/username

$ You have new mail in /var/spool/mail/username

You can delete by running this command from the Terminal

$ > /var/spool/mail/username

$ > /var/spool/mail/username

Filed Under: Linux Tagged With: mail, mailbox

  • Home
  • About
  • Archives

Copyright © 2023