Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kapitannwel/ae52b1b856d020efb9b05fc5610799a9 to your computer and use it in GitHub Desktop.
Save kapitannwel/ae52b1b856d020efb9b05fc5610799a9 to your computer and use it in GitHub Desktop.
How to setup Ubuntu Server 18.04, Laravel and MySQL on VirtualBox
download and install virtualbox
download Ubuntu Server LTS
on virtualbox, click 'NEW'
select "create a virtual hardisk" and "vdi (virtual disk image)" and "dynamically allocated"
select location of the virtual hardisk from previous step
select memory size (4gb)
click create
(the virtual machine is now created)
select the virtual machine and click start
select the Ubuntu Server LTS that you downloaded from step 2
the installer will guide you through the installation of the Ubuntu Server LTS
https://www.ceos3c.com/open-source/install-ubuntu-server-18-04-lts/
sudo apt-get update
sudo apt-get upgrade
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install apache2 libapache2-mod-php7.2 php7.2 php7.2-xml php7.2-gd php7.2-opcache php7.2-mbstring php7.2-zip php7.2-mysql
cd /tmp
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --version
cd /var/www/html
sudo composer create-project laravel/laravel my_laravel_app --prefer-dist
12.) cd my_laravel_app
composer install / sudo bower install --allow-root
sudo chgrp -R www-data /var/www/html/your-project
sudo chmod -R 775 /var/www/html/your-project/storage
sudo chmod -R 777 /var/www/html/your-project/storage
sudo chmod -R 777 /var/www/html/your-project/storage/logs
sudo chmod -R 777 /var/www/html/your-project/public
cd /etc/apache2/sites-available
sudo nano laravel.conf
18.) <VirtualHost *:80>
ServerName yourdomain.tld
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/your-project/public
<Directory /var/www/html/your-project>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2dissite 000-default.conf
sudo a2ensite laravel.conf
sudo a2enmod rewrite
22.) sudo service apache2 restart
your virtualbox's network settings must be set to "Bridged Adapter"
24.) on your windows computer, try accessing http://xxx.xxx.xx.x
if the previous step loads the laravel default page, you can then clone your actual laravel project's repo, redo step 12-15 , reconfigure step18 for your actual app's directory, step22, step24
https://www.howtoforge.com/tutorial/install-laravel-on-ubuntu-for-apache/
HOW TO INSTALL BOWER:
sudo curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install nodejs
sudo npm install -g bower
npm --version
node --version
bower --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment