|CUSTOM1|

|?PUBLIC_HTML=public_html|
|?VH_PORT=`PORT_80`|
|*if SSL_TEMPLATE="1"|
|?PUBLIC_HTML=private_html|
|?VH_PORT=`PORT_443`|
|*endif|

|?DOCROOT=`HOME`/domains/`DOMAIN`/`PUBLIC_HTML`|
|?PUB_DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?REALDOCROOT=`DOCROOT`|

|?HOST_DOMAIN=`DOMAIN`|
|*if HOST_POINTER|
|?HOST_DOMAIN=`HOST_POINTER`|
|*endif|
|?SDOMAIN=`HOST_DOMAIN`|
|?LOG_NAME=`DOMAIN`|

|*if SUB|
|?SDOMAIN=`SUB`.`HOST_DOMAIN`|
|?LOG_NAME=`DOMAIN`.`SUB`|
|*endif|

|?VHROOT=`HOME`|

|?SCRIPTHANDLER=lsphp`PHP1_RELEASE`|

|?SSLPROTOCOL=24|

|?OBDP1=|
|*if PHP1_RELEASE!="0"|
|?OBDP1=:/usr/local/php`PHP1_RELEASE`/lib/php/|
|*endif|
|?OBDP2=|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/opt/alt/php`PHP1_RELEASE`/usr/share/pear/:/dev/urandom:/usr/local/lib/php/`OBDP1``OBDP2`|

|?PHP_MAIL_LOG=|
|?CLI_PHP_MAIL_LOG=|
|*if PHP_MAIL_LOG_ENABLED="1"|
|?PHP_MAIL_LOG=-d mail.log="`PHP_MAIL_LOG_DIR`/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log `PHP_MAIL_LOG_DIR`/php-mail.log|
|*endif|

|?PHP_EMAIL=`USER`@`DOMAIN`|

virtualHost |SDOMAIN|-|VH_PORT| {
|CUSTOM|
|?SDOCROOT=`DOCROOT`/`SUB`|
|*if SUB|
|?DOCROOT=`SDOCROOT`|
|*endif|
  user                    |USER|
  group                   |GROUP|
  vhRoot                  |VHROOT|
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              2
  # listeners  listener1, listener2, listener3
  listeners |LISTENERS|
  
  #VirtualHost config settings
  docRoot                   |DOCROOT|
  vhDomain                  |SDOMAIN|
|*if WILDCARD_VHALIASES|
  vhAliases                 |WILDCARD_VHALIASES|
|*else|
  vhAliases                 www.|SDOMAIN||SERVER_ALIASES|
|*endif|
  adminEmails               |ADMIN|
  enableGzip                1
  enableIpGeo               1

  errorlog |APACHELOGDIR|/|LOG_NAME|.error.log {
    useServer               0
    logLevel                NOTICE
    rollingSize             0
  }
  accesslog |APACHELOGDIR|/|LOG_NAME|.log {
    useServer               0
	logFormat               %a %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"
    logHeaders              5
    rollingSize             0
  }
  accesslog |APACHELOGDIR|/|LOG_NAME|.bytes {
    useServer               0
    logFormat               %O %I
    rollingSize             0
  }

  scripthandler  {
    |CUSTOM2|
    add                     lsapi:|SCRIPTHANDLER| inc
    add                     lsapi:|SCRIPTHANDLER| php
    add                     lsapi:|SCRIPTHANDLER| phtml
    add                     lsapi:|SCRIPTHANDLER| php|PHP1_RELEASE|
  }

  phpIniOverride  {
    |CUSTOM4|
    php_admin_flag engine |PHP|
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f |PHP_EMAIL|"
  |*if OPEN_BASEDIR_ENABLED="ON"|
    php_admin_value open_basedir "|OPEN_BASEDIR_PATH|"
  |*endif|
    |CLI_PHP_MAIL_LOG|
	|CLI_PHP_SETTINGS|
  |*if HAVE_SAFE_MODE="1"|
    php_admin_flag safe_mode |SAFE_MODE|
  |*endif|
  }

  rewrite  {
    enable                  1
    autoLoadHtaccess        1
    |FORCE_SSL_REDIRECT|
    |UNIT_PROXY|
    |OPENLITESPEED_REDIRECTS|
    |HOTLINK_PROTECTION|
    |CUSTOM5|
  }

|CONTEXTS|
|REALMS|

  |*if SSL_TEMPLATE="1"|
  vhssl  {
    |CUSTOM6|
    keyFile                 |KEY|
    certFile                |CERT|
    certChain               1
    sslProtocol             |SSLPROTOCOL|
  }
  |*endif|

  # include aliases
  include /usr/local/lsws/conf/httpd-alias.conf

|MOD_SECURITY_RULES|
|BUBBLE_WRAP|

  |CUSTOM7|
}
|CUSTOM8|
