LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   HTTPS in sub domain serves content from main domain. Wildcard SSL installed. (https://www.linuxquestions.org/questions/linux-server-73/https-in-sub-domain-serves-content-from-main-domain-wildcard-ssl-installed-4175432177/)

amit.roy 10-14-2012 01:23 PM

HTTPS in sub domain serves content from main domain. Wildcard SSL installed.
 
Hello everybody,

this is my first question here. Thank you for reading it. It seems the problem has something to do with VirtualHost configuration in httpd.conf, but I am not sure. Below is the issue.

We recently bought a wildcard SSL and installed it. The main domain works fine over HTTPS. But the sub domains does not. It seems the HTTPS requests to sub domains are serving content from main domain. If a corresponding url exists in the main domain for the given sub domain url, it is displaying the content of the main domain( for a HTTPS request to a sub domain url).If a url does not exist in the main domain for a given sub domain url, it gives 404 error.
The sub domains are working just fine over HTTP.

Environment: We are on a Linux VPS.
Cpanel 11.30.6 , Apache 2.2.22, PHP 5.3.13


There are a lot of virtual host entry in the httpd.conf for other sites too in it. For the site in question we have two sub domains. We have VirtualHosts set up for each sub domains (so we have three VirtualHost entries like this for the two sub-domains and another VirtualHost entry for main domain) like

Code:

NameVirtualHost xx.xx.xxx.xx:80
<VirtualHost xx.xx.xxx.xx:80>
    ServerName next.my-own-website.com
    ServerAlias www.next.my-own-website.com
    DocumentRoot /home/amitabh/public_html/next.my-own-website.com
    ServerAdmin webmaster@next.my-own-website.com
    UseCanonicalName On
    CustomLog /usr/local/apache/domlogs/next.my-own-website.com combined
    CustomLog /usr/local/apache/domlogs/next.my-own-website.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User amitabh # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup amitabh amitabh
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup amitabh amitabh
    </IfModule>
    ScriptAlias /cgi-bin/ /home/amitabh/public_html/next.my-own-website.com/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/amitabh/next.my-own-website.com/*.conf"

</VirtualHost>


and then we also have a VirtualHost setup for main domain for port 443
Code:

<VirtualHost xx.xx.xxx.xx:443>
    ServerName my-own-website.com
    ServerAlias www.my-own-website.com
    DocumentRoot /home/amitabh/public_html
    ServerAdmin webmaster@my-own-website.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/my-own-website.com combined
    CustomLog /usr/local/apache/domlogs/my-own-website.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User amitabh # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup amitabh amitabh
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup amitabh amitabh
    </IfModule>
    ScriptAlias /cgi-bin/ /home/amitabh/public_html/cgi-bin/
    SSLEngine on
   
    SSLCertificateFile /etc/ssl/certs/my-own-website.com.crt
    SSLCertificateKeyFile /etc/ssl/private/my-own-website.com.key
        SSLCACertificateFile /etc/ssl/certs/my-own-website.com.cabundle
    CustomLog /usr/local/apache/domlogs/my-own-website.com-ssl_log combined
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    <Directory "/home/amitabh/public_html/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>

    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/ssl/2/amitabh/my-own-website.com/*.conf"

</VirtualHost>

It seems it has to do something with name based VirtualHosts and SSL. Any help or pointer on this is greatly appreciated.

Thank you.

acid_kewpie 10-15-2012 02:49 AM

can you provide the sub domains and example requests?

note that you would generally define a vhost as *:80, not <ip.add.re.ss>:80, that *could* become relevant.

amit.roy 10-15-2012 03:49 AM

Thanks @acid_kewpie for replying. Yep,we can try the sub domain is wp.my-guardian-angels.com. This sub domain has all pages similar to the main domain except few. So a test on a page/url which is there in both the main domain and the sub domain but has different content confirms the test.

Please try the "plans and pricing" page on both the main domain and the sub domain over HTTP:
In main domain the link is : http://my-guardian-angels.com/plans-pricing/
In the sub domain the link is : http://wp.my-guardian-angels.com/plans-pricing/

You will see these pages are different

Now if we try the same links over HTTPS:
for the main domain : https://my-guardian-angels.com/plans-pricing/
for the sub domain : https://wp.my-guardian-angels.com/plans-pricing/

we can see both the https request are serving the same content for the plans and pricing page over https, and the content is that of the main domains plans and pricing page.

acid_kewpie 10-15-2012 04:47 AM

I mean, can we see the actual httpd config? there really should be no difference apart from the SSL stage.

amit.roy 10-15-2012 06:21 AM

Sure, below is the httpd.conf file


Code:

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#  Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the      #
#  configuration file. To have modifications retained, all modifications must be checked into the              #
#  configuration system by running:                                                                            #
#      /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#  To see if your changes will be conserved, regenerate the Apache configuration file by running:              #
#      /usr/local/cpanel/bin/build_apache_conf                                                                #
#  and check the configuration file for your alterations. If your changes have been ignored, then they will    #
#  need to be added directly to their respective template files.                                              #
#                                                                                                              #
#  It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf      #
#  For detailed instructions on using Include files and the apache_conf_distiller with the new configuration  #
#  system refer to the documentation at: http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html      #
#                                                                                                              #
#  This configuration file was built from the following templates:                                            #
#    /var/cpanel/templates/apache2/main.default                                                                #
#    /var/cpanel/templates/apache2/main.local                                                                  #
#    /var/cpanel/templates/apache2/vhost.default                                                              #
#    /var/cpanel/templates/apache2/vhost.local                                                                #
#    /var/cpanel/templates/apache2/ssl_vhost.default                                                          #
#    /var/cpanel/templates/apache2/ssl_vhost.local                                                            #
#                                                                                                              #
#  Templates with the '.local' extension will be preferred over templates with the '.default' extension.        #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


Include "/usr/local/apache/conf/includes/pre_main_global.conf"
Include "/usr/local/apache/conf/includes/pre_main_2.conf"

 

LoadModule auth_passthrough_module modules/mod_auth_passthrough.so
LoadModule bwlimited_module modules/mod_bwlimited.so
LoadModule frontpage_module modules/mod_frontpage.so




Include "/usr/local/apache/conf/php.conf"
Include "/usr/local/apache/conf/includes/errordocument.conf"
Include "/usr/local/apache/conf/modsec2.conf"


ErrorLog "logs/error_log"
DefaultType text/plain
ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi

AddType text/html .shtml

SSLProtocol -ALL +SSLv3 +TLSv1
Alias /bandwidth /usr/local/bandmin/htdocs/
Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/
Alias /java-sys /usr/local/cpanel/java-sys/
Alias /img-sys /usr/local/cpanel/img-sys/
Alias /akopia /usr/local/cpanel/3rdparty/interchange/share/akopia/
Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /interchange /usr/local/cpanel/3rdparty/interchange/share/interchange/
Alias /interchange-5 /usr/local/cpanel/3rdparty/interchange/share/interchange-5/


ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/
ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/
ScriptAlias /scgi-bin /usr/local/cpanel/cgi-sys/scgiwrap


<Directory "/">
    Options +ExecCGI +FollowSymLinks +Includes +IncludesNOEXEC +Indexes -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
</Directory>

<Directory "/usr/local/apache/htdocs">
    Options Includes Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

</Directory>

<Files ~ "^error_log$">
    Order allow,deny
    Deny from all

    Satisfy All
</Files>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all

    Satisfy All
</FilesMatch>

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    CustomLog logs/access_log common

    <IfModule logio_module>
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    </IfModule>

</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

</IfModule>

<Directory "/usr/local/apache/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

</Directory>

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

</IfModule>

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#  Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the      #
#  configuration file. To have modifications retained, all modifications must be checked into the              #
#  configuration system by running:                                                                            #
#      /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#  To see if your changes will be conserved, regenerate the Apache configuration file by running:              #
#      /usr/local/cpanel/bin/build_apache_conf                                                                #
#  and check the configuration file for your alterations. If your changes have been ignored, then they will    #
#  need to be added directly to their respective template files.                                              #
#                                                                                                              #
#  It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf      #
#  For detailed instructions on using Include files and the apache_conf_distiller with the new configuration  #
#  system refer to the documentation at: http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html      #
#                                                                                                              #
#  This configuration file was built from the following templates:                                            #
#    /var/cpanel/templates/apache2/main.default                                                                #
#    /var/cpanel/templates/apache2/main.local                                                                  #
#    /var/cpanel/templates/apache2/vhost.default                                                              #
#    /var/cpanel/templates/apache2/vhost.local                                                                #
#    /var/cpanel/templates/apache2/ssl_vhost.default                                                          #
#    /var/cpanel/templates/apache2/ssl_vhost.local                                                            #
#                                                                                                              #
#  Templates with the '.local' extension will be preferred over templates with the '.default' extension.        #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


PidFile logs/httpd.pid
LockFile logs/accept.lock
# Defined in /var/cpanel/cpanel.config: apache_port
Listen 0.0.0.0:80
Timeout 120
User nobody
Group nobody
ExtendedStatus On
ServerAdmin machinemessages@forum.inmotionhosting.com
ServerName vps8229.inmotionhosting.com
LogLevel warn

# These can be set in WHM under 'Apache Global Configuration'
TraceEnable Off
ServerSignature Off
ServerTokens ProductOnly
FileETag None
StartServers 5
KeepAlive On
KeepAliveTimeout 3
<IfModule prefork.c>
MinSpareServers 5
MaxSpareServers 10
</IfModule>
MaxClients 64
MaxRequestsPerChild 10000

RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
RewriteLock /usr/local/apache/logs/rewrite_lock

UserDir public_html
UserDir disabled root

# DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority
DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html

SSLProtocol -ALL +SSLv3 +TLSv1
# SSLCipherSuite can be set in WHM under 'Apache Global Configuration'
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM
SSLPassPhraseDialog  builtin
SSLSessionCache        dbm:/usr/local/apache/logs/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex  file:/usr/local/apache/logs/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

<IfDefine SSL>
    # Defined in /var/cpanel/cpanel.config: apache_ssl_port
    Listen 0.0.0.0:443
    AddType application/x-x509-ca-cert .crt
    AddType application/x-pkcs7-crl .crl
</IfDefine>


AddHandler cgi-script .cgi .pl .plx .ppl .perl
AddHandler server-parsed .shtml
AddType text/html .shtml
AddType application/x-tar .tgz
AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlc .wmlc
AddType application/vnd.wap.wmlscriptc .wmlsc

<Location /whm-server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>



# SUEXEC is supported

Include "/usr/local/apache/conf/includes/pre_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/pre_virtualhost_2.conf"

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 
NameVirtualHost 70.39.151.227:80
NameVirtualHost *
# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

<VirtualHost 70.39.151.227:80>
    ServerName vps8229.inmotionhosting.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin machinemessages@forum.inmotionhosting.com
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
</VirtualHost>


# Default vhost for unbound IPs

<VirtualHost *>
    ServerName vps8229.inmotionhosting.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin machinemessages@forum.inmotionhosting.com
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

<VirtualHost 70.39.151.227:80>
    ServerName nuvolect.com
    ServerAlias www.nuvolect.com
    DocumentRoot /home/attend5/public_html
    ServerAdmin webmaster@nuvolect.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/nuvolect.com combined
    CustomLog /usr/local/apache/domlogs/nuvolect.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User attend5 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup attend5 attend5
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup attend5 attend5
    </IfModule>
    ScriptAlias /cgi-bin/ /home/attend5/public_html/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/attend5/nuvolect.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 


NameVirtualHost 70.39.144.72:80
<VirtualHost 70.39.144.72:80>
    ServerName my-guardian-angels.com
    ServerAlias www.my-guardian-angels.com
    DocumentRoot /home/myguardi/public_html
    ServerAdmin webmaster@my-guardian-angels.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/my-guardian-angels.com combined
    CustomLog /usr/local/apache/domlogs/my-guardian-angels.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User myguardi # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup myguardi myguardi
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup myguardi myguardi
    </IfModule>
    ScriptAlias /cgi-bin/ /home/myguardi/public_html/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/myguardi/my-guardian-angels.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

<VirtualHost 70.39.151.227:80>
    ServerName 4myxy.nuvolect.com
    ServerAlias 4myxy.com www.4myxy.nuvolect.com www.4myxy.com
    DocumentRoot /home/attend5/public_html/4myxy.com
    ServerAdmin webmaster@4myxy.nuvolect.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/4myxy.nuvolect.com combined
    CustomLog /usr/local/apache/domlogs/4myxy.nuvolect.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User attend5 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup attend5 attend5
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup attend5 attend5
    </IfModule>
    ScriptAlias /cgi-bin/ /home/attend5/public_html/4myxy.com/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/attend5/4myxy.nuvolect.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

<VirtualHost 70.39.151.227:80>
    ServerName attendmassnow.nuvolect.com
    ServerAlias www.attendmassnow.org www.attendmassnow.nuvolect.com attendmassnow.org
    DocumentRoot /home/attend5/public_html/amn/j1
    ServerAdmin webmaster@attendmassnow.nuvolect.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/attendmassnow.nuvolect.com combined
    CustomLog /usr/local/apache/domlogs/attendmassnow.nuvolect.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User attend5 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup attend5 attend5
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup attend5 attend5
    </IfModule>
    ScriptAlias /cgi-bin/ /home/attend5/public_html/amn/j1/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/attend5/attendmassnow.nuvolect.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

<VirtualHost 70.39.151.227:80>
    ServerName myvirtualchurch.nuvolect.com
    ServerAlias www.myvirtualchurch.org www.myvirtualchurch.nuvolect.com myvirtualchurch.org
    DocumentRoot /home/attend5/public_html/myvirtualchurch.org
    ServerAdmin webmaster@myvirtualchurch.nuvolect.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/myvirtualchurch.nuvolect.com combined
    CustomLog /usr/local/apache/domlogs/myvirtualchurch.nuvolect.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User attend5 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup attend5 attend5
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup attend5 attend5
    </IfModule>
    ScriptAlias /cgi-bin/ /home/attend5/public_html/myvirtualchurch.org/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/attend5/myvirtualchurch.nuvolect.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

<VirtualHost 70.39.151.227:80>
    ServerName virtualcatholic.nuvolect.com
    ServerAlias www.virtualcatholic.nuvolect.com virtualcatholic.org www.virtualcatholic.org
    DocumentRoot /home/attend5/public_html/virtualcatholic.org
    ServerAdmin webmaster@virtualcatholic.nuvolect.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/virtualcatholic.nuvolect.com combined
    CustomLog /usr/local/apache/domlogs/virtualcatholic.nuvolect.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User attend5 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup attend5 attend5
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup attend5 attend5
    </IfModule>
    ScriptAlias /cgi-bin/ /home/attend5/public_html/virtualcatholic.org/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/attend5/virtualcatholic.nuvolect.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

<VirtualHost 70.39.151.227:80>
    ServerName virtualmass.nuvolect.com
    ServerAlias www.virtualmass.nuvolect.com www.virtualmass.org virtualmass.org
    DocumentRoot /home/attend5/public_html/virtualmass.org
    ServerAdmin webmaster@virtualmass.nuvolect.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/virtualmass.nuvolect.com combined
    CustomLog /usr/local/apache/domlogs/virtualmass.nuvolect.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User attend5 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup attend5 attend5
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup attend5 attend5
    </IfModule>
    ScriptAlias /cgi-bin/ /home/attend5/public_html/virtualmass.org/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/attend5/virtualmass.nuvolect.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

<VirtualHost 70.39.151.227:80>
    ServerName virtualpatron.nuvolect.com
    ServerAlias www.virtualpatron.nuvolect.com virtualpatron.org www.virtualpatron.org
    DocumentRoot /home/attend5/public_html/virtualpatron.org
    ServerAdmin webmaster@virtualpatron.nuvolect.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/virtualpatron.nuvolect.com combined
    CustomLog /usr/local/apache/domlogs/virtualpatron.nuvolect.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User attend5 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup attend5 attend5
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup attend5 attend5
    </IfModule>
    ScriptAlias /cgi-bin/ /home/attend5/public_html/virtualpatron.org/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/attend5/virtualpatron.nuvolect.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 


NameVirtualHost 70.39.144.72:80
<VirtualHost 70.39.144.72:80>
    ServerName next.my-guardian-angels.com
    ServerAlias www.next.my-guardian-angels.com
    DocumentRoot /home/myguardi/public_html/next.my-guardian-angels.com
    ServerAdmin webmaster@next.my-guardian-angels.com
    UseCanonicalName On
    CustomLog /usr/local/apache/domlogs/next.my-guardian-angels.com combined
    CustomLog /usr/local/apache/domlogs/next.my-guardian-angels.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User myguardi # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup myguardi myguardi
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup myguardi myguardi
    </IfModule>
    ScriptAlias /cgi-bin/ /home/myguardi/public_html/next.my-guardian-angels.com/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/myguardi/next.my-guardian-angels.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 


NameVirtualHost 70.39.144.72:80
<VirtualHost 70.39.144.72:80>
    ServerName wp.my-guardian-angels.com
    ServerAlias www.wp.my-guardian-angels.com
    DocumentRoot /home/myguardi/public_html/wp.my-guardian-angels.com
    ServerAdmin webmaster@wp.my-guardian-angels.com
    UseCanonicalName On
    CustomLog /usr/local/apache/domlogs/wp.my-guardian-angels.com combined
    CustomLog /usr/local/apache/domlogs/wp.my-guardian-angels.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User myguardi # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup myguardi myguardi
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup myguardi myguardi
    </IfModule>
    ScriptAlias /cgi-bin/ /home/myguardi/public_html/wp.my-guardian-angels.com/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/myguardi/wp.my-guardian-angels.com/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. 

# SSL
<IfDefine SSL>
</IfDefine>


<VirtualHost 70.39.151.227:80>
    ServerName kennykrauseagle.virtualpatron.org
    ServerAlias www.kennykrauseagle.virtualpatron.org
    DocumentRoot /home/attend5/public_html/kennykrauseagle
    ServerAdmin webmaster@kennykrauseagle.virtualpatron.org
    UseCanonicalName On
    CustomLog /usr/local/apache/domlogs/kennykrauseagle.virtualpatron.org combined
    CustomLog /usr/local/apache/domlogs/kennykrauseagle.virtualpatron.org-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User attend5 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup attend5 attend5
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup attend5 attend5
    </IfModule>
    ScriptAlias /cgi-bin/ /home/attend5/public_html/kennykrauseagle/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/attend5/kennykrauseagle.virtualpatron.org/*.conf"

</VirtualHost>
<VirtualHost 70.39.144.72:443>
    ServerName my-guardian-angels.com
    ServerAlias www.my-guardian-angels.com
    DocumentRoot /home/myguardi/public_html
    ServerAdmin webmaster@my-guardian-angels.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/my-guardian-angels.com combined
    CustomLog /usr/local/apache/domlogs/my-guardian-angels.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User myguardi # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup myguardi myguardi
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup myguardi myguardi
    </IfModule>
    ScriptAlias /cgi-bin/ /home/myguardi/public_html/cgi-bin/
    SSLEngine on
   
    SSLCertificateFile /etc/ssl/certs/my-guardian-angels.com.crt
    SSLCertificateKeyFile /etc/ssl/private/my-guardian-angels.com.key
        SSLCACertificateFile /etc/ssl/certs/my-guardian-angels.com.cabundle
    CustomLog /usr/local/apache/domlogs/my-guardian-angels.com-ssl_log combined
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    <Directory "/home/myguardi/public_html/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>

    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/ssl/2/myguardi/my-guardian-angels.com/*.conf"

</VirtualHost>
<VirtualHost 70.39.144.72:80>
    ServerName redirtest.my-guardian-angels.com
    ServerAlias www.redirtest.my-guardian-angels.com
    DocumentRoot /home/myguardi/public_html/redirtest
    ServerAdmin webmaster@redirtest.my-guardian-angels.com
    UseCanonicalName On
    CustomLog /usr/local/apache/domlogs/redirtest.my-guardian-angels.com combined
    CustomLog /usr/local/apache/domlogs/redirtest.my-guardian-angels.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User myguardi # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup myguardi myguardi
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup myguardi myguardi
    </IfModule>
    ScriptAlias /cgi-bin/ /home/myguardi/public_html/redirtest/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/myguardi/redirtest.my-guardian-angels.com/*.conf"

</VirtualHost>
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
<VirtualHost 70.39.151.227:80 *>
    ServerName vps8229.inmotionhosting.com
    ServerAlias cpanel.* whm.* webmail.* webdisk.*
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin machinemessages@forum.inmotionhosting.com
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
    RewriteEngine On
    <IfModule core.c>
        SSLProxyEngine On
    </IfModule>
    RewriteCond %{HTTP_HOST} ^cpanel\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
    RewriteCond %{HTTP_HOST} ^webmail\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
    RewriteCond %{HTTP_HOST} ^whm\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
    RewriteCond %{HTTP_HOST} ^webdisk\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
    RewriteCond %{HTTP_HOST} ^cpanel\.
    RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
    RewriteCond %{HTTP_HOST} ^webmail\.
    RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
    RewriteCond %{HTTP_HOST} ^whm\.
    RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
    RewriteCond %{HTTP_HOST} ^webdisk\.
    RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
    UseCanonicalName Off
</VirtualHost>


Include "/usr/local/apache/conf/includes/post_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf"


# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.


acid_kewpie 10-15-2012 06:25 AM

there is no 443 virtualhost for that subdomain.

amit.roy 10-15-2012 06:51 AM

Hello Chris,

Thanks for the reply. Yep I see we don't have virtualhost entry for the subdomains for port 443. I have been reading this article and it seems to suggest we need to have virtualhost entries for each subdomain for 443. I have a couple of questions, it would be great if you can help me.

1. I guess we need to specify NameVirtualHost for port 443. I was wondering which one would be correct
Code:

NameVirtualHost 70.39.144.72:443
or
Code:

NameVirtualHost *:443
2. For specifying the SSL directives for the virtualhost for the subdomain at 443 can we use the same directives that is there for the main site (my-guardian-angels.com)
Code:

SSLCertificateFile /etc/ssl/certs/my-guardian-angels.com.crt
 SSLCertificateKeyFile /etc/ssl/private/my-guardian-angels.com.key
 SSLCACertificateFile /etc/ssl/certs/my-guardian-angels.com.cabundle

Thank you.
Amit

acid_kewpie 10-15-2012 06:56 AM

well I see you've a lot of different sites on IPs... the norm is to use the *:443 format, but that will make all sites available on all IPs. This may or may not matter in the slightest if DNS is never going to send a user to a different IP anyway.

As for the certs, yes as long as the DN of the cert covers it, and you said it was a wilcard, so should be fine.

amit.roy 10-15-2012 07:05 AM

Thanks Chris. I will read up a little bit more and will try this out tonight. I will post back the result on this thread.

amit.roy 10-18-2012 10:52 AM

I have been trying to sort this out. But I came up with more questions :( . They are

1. Is my virtual host entry correct
Code:

<VirtualHost 70.39.144.72:443>
    ServerName next.my-guardian-angels.com
    ServerAlias www.next.my-guardian-angels.com
    DocumentRoot /home/myguardi/public_html/next.my-guardian-angels.com
    ServerAdmin webmaster@my-guardian-angels.com
    UseCanonicalName On
    CustomLog /usr/local/apache/domlogs/next.my-guardian-angels.com combined
    CustomLog /usr/local/apache/domlogs/next.my-guardian-angels.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User myguardi # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup myguardi myguardi
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup myguardi myguardi
    </IfModule>
    ScriptAlias /cgi-bin/ /home/myguardi/public_html/next.my-guardian-angels.com/cgi-bin/
    SSLEngine on
   
    SSLCertificateFile /etc/ssl/certs/my-guardian-angels.com.crt
    SSLCertificateKeyFile /etc/ssl/private/my-guardian-angels.com.key
        SSLCACertificateFile /etc/ssl/certs/my-guardian-angels.com.cabundle
    CustomLog /usr/local/apache/domlogs/next.my-guardian-angels.com-ssl_log combined
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    <Directory "/home/myguardi/public_html/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>

    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/ssl/2/myguardi/my-guardian-angels.com/*.conf"

</VirtualHost>

given the IP is the same dedicated IP of the my-guardian-angels.com domain.


2. Where do I put the virtual host entry? Do I edit the httpd.conf file and put the virtual host entry there directly or do I put it in some include file.
I guess if apache is recompiled again at some point of the httpd.conf will be over written? There are lines in the httpd.conf which says “# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES”.
If I were to put in some include file, in which file should I add the SSL virtualhost entry?

3. Do I make copies of the SSL my-guardian-angels.com_SSL in /var/cpanel/userdata/myguardi and rename them to next.my-guardian-angels.com_SSL and wp.my-guardian-angels.com_SSL? This post seems to suggest so.

I appreciate your effort to answer my questions. Thank you.

acid_kewpie 10-18-2012 10:58 AM

the config looks broadly correct, it being seen to work would be the real giveaway though.

the entry can go after that one. Usually the would be in ssl.conf but it's really not structured to any obligatory format, just convention. Mind you, I have NEVER used a noddy web interface to manage a file, so I can't say what limitatiosn that might impose. is there an include directory to drop a while file into?

no, the same cert is fine.

amit.roy 10-18-2012 11:59 AM

Thanks Chris for all the help. I will add the permanent entry to ssl.conf. I went through the ssl.conf ,its strange I don't see the
Code:

<VirtualHost 70.39.144.72:443>
entry for the my-guardian-angels.com there( The entry is already there in the httpd.conf).
I think I would like to test out the virtualhost entry first on httpd.conf itself to see if its correct and the SSL is working fine for the sub domains.

Broadly here is my battle plan
1. I will edit the httpd.conf and add the virtualhost entry for port 443 for the sub domain.
2. restart apache and test if the apache configuration is fine and the apache restarted correctly.
3. If apache restarted correctly we go ahead and test the sub domains.
4. Once we confirm the SSL is working for the sub domain we move ahead and add the virtualhost entry to the ssl.conf (this would be another battle plan)

Do let me know your thoughts. Thank you.

amit.roy 10-18-2012 12:15 PM

For your question, well I am using Putty to access the VPS. There is an include directory at /usr/local/apache/conf/includes but it contains files like pre_main_1.conf, pre_virtualhost_2.conf etc

amit.roy 10-19-2012 03:23 PM

Bump :o . It would be really wonderful if somebody looks at what I am trying to do and alert me if I am on my way to screw up things :scratch::newbie:

acid_kewpie 10-19-2012 04:03 PM

all you're doing is editing a text file, you can't screw that up. just take a backup in case and do it.


All times are GMT -5. The time now is 06:24 AM.