Number of Virtual host and error MIME type [application/x-httpd-php] for suffix '.php' does not allow serving as static file, access denied!

#1
Hi,

We use OpenLiteSpeed to host .php website.
We have create a Virtual Host template (conf file below). And we add new virtual host to this template.
10 websites work well as a member of this template.

When we add an eleventh site to this template we have the following error:
MIME type [application/x-httpd-php] for suffix '.php' does not allow serving as static file, access denied!
On website we saw a 403 error.

If we change the order of the websites in /usr/local/lsws/conf/http_config.conf.
Only the last one has the 403 error.

Is there a limitation on members number ?
LSAPI limitation on number of lsphp running process ?
Limitation on the .sock number of connection ?

Any help is welcome.

Regards,
Seb.

OS Release:
Code:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
UBUNTU_CODENAME=jammy

LiteSpeed :
Code:
LiteSpeed/1.7.16 Open (BUILD built: Thu Nov 17 16:18:46 UTC 2022)
    module versions:
    lsquic 3.1.1
    modgzip 1.1
    cache 1.64
    mod_security 1.4

Virtual Host template :

Code:
vhRoot                    /www/$VH_NAME/
configFile                /www/$VH_NAME/conf/vhconf.conf
allowSymbolLink           1
enableScript              1
restrained                1
staticReqPerSec           40
dynReqPerSec              2
outBandwidth              100000000

virtualHostConfig  {
  docRoot                 /www/$VH_NAME/html/
  enableGzip              1

  errorlog /www/$VH_NAME/logs/error.log {
    useServer             0
    logLevel              WARN
    rollingSize           128M
    keepDays              30
    compressArchive       1
  }

  accesslog /www/$VH_NAME/logs/access.log {
    useServer             0
    logFormat             "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"
    logHeaders            7
    rollingSize           128M
    keepDays              10
    compressArchive       1
  }

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

  scripthandler  {
    add                   lsapi:$VH_NAME-lsphp php
  }

  phpIniOverride  {
php_value post_max_size 64M
php_value memory_limit 128M
php_value max_execution_time 30
php_value max_input_time 60
php_value upload_max_filesize 64M
php_value max_file_uploads 100
  }

  accessControl  {
    allow                 ALL
  }

  lsrecaptcha  {
    type                  0
  }

  extprocessor $VH_NAME-lsphp {
    type                  lsapi
    address               uds://tmp/lshttpd/lsphp81.sock
    maxConns              10
    env                   PHP_LSAPI_CHILDREN=10
    env                   PHP_LSAPI_AVOID_FORK=1
    env                   PHP_LSAPI_MAX_IDLE=300
    env                   PHP_LSAPI_MAX_REQUESTS=1000
    initTimeout           60
    retryTimeout          0
    persistConn           1
    respBuffer            0
    autoStart             2
    path                  lsphp81/bin/lsphp
    backlog               100
    instances             1
    memSoftLimit          2047M
    memHardLimit          2047M
    procSoftLimit         400
    procHardLimit         500
  }

  context / {
    location              $DOC_ROOT/
    allowBrowse           1
    enableExpires         1
    rewrite  {
RewriteFile .htaccess
    }
    addDefaultCharset     off
  }

  rewrite  {
    enable                1
    autoLoadHtaccess      1
  }

  vhssl  {
    keyFile               /etc/letsencrypt/live/$VH_NAME/privkey.pem
    certFile              /etc/letsencrypt/live/$VH_NAME/fullchain.pem
    certChain             1
  }

  module cache {
storagePath /www/$VH_NAME/cache
checkPrivateCache   1
checkPublicCache    1
maxCacheObjSize     10000000
maxStaleAge         200
qsCache             1
reqCookieCache      1
respCookieCache     1
ignoreReqCacheCtrl  1
ignoreRespCacheCtrl 0

enableCache         0
expireInSeconds     3600
enablePrivateCache  0
privateExpireInSeconds 3600
    ls_enabled            1
  }
}
 
Last edited:

Cold-Egg

Administrator
#2
Hi,
I don't think there's a limit. Also, the template config should be under /usr/local/lsws/conf/templates folder. Are you sure it's a template config? Or it's a general virtual host?
I tried to generate more than 10 domains from template config, and it works.
 
#3
Hi,
Thanks for your answer.
Yes. My template file is in this directory.
It work great for 10 members :) but no once more.
Maybe a limitation on user nobody, on proc lsphp81 or on ubuntu … ram reservation…
I watch processes with ulimit but all seems normal. Server as 2 Go of Memory used at 50%.

seb
 
#4
Hi,

Find new errors today :
Code:
2022-12-23 13:24:00.522327 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341 instead.
2022-12-23 13:24:00.522331 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342 is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341.655342 instead.
2022-12-23 13:24:00.522334 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343 is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343 instead.
2022-12-23 13:24:00.522336 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344 is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344 instead.
2022-12-23 13:24:00.522339 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345 is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345 instead.
2022-12-23 13:24:00.522341 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346 is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346 instead.
2022-12-23 13:24:00.522344 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346.655347 is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346.655347 instead.
2022-12-23 13:24:00.522347 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346.655347.655348 is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346.655347.655348 instead.
2022-12-23 13:24:00.522349 [INFO] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346.655347.655348.655349 is used, will try use uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346.655347.655348.655349 instead.

2022-12-23 13:24:00.522351 [ERROR] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:epsr:www.domain.fr-lsphp81.655340] socket address uds://tmp/lshttpd/lsphp81.sock.655341.655342.655343.655344.655345.655346.6553
47.655348.655349 is used, give up!
2022-12-23 13:24:00.522382 [ERROR] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:scripthandler:add] HttpMime::addMimeHandler getHandler with name www.domain.fr-lsphp81 ret (nil)
2022-12-23 13:24:00.522386 [ERROR] [32785] [config:template:www.domain.fr:vhost:www.domain.fr:scripthandler:add] use static file handler for suffix [php]
I keep looking ...

Seb
 
#7
Hi,
I have retest with uds://tmp/lshttpd/lsphp81-$VH_NAME.sock today.
It works ! Your right. Thanks.

There might have been another error when I tested this solution.

Thanks a lot.
Seb.
 
Top