class vhostConfs: olsMasterMainConf = """virtualHost {virtualHostName} { vhRoot /home/$VH_NAME configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhost.conf allowSymbolLink 1 enableScript 1 restrained 1 } """ olsMasterConf = """docRoot $VH_ROOT/public_html vhDomain $VH_NAME vhAliases www.$VH_NAME adminEmails {adminEmails} 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:{virtualHostUser} php } extprocessor {virtualHostUser} { type lsapi address UDS://tmp/lshttpd/{virtualHostUser}.sock maxConns 10 env LSAPI_CHILDREN=10 initTimeout 600 retryTimeout 0 persistConn 1 pcKeepAliveTimeout 1 respBuffer 0 autoStart 1 path /usr/local/lsws/lsphp{php}/bin/lsphp extUser {virtualHostUser} extGroup {virtualHostUser} memSoftLimit 2047M memHardLimit 2047M procSoftLimit 400 procHardLimit 500 } phpIniOverride { {open_basedir} } module cache { storagePath /usr/local/lsws/cachedata/$VH_NAME } rewrite { enable 1 autoLoadHtaccess 1 } """ olsChildMainConf = """virtualHost {virtualHostName} { vhRoot /home/{masterDomain} configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhost.conf allowSymbolLink 1 enableScript 1 restrained 1 } """ olsChildConf = """docRoot {path} vhDomain $VH_NAME vhAliases www.$VH_NAME adminEmails {adminEmails} enableGzip 1 enableIpGeo 1 index { useServer 0 indexFiles index.php, index.html } errorlog $VH_ROOT/logs/{masterDomain}.error_log { useServer 0 logLevel WARN rollingSize 10M } accesslog $VH_ROOT/logs/{masterDomain}.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 } phpIniOverride { {open_basedir} } module cache { storagePath /usr/local/lsws/cachedata/$VH_NAME } errorpage 403 { url 403.html } errorpage 404 { url 404.html } errorpage 500 { url 500.html } scripthandler { add lsapi:{externalApp} php } extprocessor {externalApp} { type lsapi address UDS://tmp/lshttpd/{externalApp}.sock maxConns 10 env LSAPI_CHILDREN=10 initTimeout 60 retryTimeout 0 persistConn 1 pcKeepAliveTimeout 1 respBuffer 0 autoStart 1 path /usr/local/lsws/lsphp{php}/bin/lsphp extUser {externalAppMaster} extGroup {externalAppMaster} memSoftLimit 2047M memHardLimit 2047M procSoftLimit 400 procHardLimit 500 } rewrite { enable 1 autoLoadHtaccess 1 } """ lswsMasterConf = """ ServerName {virtualHostName} ServerAlias www.{virtualHostName} ServerAdmin {administratorEmail} SuexecUserGroup {externalApp} {externalApp} DocumentRoot /home/{virtualHostName}/public_html CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined AddHandler application/x-httpd-php{php} .php .php7 .phtml CacheRoot lscache CacheLookup on """ lswsChildConf = """ ServerName {virtualHostName} ServerAlias www.{virtualHostName} ServerAdmin {administratorEmail} SuexecUserGroup {externalApp} {externalApp} DocumentRoot {path} CustomLog /home/{masterDomain}/logs/{masterDomain}.access_log combined AddHandler application/x-httpd-php{php} .php .php7 .phtml CacheRoot lscache CacheLookup on """ apacheConf = """ ServerName {virtualHostName} ServerAlias www.{virtualHostName} ServerAdmin {administratorEmail} SuexecUserGroup {externalApp} {externalApp} DocumentRoot /home/{virtualHostName}/public_html/ ProxySet disablereuse=off SetHandler proxy:fcgi://php-fpm-{externalApp} #CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined #AddHandler application/x-httpd-php{php} .php .php7 .phtml Options Indexes FollowSymLinks AllowOverride all Require all granted DirectoryIndex index.html index.php """ apacheConfSSL = """ ServerName {virtualHostName} ServerAlias www.{virtualHostName} ServerAdmin {administratorEmail} SuexecUserGroup {externalApp} {externalApp} DocumentRoot /home/{virtualHostName}/public_html/ ProxySet disablereuse=off SetHandler proxy:fcgi://php-fpm-{externalApp} #CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined #AddHandler application/x-httpd-php{php} .php .php7 .phtml Options Indexes FollowSymLinks AllowOverride all Require all granted DirectoryIndex index.html index.php SSLEngine on SSLVerifyClient none SSLCertificateFile /etc/httpd/conf.d/ssl/{virtualHostName}.fullchain.pem SSLCertificateKeyFile /etc/httpd/conf.d/ssl/{virtualHostName}.privkey.pem """ apacheConfChild = """ ServerName {virtualHostName} ServerAlias www.{virtualHostName} ServerAdmin {administratorEmail} SuexecUserGroup {externalApp} {externalApp} DocumentRoot {path} ProxySet disablereuse=off SetHandler proxy:fcgi://php-fpm-{externalApp} #CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined #AddHandler application/x-httpd-php{php} .php .php7 .phtml Options Indexes FollowSymLinks AllowOverride all Require all granted DirectoryIndex index.html index.php """ apacheConfChildSSL = """ ServerName {virtualHostName} ServerAlias www.{virtualHostName} ServerAdmin {administratorEmail} SuexecUserGroup {externalApp} {externalApp} DocumentRoot {path} ProxySet disablereuse=off SetHandler proxy:fcgi://php-fpm-{externalApp} #CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined #AddHandler application/x-httpd-php{php} .php .php7 .phtml Options Indexes FollowSymLinks AllowOverride all Require all granted DirectoryIndex index.html index.php SSLEngine on SSLVerifyClient none SSLCertificateFile /etc/httpd/conf.d/ssl/{virtualHostName}.fullchain.pem SSLCertificateKeyFile /etc/httpd/conf.d/ssl/{virtualHostName}.privkey.pem """ proxyApacheBackend = """extprocessor apachebackend { type proxy address http://127.0.0.1:8081 maxConns 100 pcKeepAliveTimeout 60 initTimeout 60 retryTimeout 0 respBuffer 0 } """ proxyApacheBackendSSL = """extprocessor proxyApacheBackendSSL { type proxy address https://127.0.0.1:8082 maxConns 100 pcKeepAliveTimeout 60 initTimeout 60 retryTimeout 0 respBuffer 0 } """ OLSLBConf = """docRoot $VH_ROOT/public_html vhDomain $VH_NAME vhAliases www.$VH_NAME adminEmails {adminEmails} 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 } rewrite { enable 1 rules << CacheRoot lscache } }'""" lswsRediConfMasterWWW = """"vhost:{virtualHostName}" '{ "username": "{externalApp}", "documentRoot": "/home/{master}/public_html", "vh_root": "/home/{master}", "uid": {uid}, "gid": {gid}, "phpVersion": {php}, "custom_conf": { ServerAdmin {administratorEmail} CustomLog /home/{master}/logs/{master}.access_log combined CacheRoot lscache } }'""" lswsRediConfChild = """"vhost:{virtualHostName}" '{ "username": "{externalApp}", "documentRoot": "{path}", "vh_root": "{path}", "uid": {uid}, "gid": {gid}, "phpVersion": {php}, "custom_conf": { ServerAdmin {administratorEmail} CustomLog /home/{masterDomain}/logs/{masterDomain}.access_log combined CacheRoot /home/{masterDomain}/lscache } }'""" lswsRediConfChildWWW = """"vhost:{virtualHostName}" '{ "username": "{externalApp}", "documentRoot": "{path}", "vh_root": "{path}", "uid": {uid}, "gid": {gid}, "phpVersion": {php}, "custom_conf": { ServerAdmin {administratorEmail} CustomLog /home/{masterDomain}/logs/{masterDomain}.access_log combined CacheRoot /home/{masterDomain}/lscache } }'"""