apache - laravel right server configuration for host several site -
i got laravel project uploaded on vps, can't understand how configure things have:
- more 1 site(laravel project) on vps; (that is tricky, because configuration examples i've found talking pointing root of server public laravel's folder)
having .env , .composer , system folders not accesible directly;
wich right user , permission set on various folders;
in system ive :
- www-data classic apache group standard privileges;
- a non root user, used access mysql , ftp service;
- a root user;
i'm using apache2 on ubuntu server 16.04.
according question, assume want host multiple laravel sites on vps without messing up!
here go! let's assume create directories of site in /var/www
directory because it's basic apache directory be.
configuration site 1:
->virtual host site 1
<virtualhost *:80> documentroot "var/www/site1/public" servername www.site1.com # other directives here </virtualhost>
-> directory site 1 (upload project here): /var/www/site1
configuration site 2:
->virtual host site 2
<virtualhost *:80> documentroot "var/www/site2/public" servername www.site2.com # other directives here </virtualhost>
-> directory site 2 (upload project here): /var/www/site2
here trick! laravel have index.php
file in public folder of project, domains point /var/www/site-x/public
folder specific site! have own composer
, config
files in /var/www/site-x/
directories of own!
so, how can host multiple laravel sites on same vps without messing up! using same technique! think it's 1 trick so! let me know if works!
Comments
Post a Comment