How to deploy laravel project on virtualmin?

3.7k views Asked by At

I have recently installed virtualmin on ubuntu 20.04 with lamp stack and don't know how to deploy laravel. I want to deploy with git The main problem is of directory. I want to deploy in /home/fantasy/public_html/website then my index.php will be in /home/fantasy/public_html/public when I created git repository by services> git repository, the git directory created in /home/fantasy/public_html/git/fantasy-website.git also guide how to change other apache settings or any other references I have successfully pushed from my local computer to server but my post-receive file not working. may be permission issue and don't know how to give permission to write in public_html/website folder. I tested by cloning from remote to my local computer and cloned successfully. my post-receive file: #!/bin/sh git --work-tree=/home/fantasy/public_html/website --git-dir=/home/fantasy/public_html/git/fantasy-website.git checkout -f

The only command I run to give permission for post-receive file:
chmod +x post-receive
I'm new to virtualmin so please guide in detail step by step.

regards

1

There are 1 answers

0
Nasraoui Nidhal On

To deploy your laravel app on virtualmin you need to adjust your virtualhost file,

You create your virtual server and go to /etc/apache2/sites-available/your-website.conf edit the line

DocumentRoot /home/yourwebsite-directory/public_html/
to
DocumentRoot /home/yourwebsite-directory/public_html/public

Restart apache and the app should work fine.