Install Laravel and React App on Ubuntu 18.04

Install Laravel and React App on Ubuntu 18.04

Install Apache2 :

sudo apt install apache2 -y

Install Laravel :

naresh@nodejs:~$ sudo  apt install php7.2 libapache2-mod-php7.2 php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-cli php7.2-zip

naresh@nodejs:~$ sudo vi /etc/php/7.2/apache2/php.ini

Set the value as :

memory_limit = 256M
upload_max_filesize = 64M
upload_max_filesize = 64M


sudo apt-get install gcc g++ make -y

 curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

naresh@nodejs:/var/www/html$ sudo composer create-project laravel/laravel Laravel --prefer-dist
naresh@nodejs:/var/www/html$ sudo chown -R www-data:www-data Laravel/
naresh@nodejs:/var/www/html$ sudo chmod  -R 755 Laravel/

sudo vi /etc/apache2/sites-available/000-default.conf

DocumentRoot    /var/www/html/Laravel/public

naresh@nodejs:/var/www/html/Laravel$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
  systemctl restart apache2
naresh@nodejs:/var/www/html/Laravel$
naresh@nodejs:/var/www/html/Laravel$ sudo systemctl restart apache2.service


naresh@nodejs:~/my_app$ php artisan serve --host 0.0.0.0 --port 8000


Install React App

  • Install Nodejs

naresh@nodejs:~/my_app$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
naresh@nodejs:~/my_app$ sudo apt-get install -y nodejs
naresh@nodejs:~/my_app$ sudo npm install npm@latest -g
naresh@nodejs:~/my_app$ npm -v
6.13.4

  • Install Create-React-App Tool

naresh@nodejs:~/my_app$ sudo npm install -g create-react-app
/usr/bin/create-react-app -> /usr/lib/node_modules/create-react-app/index.js
+ create-react-app@3.3.0
added 91 packages from 45 contributors in 6.142s

  •  Creating a New React Project
naresh@nodejs:~/my_app$ create-react-app myproject


naresh@nodejs:~/my_app/myproject$ npm start &



Add the code





Comments