Virtual host files

Fred.

Verified User
Joined
Sep 5, 2009
Messages
216
Hi,

I switched to SSL on some of my websites. When I did that some of my sub-domains were not working anymore.
I've been messing around with my virtual host files but I can't find out what's wrong.
It's probably something stupid.

I have the following directory structure

for domains
Code:
/home/admin/domains/domain.com/private_html/
and for subdomains
Code:
/home/admin/domains/domain.com/subdomains/private_html/

When I restart Apache I see the following error

Code:
AH00112: Warning: DocumentRoot [/home/admin/domains/domain.com/private_html/mysubdomain] does not exist

It looks like Apache is not using my custom configuration?

my custom virtual_host2_secure_sub.conf

Code:
?CGI=ScriptAlias /cgi-bin/ `HOME`/domains/`DOMAIN`/subdomains/`SUB`/cgi-bin/|
|?DOCROOT=`HOME`/domains/`DOMAIN`/subdomains/`SUB`|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/subdomains/`SUB`/private_html/|

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

|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/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="`HOME`/.php/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log `HOME`/.php/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,Includes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None|

<VirtualHost |IP|:|PORT_443| |MULTI_IP|>
|CUSTOM|
	SSLEngine on
	SSLCertificateFile |CERT|
	SSLCertificateKeyFile |KEY|
	|CAROOT|	

	ServerName www.|SUB|.|DOMAIN|
	ServerAlias www.|SUB|.|DOMAIN| |SUB|.|DOMAIN| |SERVER_ALIASES|
	ServerAdmin |ADMIN|
	DocumentRoot |DOCROOT|/subdomains/|SUB|/private_html/
	|CGI|

	|USECANONICALNAME|

	<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|

	CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.bytes bytes
	CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.log combined
	ErrorLog /var/log/httpd/domains/|DOMAIN|.|SUB|.error.log

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

|*if HAVE_PHP1_FPM="1"|
	<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
		AddHandler "proxy:fcgi://php-fpm|PHP1_RELEASE|.|USER|/" .inc .php .phtml .php|PHP1_RELEASE|
	</FilesMatch> 
|*endif|

|*if HAVE_PHP2_FPM="1"|
	<FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
		AddHandler "proxy:fcgi://php-fpm|PHP2_RELEASE|.|USER|/" .php|PHP2_RELEASE|
	</FilesMatch>
|*endif|

|*if HAVE_PHP1_FPM_OLD="1"|
	<IfModule mod_fastcgi.c>
		<FilesMatch "\.php$">
			SetHandler php|PHP1_RELEASE|-fcgi
		</FilesMatch>

		Alias /php|PHP1_RELEASE|-bin |REALDOCROOT|/php|PHP1_RELEASE|-fpm-ssl
	</IfModule>
|*endif|

|*if HAVE_PHP2_FPM_OLD="1"|
	<IfModule mod_fastcgi.c>
		<FilesMatch \.php|PHP2_RELEASE|$>
			SetHandler php|PHP2_RELEASE|-fcgi
		</FilesMatch>

		Alias /php|PHP2_RELEASE|-bin |REALDOCROOT|/php|PHP2_RELEASE|-fpm-ssl
	</IfModule>
|*endif|

	<Directory |DOCROOT|>
|*if CGI=""|
		|ALLOW_OVERRIDE|
		Options -ExecCGI
|*endif|
|*if HAVE_PHP1_FPM_OLD="1"|
		<IfModule mod_rewrite.c>
			RewriteEngine on
			RewriteOptions InheritBefore
			RewriteBase /
			RewriteCond %{REQUEST_URI} ^/php|PHP1_RELEASE|-bin(.*)
			RewriteRule . - [L]
		</IfModule>
|*endif|
|*if HAVE_PHP2_FPM_OLD="1"| 
		<IfModule mod_rewrite.c>
			RewriteEngine on
			RewriteOptions InheritBefore
			RewriteBase /
			RewriteCond %{REQUEST_URI} ^/php|PHP2_RELEASE|-bin(.*)
			RewriteRule . - [L]
		</IfModule>
|*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 |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR| |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 |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR| |PHP_MAIL_LOG|' .php|PHP2_RELEASE|
			<FilesMatch "\.php|PHP2_RELEASE|$">
				SetHandler fcgid-script
				Options +ExecCGI
			</FilesMatch>
		</IfModule>
|*endif|
|*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|
|*endif|
|*if OPEN_BASEDIR="ON"|
		php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
		suPHP_Engine |PHP|
		suPHP_UserGroup |USER| |GROUP|
|*endif|
	</Directory>

|?ADD_REWRITE_INHERIT=no|
|*if HAVE_PHP_FCGI="1"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|?ADD_CLI_INHERIT=yes|

|*if HAVE_PHP1_FPM="1"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if CLI!="1"|
	|?ADD_CLI_INHERIT=no|
|*endif|
|*if USE_HOSTNAME_FOR_ALIAS!="1"|
	|?ADD_CLI_INHERIT=no|
|*endif|
|*if ADD_CLI_INHERIT="yes"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if ADD_REWRITE_INHERIT="yes"|
	RewriteEngine on
	RewriteOptions inherit
|*endif|

|HANDLERS|
|MIMETYPES|

</VirtualHost>

and my custom virtual_host2_secure.conf

Code:
?CGI=ScriptAlias /cgi-bin/ `HOME`/domains/`DOMAIN`/cgi-bin/|
|?DOCROOT=`HOME`/domains/`DOMAIN`/private_html/|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/private_html/|

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

|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/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="`HOME`/.php/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log `HOME`/.php/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,Includes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None|

<VirtualHost |IP|:|PORT_443| |MULTI_IP|>
|CUSTOM|
	SSLEngine on
	SSLCertificateFile |CERT|
	SSLCertificateKeyFile |KEY|
	|CAROOT|

	ServerName www.|DOMAIN|
	ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
	ServerAdmin |ADMIN|
	DocumentRoot |DOCROOT|/subdomains/|SUB|/private_html/
	|CGI|

	|USECANONICALNAME|

	<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|

	CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
	CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
	ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log

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

|*if HAVE_PHP1_FPM="1"|
	<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
		AddHandler "proxy:fcgi://php-fpm|PHP1_RELEASE|.|USER|/" .inc .php .phtml .php|PHP1_RELEASE|
	</FilesMatch> 
|*endif|

|*if HAVE_PHP2_FPM="1"|
	<FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
		AddHandler "proxy:fcgi://php-fpm|PHP2_RELEASE|.|USER|/" .php|PHP2_RELEASE|
	</FilesMatch>
|*endif|

|*if HAVE_PHP1_FPM_OLD="1"|
	<IfModule mod_fastcgi.c>
		<FilesMatch "\.php$">
			SetHandler php|PHP1_RELEASE|-fcgi
		</FilesMatch>
		FastCgiExternalServer |REALDOCROOT|/php|PHP1_RELEASE|-fpm-ssl -idle-timeout 300 -socket /usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock -pass-header Authorization -user |USER| -group |GROUP|
		Alias /php|PHP1_RELEASE|-bin |REALDOCROOT|/php|PHP1_RELEASE|-fpm-ssl
	</IfModule>
|*endif|

|*if HAVE_PHP2_FPM_OLD="1"|
	<IfModule mod_fastcgi.c>
		<FilesMatch \.php|PHP2_RELEASE|$>
			SetHandler php|PHP2_RELEASE|-fcgi
		</FilesMatch>
		FastCgiExternalServer |REALDOCROOT|/php|PHP2_RELEASE|-fpm-ssl -idle-timeout 300 -socket /usr/local/php|PHP2_RELEASE|/sockets/|USER|.sock -pass-header Authorization -user |USER| -group |GROUP|
		Alias /php|PHP2_RELEASE|-bin |REALDOCROOT|/php|PHP2_RELEASE|-fpm-ssl
	</IfModule>
|*endif|

	<Directory |DOCROOT|>
|*if CGI=""|
		|ALLOW_OVERRIDE|
		Options -ExecCGI
|*endif|
|*if HAVE_PHP1_FPM_OLD="1"|
		<IfModule mod_rewrite.c>
			RewriteEngine on
			RewriteOptions InheritBefore
			RewriteBase /
			RewriteCond %{REQUEST_URI} ^/php|PHP1_RELEASE|-bin(.*)
			RewriteRule . - [L]
		</IfModule>
|*endif|
|*if HAVE_PHP2_FPM_OLD="1"| 
		<IfModule mod_rewrite.c>
			RewriteEngine on
			RewriteOptions InheritBefore
			RewriteBase /
			RewriteCond %{REQUEST_URI} ^/php|PHP2_RELEASE|-bin(.*)
			RewriteRule . - [L]
		</IfModule>
|*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 |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR| |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 |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR| |PHP_MAIL_LOG|' .php|PHP2_RELEASE|
			<FilesMatch "\.php|PHP2_RELEASE|$">
				SetHandler fcgid-script
				Options +ExecCGI
			</FilesMatch>
		</IfModule>
|*endif|
|*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|
|*endif|
|*if OPEN_BASEDIR="ON"|
		php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
		suPHP_Engine |PHP|
		suPHP_UserGroup |USER| |GROUP|
|*endif|
	</Directory>

|?ADD_REWRITE_INHERIT=no|

|*if HAVE_PHP1_FPM="1"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if HAVE_PHP_FCGI="1"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|?ADD_CLI_INHERIT=yes|
|*if CLI!="1"|
	|?ADD_CLI_INHERIT=no|
|*endif|
|*if USE_HOSTNAME_FOR_ALIAS!="1"|
	|?ADD_CLI_INHERIT=no|
|*endif|
|*if ADD_CLI_INHERIT="yes"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if ADD_REWRITE_INHERIT="yes"|
	RewriteEngine on
	RewriteOptions inherit
|*endif|

|HANDLERS|
|MIMETYPES|

</VirtualHost>

Thanks! :-)
 
Did You run:
"./build rewrite_confs" in order to rewrite apache configs with the new templates?

Also make sure that custom templates are put in custom directory (editing the existing template will lead to overwrite during update)
 
Oops ... I forgot to run "./build rewrite_confs"

I was just restarting apache.

But my subdomains are still not working.
The folder exists but apache still says

Code:
AH00112: Warning: DocumentRoot [/home/admin/domains/domain.com/subdomains/mysubdomain/private_html/|] does not exist

If i visit the subdomain I get Internal server error.
 
You should rewrite virtual hosts for users domains, that can be done with the following command:

Code:
[COLOR=#000000][FONT=courier new]echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue[/FONT][/COLOR]


related:
http://help.directadmin.com/item.php?id=2
 
Hi Alex,

That didn't help.

This is my virtual_host2_secure_sub.conf

Code:
|?CGI=ScriptAlias /cgi-bin/ `HOME`/domains/`DOMAIN`/public_html/`SUB`/cgi-bin/|
|?DOCROOT=`HOME`/domains/`DOMAIN`/private_html|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/private_html|

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

|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/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="`HOME`/.php/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log `HOME`/.php/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,Includes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None|

<VirtualHost |IP|:|PORT_443| |MULTI_IP|>
|CUSTOM|
	SSLEngine on
	SSLCertificateFile |CERT|
	SSLCertificateKeyFile |KEY|
	|CAROOT|	

	ServerName www.|SUB|.|DOMAIN|
	ServerAlias www.|SUB|.|DOMAIN| |SUB|.|DOMAIN| |SERVER_ALIASES|
	ServerAdmin |ADMIN|
	DocumentRoot |DOCROOT|/|SUB|
	|CGI|

	|USECANONICALNAME|

	<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|

	CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.bytes bytes
	CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.log combined
	ErrorLog /var/log/httpd/domains/|DOMAIN|.|SUB|.error.log

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

|*if HAVE_PHP1_FPM="1"|
	<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
		AddHandler "proxy:fcgi://php-fpm|PHP1_RELEASE|.|USER|/" .inc .php .phtml .php|PHP1_RELEASE|
	</FilesMatch> 
|*endif|

|*if HAVE_PHP2_FPM="1"|
	<FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
		AddHandler "proxy:fcgi://php-fpm|PHP2_RELEASE|.|USER|/" .php|PHP2_RELEASE|
	</FilesMatch>
|*endif|

|*if HAVE_PHP1_FPM_OLD="1"|
	<IfModule mod_fastcgi.c>
		<FilesMatch "\.php$">
			SetHandler php|PHP1_RELEASE|-fcgi
		</FilesMatch>

		Alias /php|PHP1_RELEASE|-bin |REALDOCROOT|/php|PHP1_RELEASE|-fpm-ssl
	</IfModule>
|*endif|

|*if HAVE_PHP2_FPM_OLD="1"|
	<IfModule mod_fastcgi.c>
		<FilesMatch \.php|PHP2_RELEASE|$>
			SetHandler php|PHP2_RELEASE|-fcgi
		</FilesMatch>

		Alias /php|PHP2_RELEASE|-bin |REALDOCROOT|/php|PHP2_RELEASE|-fpm-ssl
	</IfModule>
|*endif|

	<Directory |DOCROOT|>
|*if CGI=""|
		|ALLOW_OVERRIDE|
		Options -ExecCGI
|*endif|
|*if HAVE_PHP1_FPM_OLD="1"|
		<IfModule mod_rewrite.c>
			RewriteEngine on
			RewriteOptions InheritBefore
			RewriteBase /
			RewriteCond %{REQUEST_URI} ^/php|PHP1_RELEASE|-bin(.*)
			RewriteRule . - [L]
		</IfModule>
|*endif|
|*if HAVE_PHP2_FPM_OLD="1"| 
		<IfModule mod_rewrite.c>
			RewriteEngine on
			RewriteOptions InheritBefore
			RewriteBase /
			RewriteCond %{REQUEST_URI} ^/php|PHP2_RELEASE|-bin(.*)
			RewriteRule . - [L]
		</IfModule>
|*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 |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR| |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 |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR| |PHP_MAIL_LOG|' .php|PHP2_RELEASE|
			<FilesMatch "\.php|PHP2_RELEASE|$">
				SetHandler fcgid-script
				Options +ExecCGI
			</FilesMatch>
		</IfModule>
|*endif|
|*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|
|*endif|
|*if OPEN_BASEDIR="ON"|
		php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
		suPHP_Engine |PHP|
		suPHP_UserGroup |USER| |GROUP|
|*endif|
	</Directory>

|?ADD_REWRITE_INHERIT=no|
|*if HAVE_PHP_FCGI="1"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|?ADD_CLI_INHERIT=yes|

|*if HAVE_PHP1_FPM="1"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if CLI!="1"|
	|?ADD_CLI_INHERIT=no|
|*endif|
|*if USE_HOSTNAME_FOR_ALIAS!="1"|
	|?ADD_CLI_INHERIT=no|
|*endif|
|*if ADD_CLI_INHERIT="yes"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if ADD_REWRITE_INHERIT="yes"|
	RewriteEngine on
	RewriteOptions inherit
|*endif|

|HANDLERS|
|MIMETYPES|

</VirtualHost>

I'm also unable to make a new subdomain.

Code:
Details

Error creating /home/admin/domains/domain.com/public_html/test2
Parent directory does not allow write, or one of the directories didn't allow search (execution) permission

Error creating /home/admin/domains/reisforum.info/public_html/test2/cgi-bin
A directory component in /home/admin/domains/domain.com/public_html/test2/cgi-bin does not exist or is a dangling symbolic link

Error creating /home/admin/domains/domain.com/private_html/test2
Parent directory does not allow write, or one of the directories didn't allow search (execution) permission
 
Your templates from the first and the last message differ.

That didn't help to do what? How your virtual host (!not template!) looks now?

I'm also unable to make a new subdomain.

You are using a custom installation and from here it's difficult to find a reason. Check permissions on parent directory like it's said in details of an error you posted. Check scripts in /usr/local/directadmin/scripts/custom/
 
I know they differ. I'm trying different things to make it work. without success. :-(

The
Code:
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
didn't fix the problem.
My subdomains are still unavailable.

The directories are chmod 755 so that's not the problem.

It was working perfect without SSL, since I switched it didn't work anymore.
 
I got everything working now.
And I can also make new subdomains.

This is my final virtual_host2_secure_sub.conf (the only file I changed)

Code:
|?CGI=ScriptAlias /cgi-bin/ `HOME`/domains/`DOMAIN`/subdomains/`SUB`/private_html/cgi-bin/|
|?DOCROOT=`HOME`/domains/`DOMAIN`/subdomains/`SUB`/private_html|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/subdomains/`SUB`/private_html|

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

|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/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="`HOME`/.php/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log `HOME`/.php/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,Includes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None|

<VirtualHost |IP|:|PORT_443| |MULTI_IP|>
|CUSTOM|
	SSLEngine on
	SSLCertificateFile |CERT|
	SSLCertificateKeyFile |KEY|
	|CAROOT|	

	ServerName www.|SUB|.|DOMAIN|
	ServerAlias www.|SUB|.|DOMAIN| |SUB|.|DOMAIN| |SERVER_ALIASES|
	ServerAdmin |ADMIN|
	DocumentRoot |DOCROOT|
	|CGI|

	|USECANONICALNAME|

	<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|

	CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.bytes bytes
	CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.log combined
	ErrorLog /var/log/httpd/domains/|DOMAIN|.|SUB|.error.log

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

|*if HAVE_PHP1_FPM="1"|
	<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
		AddHandler "proxy:fcgi://php-fpm|PHP1_RELEASE|.|USER|/" .inc .php .phtml .php|PHP1_RELEASE|
	</FilesMatch> 
|*endif|

|*if HAVE_PHP2_FPM="1"|
	<FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
		AddHandler "proxy:fcgi://php-fpm|PHP2_RELEASE|.|USER|/" .php|PHP2_RELEASE|
	</FilesMatch>
|*endif|

|*if HAVE_PHP1_FPM_OLD="1"|
	<IfModule mod_fastcgi.c>
		<FilesMatch "\.php$">
			SetHandler php|PHP1_RELEASE|-fcgi
		</FilesMatch>

		Alias /php|PHP1_RELEASE|-bin |REALDOCROOT|/php|PHP1_RELEASE|-fpm-ssl
	</IfModule>
|*endif|

|*if HAVE_PHP2_FPM_OLD="1"|
	<IfModule mod_fastcgi.c>
		<FilesMatch \.php|PHP2_RELEASE|$>
			SetHandler php|PHP2_RELEASE|-fcgi
		</FilesMatch>

		Alias /php|PHP2_RELEASE|-bin |REALDOCROOT|/php|PHP2_RELEASE|-fpm-ssl
	</IfModule>
|*endif|

	<Directory |DOCROOT|>
|*if CGI=""|
		|ALLOW_OVERRIDE|
		Options -ExecCGI
|*endif|
|*if HAVE_PHP1_FPM_OLD="1"|
		<IfModule mod_rewrite.c>
			RewriteEngine on
			RewriteOptions InheritBefore
			RewriteBase /
			RewriteCond %{REQUEST_URI} ^/php|PHP1_RELEASE|-bin(.*)
			RewriteRule . - [L]
		</IfModule>
|*endif|
|*if HAVE_PHP2_FPM_OLD="1"| 
		<IfModule mod_rewrite.c>
			RewriteEngine on
			RewriteOptions InheritBefore
			RewriteBase /
			RewriteCond %{REQUEST_URI} ^/php|PHP2_RELEASE|-bin(.*)
			RewriteRule . - [L]
		</IfModule>
|*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 |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR| |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 |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR| |PHP_MAIL_LOG|' .php|PHP2_RELEASE|
			<FilesMatch "\.php|PHP2_RELEASE|$">
				SetHandler fcgid-script
				Options +ExecCGI
			</FilesMatch>
		</IfModule>
|*endif|
|*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|
|*endif|
|*if OPEN_BASEDIR="ON"|
		php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
		suPHP_Engine |PHP|
		suPHP_UserGroup |USER| |GROUP|
|*endif|
	</Directory>

|?ADD_REWRITE_INHERIT=no|
|*if HAVE_PHP_FCGI="1"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|?ADD_CLI_INHERIT=yes|

|*if HAVE_PHP1_FPM="1"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if CLI!="1"|
	|?ADD_CLI_INHERIT=no|
|*endif|
|*if USE_HOSTNAME_FOR_ALIAS!="1"|
	|?ADD_CLI_INHERIT=no|
|*endif|
|*if ADD_CLI_INHERIT="yes"|
	|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if ADD_REWRITE_INHERIT="yes"|
	RewriteEngine on
	RewriteOptions inherit
|*endif|

|HANDLERS|
|MIMETYPES|

</VirtualHost>
 
Back
Top