Laravel App installation on Subdomain

I want to install some laravel app on subdomains, on cPanel we just create subdomain and while creating it we route folder to /public and every thing works fine.

Anyhow in case of cyberpanel, when I create subdomain and upload laravel files, it’ll keep redirecting. When I add subfolder in public_html and move laravel file into this then it’ll work.

Show me your vhost config and folder structure of laravel app.

This looks similar to my current issue, please check this for me. The error I get in response in my case is error 302
Here’s my Vhost Config:
docRoot $VH_ROOT/public_html
vhDomain $VH_NAME
vhAliases www.$VH_NAME
adminEmails [email protected]
enableGzip 1
enableIpGeo 1

index {
useServer 0
indexFiles index.php, index.html
}

errorlog $VH_ROOT/logs/$VH_NAME.error_log {
useServer 0
logLevel WARN
rollingSize 10M
}

accesslog $VH_ROOT/logs/$VH_NAME.access_log {
useServer 0
logFormat “%h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-Agent}i””
logHeaders 5
rollingSize 10M
keepDays 10
compressArchive 1
}

errorpage 403 {
url 403.html
}

errorpage 404 {
url 404.html
}

errorpage 500 {
url 500.html
}

scripthandler {
add lsapi:quick2116 php
}

extprocessor quick2116 {
type lsapi
address UDS://tmp/lshttpd/quick2116.sock
maxConns 10
env LSAPI_CHILDREN=10
initTimeout 600
retryTimeout 0
persistConn 1
pcKeepAliveTimeout 1
respBuffer 0
autoStart 1
path /usr/local/lsws/lsphp73/bin/lsphp
extUser quick2116
extGroup quick2116
memSoftLimit 2047M
memHardLimit 2047M
procSoftLimit 400
procHardLimit 500
}

phpIniOverride {
php_admin_value open_basedir “/tmp:$VH_ROOT”
}

module cache {
storagePath /usr/local/lsws/cachedata/$VH_NAME
}

rewrite {
enable 1
autoLoadHtaccess 1
}

context /.well-known/acme-challenge {
location /usr/local/lsws/Example/html/.well-known/acme-challenge
allowBrowse 1

rewrite {

}
addDefaultCharset off

phpIniOverride {

}
}

vhssl {
keyFile /etc/letsencrypt/live/quickb2c.online/privkey.pem
certFile /etc/letsencrypt/live/quickb2c.online/fullchain.pem
certChain 1
sslProtocol 24
enableECDHE 1
renegProtection 1
sslSessionCache 1
enableSpdy 15
enableStapling 1
ocspRespMaxAge 86400
}

This is my vhost file

docRoot                   $VH_ROOT/public_html
vhDomain                  $VH_NAME
vhAliases                 www.$VH_NAME
adminEmails               [email protected]
enableGzip                1
enableIpGeo               1

index  {
  useServer               0
  indexFiles              index.php, index.html
}

errorlog $VH_ROOT/logs/$VH_NAME.error_log {
  useServer               0
  logLevel                WARN
  rollingSize             10M
}

accesslog $VH_ROOT/logs/$VH_NAME.access_log {
  useServer               0
  logFormat               "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i""
  logHeaders              5
  rollingSize             10M
  keepDays                10  
  compressArchive         1
}

errorpage 403 {
  url                     403.html
}

errorpage 404 {
  url                     404.html
}

errorpage 500 {
  url                     500.html
}

scripthandler  {
  add                     lsapi:dsgur7242 php
}

extprocessor dsgur7242 {
  type                    lsapi
  address                 UDS://tmp/lshttpd/dsgur7242.sock
  maxConns                10
  env                     LSAPI_CHILDREN=10
  initTimeout             600
  retryTimeout            0
  persistConn             1
  pcKeepAliveTimeout      1
  respBuffer              0
  autoStart               1
  path                    /usr/local/lsws/lsphp80/bin/lsphp
  extUser                 dsgur7242
  extGroup                dsgur7242
  memSoftLimit            2047M
  memHardLimit            2047M
  procSoftLimit           400
  procHardLimit           500
}

phpIniOverride  {
php_admin_value open_basedir "/tmp:$VH_ROOT"
}

module cache {
 storagePath $VH_ROOT/lscache
}

rewrite  {
 enable                  1
  autoLoadHtaccess        1
}

vhssl  {
  keyFile                 /etc/letsencrypt/live/dsguru.net/privkey.pem
  certFile                /etc/letsencrypt/live/dsguru.net/fullchain.pem
  certChain               1
  sslProtocol             24
  enableECDHE             1
  renegProtection         1
  sslSessionCache         1
  enableSpdy              15
  enableStapling           1
  ocspRespMaxAge           86400
}

docRoot $VH_ROOT/public_html
You can change this line to

docRoot $VH_ROOT/public_html/subfolder

But this will stop auto-renewal of SSL. Apart from that you can do this via rewrite rules too.

Is the suggested solution above applicable to my case too please ?

yes, should do.

thank you so much for your support. I really can not tell why but for some reasons, the subdomain seems to be working now even when I have not changed the Vhost config. This is quite puzzling