|CUSTOM1|
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|

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

|?OBDP1=|
|*if PHP1_RELEASE!="0"|
|?OBDP1=:/usr/local/php`PHP1_RELEASE`/lib/php/|
|*endif|
|?OBDP2=|
|*if PHP2_RELEASE!="0"|
|?OBDP2=:/usr/local/php`PHP2_RELEASE`/lib/php/|
|*endif|

|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/opt/alt/php`PHP1_RELEASE`/usr/share/pear/:/dev/urandom:/usr/local/lib/php/`OBDP1``OBDP2`|

|?FASTCGI_OPENBASEDIR=|
|*if OPEN_BASEDIR_ENABLED="ON"|
|?FASTCGI_OPENBASEDIR=-d open_basedir="`OPEN_BASEDIR_PATH`"|
|*endif|

|?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`|
|?FASTCGI_SENDMAIL_FROM=-d sendmail_from="`PHP_EMAIL`"|

|?ALLOW_OVERRIDE=AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None|
|?COMBINED_LOG=combined|

<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
|CUSTOM|
|?SDOCROOT=`DOCROOT`/`SUB`|
|?CGI=ScriptAlias /cgi-bin/ `SDOCROOT`/cgi-bin/|
	ServerName www.|SUB|.|HOST_DOMAIN|
	ServerAlias www.|SUB|.|HOST_DOMAIN| |SUB|.|HOST_DOMAIN| |SERVER_ALIASES|
	ServerAdmin |ADMIN|
	DocumentRoot |SDOCROOT|
	|CGI|

	|USECANONICALNAME|

	|FORCE_SSL_REDIRECT|
|UNIT_PROXY|

	<IfModule !mod_ruid2.c>
		SuexecUserGroup |USER| |GROUP|
	</IfModule>
	|*if HAVE_RUID2="1"|
	<IfModule mod_ruid2.c>
		RMode config
		RUidGid |USER| |GROUP|
		#RGroups apache |SECURE_ACCESS_GROUP|
		RGroups @none
	</IfModule>
	|*endif|
	|*if RUID2_AND_MOD_SECURITY="1"|
	<IfModule mod_security2.c>
		SecAuditLogStorageDir |MODSEC_AUDIT_DIR|/|USER|
	</IfModule>
	|*endif|

	CustomLog |APACHELOGDIR|/|DOMAIN|.|SUB|.bytes bytes
	CustomLog |APACHELOGDIR|/|DOMAIN|.|SUB|.log |COMBINED_LOG|
	ErrorLog |APACHELOGDIR|/|DOMAIN|.|SUB|.error.log

	|*if SUSPENDED_REASON|
	<IfModule mod_env.c>
		SetEnv reason |SUSPENDED_REASON|
	</IfModule>
	|*endif|

|*if HAVE_PHP1_FPM_OLD="1"|
	#Make sure you're running Apache 2.4.10 or newer.
|*endif|

|*if HAVE_PHP2_FPM_OLD="1"|
	#Make sure you're running Apache 2.4.10 or newer.
|*endif|
|CUSTOM2|
	<Directory |SDOCROOT|>
|CUSTOM3|
|*if CGI=""|
		|ALLOW_OVERRIDE|
		Options -ExecCGI -Includes +IncludesNOEXEC
|*endif|
|*if HAVE_PHP1_FPM="1"|
		<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
			<If "-f %{REQUEST_FILENAME}">
				#ProxyErrorOverride on
				AddHandler "proxy:unix:/usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .inc .php .phtml .php|PHP1_RELEASE|
			</If>
		</FilesMatch>
|*endif|
|*if HAVE_PHP2_FPM="1"|
		<FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
			<If "-f %{REQUEST_FILENAME}">
				#ProxyErrorOverride on
				AddHandler "proxy:unix:/usr/local/php|PHP2_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .php|PHP2_RELEASE|
			</If>
		</FilesMatch>
|*endif|

|*if HAVE_PHP1_FCGI="1"|
		<IfModule mod_fcgid.c>
			FCGIWrapper '/usr/local/safe-bin/fcgid|PHP1_RELEASE|.sh /usr/local/directadmin/data/users/|USER|/php/|DOMAIN|.ini |JAIL_TRUE_FALSE| |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR||FASTCGI_PHP_SETTINGS| |PHP_MAIL_LOG|' .php
			<FilesMatch "\.php$">
				SetHandler fcgid-script
				Options +ExecCGI
			</FilesMatch>
		</IfModule>
|*endif|
|*if HAVE_PHP2_FCGI="1"|
		<IfModule mod_fcgid.c>
			FCGIWrapper '/usr/local/safe-bin/fcgid|PHP2_RELEASE|.sh /usr/local/directadmin/data/users/|USER|/php/|DOMAIN|.ini |JAIL_TRUE_FALSE| |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR||FASTCGI_PHP_SETTINGS| |PHP_MAIL_LOG|' .php|PHP2_RELEASE|
			<FilesMatch "\.php|PHP2_RELEASE|$">
				SetHandler fcgid-script
				Options +ExecCGI
			</FilesMatch>
		</IfModule>
|*endif|
|IF_MODULE_LITESPEED_OPEN|
|*if HAVE_SAFE_MODE="1"|
		php_admin_flag safe_mode |SAFE_MODE|
|*endif|
|*if CLI="1"|
		php_admin_flag engine |PHP|
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |PHP_EMAIL|'
		|CLI_PHP_MAIL_LOG|
		|CLI_PHP_SETTINGS|
|*endif|
|*if OPEN_BASEDIR="ON"|
		php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|IF_MODULE_LITESPEED_CLOSE|
|*if HAVE_PHP1_CLI="1"|
		<FilesMatch "\.php$">
			AddHandler application/x-httpd-php|LSPHP1_RELEASE| .php
		</FilesMatch>
|*endif|
|*if HAVE_PHP2_CLI="1"|
		<FilesMatch "\.php|PHP2_RELEASE|$">
			AddHandler application/x-httpd-php|LSPHP2_RELEASE| .php|PHP2_RELEASE|
		</FilesMatch>
|*endif|
|*if SUPHP="1"|
		suPHP_Engine |PHP|
		suPHP_UserGroup |USER| |GROUP|
|*endif|
|*if HAVE_PHP1_SUPHP="1"|
		<FilesMatch "\.php$">
			AddHandler x-httpd-php|PHP1_RELEASE| .php
		</FilesMatch>
|*endif|
|*if HAVE_PHP2_SUPHP="1"|
		<FilesMatch \.php|PHP2_RELEASE|$>
			AddHandler x-httpd-php|PHP2_RELEASE| .php|PHP2_RELEASE|
		</FilesMatch>
|*endif|
|MOD_SECURITY_RULES|
	</Directory>

|*if USE_HOSTNAME_FOR_ALIAS="1"|
      RewriteEngine on
      RewriteOptions inherit
|*endif|

|*if WEBSERVER="litespeed"|
		<IfModule Litespeed>
			CacheRoot lscache
|BUBBLE_WRAP|
		</IfModule>
|*endif|

|HANDLERS|
|MIMETYPES|
|HOTLINK_PROTECTION|
|CUSTOM4|
</VirtualHost>
