Snippets

GEORGE LIU Openlitespeed 1.4.7 server /usr/local/lsws/conf/httpd_config.conf and vhost config files /usr/local/lsws/conf/vhosts/h2ohttp2.centminmod.com/vhconf.conf as at April 24, 2015

You are viewing an old version of this snippet. View the current version.
Revised by GEORGE LIU dcc7056
#
# PLAIN TEXT CONFIGURATION FILE
#
serverName                lshttpd
user                      nginx
group                     nginx
priority                  0
inMemBufSize              60M
swappingDir               /tmp/lshttpd/swap
autoFix503                1
gracefulRestartTimeout    300
mime                      $SERVER_ROOT/conf/mime.properties
showVersionNumber         0
adminEmails               root@localhost
adminRoot                 $SERVER_ROOT/admin/

errorlog $SERVER_ROOT/logs/error.log {
  logLevel                DEBUG
  debugLevel              0
  rollingSize             10M
  enableStderrLog         1
}

accesslog $SERVER_ROOT/logs/access.log {
  rollingSize             10M
  keepDays                30
  compressArchive         0
}
indexFiles                index.html index.php
autoIndex                 0

expires  {
  enableExpires           1
  expiresByType           image/*=A604800, text/css=A604800, application/x-javascript=A604800
}

tuning  {
  eventDispatcher         epoll
  SSLCryptoDevice         null
  maxConnections          2000
  maxSSLConnections       1000
  connTimeout             300
  maxKeepAliveReq         1000
  smartKeepAlive          0
  keepAliveTimeout        5
  sndBufSize              0
  rcvBufSize              0
  maxReqURLLen            8192
  maxReqHeaderSize        16380
  maxReqBodySize          2047M
  maxDynRespHeaderSize    8192
  maxDynRespSize          2047M
  maxCachedFileSize       4096
  totalInMemCacheSize     20M
  maxMMapFileSize         256K
  totalMMapCacheSize      40M
  useSendfile             1
  fileETag                28
  enableGzipCompress      1
  enableDynGzipCompress   1
  gzipCompressLevel       6
  compressibleTypes       text/*, application/x-javascript, application/javascript, application/xml, image/svg+xml
  gzipAutoUpdateStatic    1
  gzipCacheDir            /home/nginx/gzipstaticols
  gzipStaticCompressLevel 6
  gzipMaxFileSize         1M
  gzipMinFileSize         300
}

fileAccessControl  {
  followSymbolLink        1
  checkSymbolLink         0
  requiredPermissionMask  000
  restrictedPermissionMask 000
}

perClientConnLimit  {
  staticReqPerSec         0
  dynReqPerSec            0
  outBandwidth            0
  inBandwidth             0
  softLimit               10000
  hardLimit               10000
  gracePeriod             15
  banPeriod               300
}

CGIRLimit  {
  maxCGIInstances         20
  minUID                  11
  minGID                  10
  priority                0
  CPUSoftLimit            10
  CPUHardLimit            50
  memSoftLimit            460M
  memHardLimit            470M
  procSoftLimit           400
  procHardLimit           450
}

accessDenyDir  {
  dir                     /
  dir                     /etc/*
  dir                     /dev/*
  dir                     $SERVER_ROOT/conf/*
  dir                     $SERVER_ROOT/admin/conf/*
}

accessControl  {
  allow                   ALL
}

extprocessor lsphp5 {
  type                    lsapi
  address                 uds://tmp/lshttpd/lsphp.sock
  maxConns                35
  env                     PHP_LSAPI_MAX_REQUESTS=500
  env                     PHP_LSAPI_CHILDREN=35
  initTimeout             60
  retryTimeout            0
  persistConn             1
  respBuffer              0
  autoStart               1
  path                    $SERVER_ROOT/fcgi-bin/lsphp5
  backlog                 100
  instances               1
  priority                0
  memSoftLimit            2047M
  memHardLimit            2047M
  procSoftLimit           400
  procHardLimit           500
}

scripthandler  {
  add                     lsapi:lsphp5 php
}

railsDefaults  {
  railsEnv                1
  maxConns                5
  env                     LSAPI_MAX_REQS=1000
  env                     LSAPI_MAX_IDLE=60
  initTimeout             60
  retryTimeout            0
  pcKeepAliveTimeout      60
  respBuffer              0
  backlog                 50
  runOnStartUp            1
  extMaxIdleTime          300
  priority                3
  memSoftLimit            2047M
  memHardLimit            2047M
  procSoftLimit           500
  procHardLimit           600
}

module modpagespeed {
  param                   <<<END_param
pagespeed on
pagespeed FileCachePath /tmp/lshttpd/pagespeed
pagespeed RewriteLevel CoreFilters
pagespeed XHeaderValue "OLS pagespeed"
pagespeed Domain https://h2ohttp2.centminmod.com
pagespeed Domain http://h2ohttp2.centminmod.com:8108
pagespeed Domain http://h2ohttp2.centminmod.com:8109
pagespeed Domain https://h2ohttp2.centminmod.com:8109
pagespeed LoadFromFile "http://h2ohttp2.centminmod.com:8108" "/home/nginx/domains/h2ohttp2.centminmod.com/public"
pagespeed LoadFromFile "http://h2ohttp2.centminmod.com:8109" "/home/nginx/domains/h2ohttp2.centminmod.com/public"
pagespeed LoadFromFile "https://h2ohttp2.centminmod.com:8109" "/home/nginx/domains/h2ohttp2.centminmod.com/public"
RewriteDeadlinePerFlushMs 100
pagespeed MemcachedThreads 1
pagespeed MemcachedServers "localhost:11211"
pagespeed MemcachedTimeoutUs 100000
pagespeed InPlaceResourceOptimization off
pagespeed JpegRecompressionQualityForSmallScreens 60
pagespeed WebpRecompressionQualityForSmallScreens 60
pagespeed PreserveUrlRelativity on
pagespeed MaxCombinedCssBytes -1
pagespeed ImageResolutionLimitBytes 16777216
pagespeed AvoidRenamingIntrospectiveJavascript on
pagespeed ImageInlineMaxBytes 3072
pagespeed CssImageInlineMaxBytes 0
pagespeed MaxInlinedPreviewImagesIndex -1
pagespeed MinImageSizeLowResolutionBytes 3072
pagespeed EnableFilters collapse_whitespace,remove_comments
pagespeed EnableFilters prioritize_critical_css
pagespeed EnableFilters move_css_to_head
pagespeed EnableFilters move_css_above_scripts
pagespeed EnableFilters combine_css
pagespeed EnableFilters combine_javascript
pagespeed MaxCombinedJsBytes 122900
pagespeed EnableFilters rewrite_css
pagespeed EnableFilters rewrite_javascript
pagespeed EnableFilters inline_preview_images
pagespeed EnableFilters lazyload_images
pagespeed EnableFilters rewrite_images
pagespeed DisableFilters recompress_images
pagespeed DisableFilters extend_cache_images
pagespeed EnableFilters convert_png_to_jpeg
pagespeed EnableFilters convert_jpeg_to_webp
pagespeed EnableFilters convert_to_webp_lossless
  END_param

}

virtualhost Example {
  vhRoot                  $SERVER_ROOT/Example/
  configFile              $SERVER_ROOT/conf/vhosts/Example/vhconf.conf
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              0
}

virtualhost h2ohttp2.centminmod.com {
  vhRoot                  /home/nginx/domains/$VH_NAME/
  configFile              $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
  note                    Instantiated from template PHP_SuEXEC
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              2
}

listener Default {
  address                 *:8098
  secure                  0

  module modpagespeed {
    param                 pagespeed off
    enabled               0
  }
  map                     Example *
  map                     h2ohttp2.centminmod.com h2ohttp2.centminmod.com, h2ohttp2b.centminmod.com, h2ohttp2c.centminmod.com, h2ohttp2d.centminmod.com, h2ohttp2e.centminmod.com, h2ohttp2f.centminmod.com, h2ohttp2g.centminmod.com, h2ohttp2h.centminmod.com, h2ohttp2i.centminmod.com
}

listener SSL HOSTS {
  address                 *:8099
  secure                  1
  keyFile                 $SERVER_ROOT/admin/conf/centminmod.com.key
  certFile                $SERVER_ROOT/admin/conf/centminmod.com-unified.crt
  certChain               1
  CACertPath              $SERVER_ROOT/admin/conf/
  CACertFile              $SERVER_ROOT/admin/conf/centminmod.com-trusted.crt
  sslProtocol             14
  ciphers                 ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!SSLv2:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA:!DES-CBC3-SHA
  enableECDHE             1
  enableDHE               1
  DHParam                 /usr/local/lsws/admin/conf/dhparam4096.pem
  enableStapling          1
  ocspRespMaxAge          86400
  ocspResponder           http://ocsp.comodoca.com
  ocspCACerts             $SERVER_ROOT/admin/conf/centminmod.com-ols_unified.crt

  module modpagespeed {
    param                 pagespeed off
    enabled               0
  }
  map                     h2ohttp2.centminmod.com h2ohttp2.centminmod.com, h2ohttp2b.centminmod.com, h2ohttp2c.centminmod.com, h2ohttp2d.centminmod.com, h2ohttp2e.centminmod.com, h2ohttp2f.centminmod.com, h2ohttp2g.centminmod.com, h2ohttp2h.centminmod.com, h2ohttp2i.centminmod.com
}

listener Pagespeed HTTP {
  address                 *:8108
  secure                  0
  map                     h2ohttp2.centminmod.com h2ohttp2.centminmod.com, h2ohttp2b.centminmod.com, h2ohttp2c.centminmod.com, h2ohttp2d.centminmod.com, h2ohttp2e.centminmod.com, h2ohttp2f.centminmod.com, h2ohttp2g.centminmod.com, h2ohttp2h.centminmod.com, h2ohttp2i.centminmod.com
}

listener Pagespeed HTTPS {
  address                 *:8109
  secure                  1
  keyFile                 $SERVER_ROOT/admin/conf/centminmod.com.key
  certFile                $SERVER_ROOT/admin/conf/centminmod.com-unified.crt
  certChain               1
  CACertPath              $SERVER_ROOT/admin/conf/
  CACertFile              $SERVER_ROOT/admin/conf/centminmod.com-trusted.crt
  sslProtocol             14
  ciphers                 ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:EC DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDH E-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RS A-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:EC DHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AE S128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDH E-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES25 6-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES12 8-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AE S256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:A ES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA :!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!SSLv2:!PSK:!aECDH:!ED H-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA: !CAMELLIA:!DES-CBC3-SHA
  enableECDHE             1
  enableDHE               1
  DHParam                 /usr/local/lsws/admin/conf/dhparam4096.pem
  enableStapling          1
  ocspRespMaxAge          86400
  ocspResponder           http://ocsp.comodoca.com
  ocspCACerts             $SERVER_ROOT/admin/conf/centminmod.com-ols_unified.crt
  map                     h2ohttp2.centminmod.com h2ohttp2.centminmod.com, h2ohttp2b.centminmod.com, h2ohttp2c.centminmod.com, h2ohttp2d.centminmod.com, h2ohttp2e.centminmod.com, h2ohttp2f.centminmod.com, h2ohttp2g.centminmod.com, h2ohttp2h.centminmod.com, h2ohttp2i.centminmod.com
}

vhTemplate centralConfigLog {
  templateFile            $SERVER_ROOT/conf/templates/ccl.conf
  listeners               Default
}

vhTemplate PHP_SuEXEC {
  templateFile            $SERVER_ROOT/conf/templates/phpsuexec.conf
  listeners               Default
}

vhTemplate EasyRailsWithSuEXEC {
  templateFile            $SERVER_ROOT/conf/templates/rails.conf
  listeners               Default
}
docRoot                   $VH_ROOT/public/
enableGzip                1

errorlog $VH_ROOT/log/ols_vhost.log {
  useServer               0
  logLevel                WARN
  rollingSize             100M
}

accesslog $SERVER_ROOT/logs/$VH_NAME.access.log {
  useServer               0
  logHeaders              3
  rollingSize             100M
  keepDays                30
  compressArchive         1
}

index  {
  useServer               0
  indexFiles              index.html index.php
  autoIndex               0
  autoIndexURI            /_autoindex/default.php
}

scripthandler  {
  add                     lsapi:$VH_NAME_lsphp php
}

expires  {
  enableExpires           1
  expiresByType           image/*=A604800, text/css=A604800, application/x-javascript=A604800, text/html=A900
}

accessControl  {
  allow                   *
}

extprocessor $VH_NAME_lsphp {
  type                    lsapi
  address                 uds://tmp/lshttpd/$VH_NAME_lsphp.sock
  maxConns                5
  initTimeout             60
  retryTimeout            0
  persistConn             1
  pcKeepAliveTimeout      30
  respBuffer              0
  autoStart               1
  path                    $SERVER_ROOT/fcgi-bin/lsphp
  backlog                 10
  instances               5
  runOnStartUp            0
  extMaxIdleTime          60
  priority                0
  memSoftLimit            100M
  memHardLimit            150M
  procSoftLimit           100
  procHardLimit           200
}

context /cgi-bin/ {
  type                    cgi
  location                $VH_ROOT/cgi-bin/
}

context / {
  type                    NULL
  location                $VH_ROOT/public
  allowBrowse             1
  enableExpires           1
  extraHeaders            Cache-Control: public, must-revalidate, proxy-revalidate
  addDefaultCharset       on
  defaultCharsetCustomized utf-8
}

rewrite  {
  enable                  1
  logLevel                0
}
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.