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 } 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 } context /.well-known/acme-challenge { location /usr/local/lsws/Example/html/.well-known/acme-challenge allowBrowse 1 rewrite { enable 0 } addDefaultCharset off phpIniOverride { } } """ 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 } 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 } context /.well-known/acme-challenge { location /usr/local/lsws/Example/html/.well-known/acme-challenge allowBrowse 1 rewrite { enable 0 } addDefaultCharset off phpIniOverride { } } """ lswsMasterConf = """ ServerName {virtualHostName} ServerAlias www.{virtualHostName} ServerAdmin {administratorEmail} SuexecUserGroup {externalApp} {externalApp} DocumentRoot /home/{virtualHostName}/public_html Alias /.well-known/acme-challenge /usr/local/lsws/Example/html/.well-known/acme-challenge 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} Alias /.well-known/acme-challenge /usr/local/lsws/Example/html/.well-known/acme-challenge 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/ Alias /.well-known/acme-challenge /usr/local/lsws/Example/html/.well-known/acme-challenge 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 {SSLBase}.fullchain.pem SSLCertificateKeyFile {SSLBase}.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 {SSLBase}.fullchain.pem SSLCertificateKeyFile {SSLBase}.privkey.pem """ proxyApacheBackend = """extprocessor apachebackend { type proxy address http://127.0.0.1:8083 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 } context /.well-known/acme-challenge { location /usr/local/lsws/Example/html/.well-known/acme-challenge allowBrowse 1 rewrite { enable 0 } addDefaultCharset off phpIniOverride { } } 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 } }'""" OLSPPConf = """ ### PASSWORD PROTECTION CONF STARTS {{path}} realm {{RealM_Name}} { userDB { location {{PassFile}} } } context / { location {{path}} allowBrowse 1 realm {{RealM_Name}} rewrite { } addDefaultCharset off phpIniOverride { } } ### PASSWORD PROTECTION CONF ENDS {{path}} """ LSWSPPProtection = """ ### PASSWORD PROTECTION CONF STARTS {{path}} AuthType Basic AuthName "{{RealM_Name}}" AuthUserFile {{PassFile}} Require valid-user ### PASSWORD PROTECTION CONF ENDS {{path}} """