I have an old laptop and I want to use it as a dev machine to take with me when I go fishing (I don't care if it gets destroyed eventually). Anyway, I installed Ubuntu 15.04 on it, Apache2, PHP5, Composer, MySQL, etc. and all is well there. So all of the software is on the machine and running. The site at /var/www/html is properly showing the default apache page.
Where I'm stuck however is how to create my own Laravel site. I can't go to /var/www/html and do "laravel new mysite" because it doesn't allow me to with my permissions. I don't want to do everything as root either. Ideally, I'd like to be able to create a Sites directory in my home directory and put my Laravel sites in there. How would I go about doing this?
There are three options here:
The super simple option is not to use Apache at all and instead use the art:serve command to serve your sites locally.
You could use Homestead.
If you want to use Apache then you will need to create a virtual host that points to the folder you wish to use for each site. If you navigate to /etc/apache2/sites-available you will find the default implementation - just copy this and change the relevant lines so that it points at the public folder of your Laravel site.
You will then need to enable the site using:
sudo a2ensite
You may well run into some permissions issues next. Follow the installation instructions at laravel.com to ensure you grant the Apache user the relevant write permissions (mostly storage and logging issues).
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community