Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Laravel in folder

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
dev7
Posts: 7
Joined: Thu Feb 23, 2017 4:31 pm

Laravel in folder
  • Quote

Post by dev7 » Tue Mar 28, 2017 2:46 pm

I have laravel in a folder and I keep getting the 403 forbidden error. To access the site I have to go to mysite.com/laravel/public. I want it to work as mysite.com/laravel

Is this possible? If so can someone tell me the best way how please.

Thanks in advance.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Laravel in folder
  • Quote

Post by skurudo » Wed Mar 29, 2017 11:44 am

Try to look at topics
viewtopic.php?f=41&t=12158#p49617
and
app.php/googlesearch?cx=009448527883586 ... itesearch=
Top

dev7
Posts: 7
Joined: Thu Feb 23, 2017 4:31 pm

Re: Laravel in folder
  • Quote

Post by dev7 » Tue Apr 11, 2017 11:48 am

My main page is loading correctly at mysite.com/folder & the login auth works but it redirects me to mysite.com. if i manually navigate to mysite.com/folder it is logged in correctly but all of the routes are messed up.

mysite.com/folder/page gives me a 500 internal server error and mysite.com/page is working
Top

peterbrinck
Posts: 16
Joined: Wed Jun 24, 2015 8:13 am

Re: Laravel in folder
  • Quote

Post by peterbrinck » Tue Apr 11, 2017 12:33 pm

You can create a new Apache/Web template, call it Laravel, that has the correct configuration for a Laravel app.
So the document root would have to point to the /public folder in your Laravel app.

Here's my web template for Laravel apps (/usr/local/vesta/data/templates/web/apache2):

Code: Select all

<VirtualHost %ip%:%web_port%>

    ServerName %domain_idn%
    %alias_string%
    ServerAdmin %email%
    DocumentRoot %docroot%/public
    ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
    Alias /vstats/ %home%/%user%/web/%domain%/stats/
    Alias /error/ %home%/%user%/web/%domain%/document_errors/
    #SuexecUserGroup %user% %group%
    CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
    CustomLog /var/log/%web_system%/domains/%domain%.log combined
    ErrorLog /var/log/%web_system%/domains/%domain%.error.log
    <Directory %docroot%>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir %docroot%:%home%/%user%/tmp
        php_admin_value upload_tmp_dir %home%/%user%/tmp
        php_admin_value session.save_path %home%/%user%/tmp
    </Directory>
    <Directory %home%/%user%/web/%domain%/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid %user% %group%
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID %user% %group%
    </IfModule>

    IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*

</VirtualHost>


The template could be done in another way, but I found it easiest to just leave the public_html folder and put my Laravel app inside.

Then, when you have created the domain for the Laravel app in Vesta, you can change the Web Template to Laravel, and the conf files will, all by it self, match your Laravel config template.
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password