How to deploy laravel and vuejs serparately in apache server

Viewed 243

I have an application laravel as backend and vuejs as frontend separately. The problem is I don't know how to deploy this app to the server separately using apache server. I need help please provide me a detail instructions on how to do it. I have successfully deploy the laravel application api but I'm having trouble with the vuejs frontend also I'm using one ip address for this two application.

Thanks for your help. Donnie.

1 Answers

It is very simple to deploy Vue SPA on the apache server.

Run this command in your project for production build

npm run prod

OR

yarn build

This command will create a dist folder in your Vue project.

project/dist/spa

spa folder contains index.html and other files (images,css and compiled js filed) enter image description here

Give path of this index.html in your apache environment.

/etc/apache2/sites-available/your_project.conf

In ubuntu look like this.

eg /var/www/dist/spa

In ubuntu how we make the symbolic link

ln -s /your_project/dist /var/www/dist

Related