https://domain.com loads files from https://sub.domain.com

gunemalli

Verified User
Joined
Jul 22, 2009
Messages
86
Location
Sheffield, UK
Hi fellas,

I came across this issue today. i have subdomain (sub.domain.com) created as a addon domain for SSL purposes. now when i goto https://domain.com or https://other.domain.com it loads files from sub.domain.com's private_html folder. i.e all https connections acts as a pointer to sub.domain.com.

How can I stop this issue?
 
Hello,

Find httpd.conf for the virual host and post it here, so someone of us could look at it.
Additionally find .htaccess in public_html for the domain and post its content.
 
thanks for the quick reply. there's no .htaccess for the main domain or the subdomains

httpd.conf: for the domain under /usr/local/directadmin/data/.........

Code:
# Auto generated apache config file by DirectAdmin version 1.38.4
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website

# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=2
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3

# Frontpage requires these parameters in every httpd.conf file or else
# it won't work.
ServerRoot /etc/httpd



<VirtualHost 67.23.228.143:80 67.23.225.190:80 >


	ServerName www.private.domain.com
	ServerAlias www.private.domain.com private.domain.com 
	ServerAdmin [email protected]
	DocumentRoot /home/simplisp/domains/private.domain.com/public_html
	ScriptAlias /cgi-bin/ /home/simplisp/domains/private.domain.com/public_html/cgi-bin/

	UseCanonicalName OFF

	SuexecUserGroup simplisp simplisp
	CustomLog /var/log/httpd/domains/private.domain.com.bytes bytes
	CustomLog /var/log/httpd/domains/private.domain.com.log combined
	ErrorLog /var/log/httpd/domains/private.domain.com.error.log

	<Directory /home/simplisp/domains/private.domain.com/public_html>
		Options +Includes -Indexes

		php_admin_flag engine ON
		<IfModule !mod_php6.c>
			php_admin_flag safe_mode OFF
		</IfModule>
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'


		php_admin_value open_basedir /home/simplisp/:/tmp:/var/tmp:/usr/local/lib/php/


	</Directory>



</VirtualHost>




<VirtualHost 67.23.228.143:443 67.23.225.190:443 >

	SSLEngine on
	SSLCertificateFile /usr/local/directadmin/data/users/simplisp/domains/private.domain.com.cert
	SSLCertificateKeyFile /usr/local/directadmin/data/users/simplisp/domains/private.domain.com.key
	SSLCACertificateFile /usr/local/directadmin/data/users/simplisp/domains/private.domain.com.cacert

	ServerName www.private.domain.com
	ServerAlias www.private.domain.com private.domain.com 
	ServerAdmin [email protected]
	DocumentRoot /home/simplisp/domains/private.domain.com/private_html
	ScriptAlias /cgi-bin/ /home/simplisp/domains/private.domain.com/public_html/cgi-bin/

	UseCanonicalName OFF

	SuexecUserGroup simplisp simplisp
	CustomLog /var/log/httpd/domains/private.domain.com.bytes bytes
	CustomLog /var/log/httpd/domains/private.domain.com.log combined
	ErrorLog /var/log/httpd/domains/private.domain.com.error.log

	<Directory /home/simplisp/domains/private.domain.com/private_html>
		Options +Includes -Indexes

		php_admin_flag engine ON
		<IfModule !mod_php6.c>
			php_admin_flag safe_mode OFF
		</IfModule>
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'


		php_admin_value open_basedir /home/simplisp/:/tmp:/var/tmp:/usr/local/lib/php/


	</Directory>



</VirtualHost>


<VirtualHost 67.23.228.143:80 67.23.225.190:80 >


	ServerName www.domain.com
	ServerAlias www.domain.com domain.com 
	ServerAdmin [email protected]
	DocumentRoot /home/simplisp/domains/domain.com/public_html
	ScriptAlias /cgi-bin/ /home/simplisp/domains/domain.com/public_html/cgi-bin/

	UseCanonicalName OFF

	SuexecUserGroup simplisp simplisp
	CustomLog /var/log/httpd/domains/domain.com.bytes bytes
	CustomLog /var/log/httpd/domains/domain.com.log combined
	ErrorLog /var/log/httpd/domains/domain.com.error.log

	<Directory /home/simplisp/domains/domain.com/public_html>
		Options +Includes -Indexes

		php_admin_flag engine ON
		<IfModule !mod_php6.c>
			php_admin_flag safe_mode OFF
		</IfModule>
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'


		php_admin_value open_basedir /home/simplisp/:/tmp:/var/tmp:/usr/local/lib/php/


	</Directory>



</VirtualHost>



<VirtualHost 67.23.228.143:80 67.23.225.190:80 >


	ServerName www.jayasiri.domain.com
	ServerAlias www.jayasiri.domain.com jayasiri.domain.com 
	ServerAdmin [email protected]
	DocumentRoot /home/simplisp/domains/domain.com/public_html/jayasiri
	ScriptAlias /cgi-bin/ /home/simplisp/domains/domain.com/public_html/jayasiri/cgi-bin/
	
	UseCanonicalName OFF

	SuexecUserGroup simplisp simplisp
	CustomLog /var/log/httpd/domains/domain.com.jayasiri.bytes bytes
	CustomLog /var/log/httpd/domains/domain.com.jayasiri.log combined
	ErrorLog /var/log/httpd/domains/domain.com.jayasiri.error.log
	<Directory /home/simplisp/domains/domain.com/public_html/jayasiri>
		Options +Includes -Indexes

		php_admin_flag engine ON
		<IfModule !mod_php6.c>
			php_admin_flag safe_mode OFF
		</IfModule>
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'


		php_admin_value open_basedir /home/simplisp/:/tmp:/var/tmp:/usr/local/lib/php/


	</Directory>


	
</VirtualHost>
 
Your configs are OK, at least that seems to me so.

now when i goto https://domain.com or https://other.domain.com it loads files from sub.domain.com's private_html folder

I believe that's a normal behavior. So split domains (virtual hosts) between different accounts, if you don't like how it works.

I've tested on my sites, they work the same way. When I open any other site from those added to one account with the main site, for which SSL is enabled, I still see the content of the main website. That's caused by the way SSL works.
 
Back
Top