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-20-2012 08:42 AM

Thanks so much! Finally I am going to try this out!

amit.roy 10-24-2012 06:37 AM

I went ahead and edited the httpd.conf file saved it and restarted the apache. Just wanted to see if the virtual host entry worked.
The good thing is it worked, https://next.my-guardian-angels.com is serving content from the sub-domain correctly.

But now a different problem came up, if I try https://my-guardian-angels.com, it serves the content from next.my-guardian-angels.com. I guess it is serving the content from the first virtualhost entry(for port 443)for any https requests to the main domain or other sub domains. I put the virtualhost entry(for port 443) for next.my-guardian-angels.com before the virtualhost entry(for port 443) for my-guardian-angels.com or other sub domains.

I didn't add the
Code:

NameVirtualHost 70.39.144.72:443
entry in httpd.conf as I felt apache was handling hhtps request. Any thoughts on how to solve this is greatly appreciated. Looking forward to some help. Thank you.

amit.roy 11-25-2012 01:56 PM

I added the
Code:

NameVirtualHost 70.39.144.72:443
and it worked perfectly. We further moved the virtualhost entries to a permanent location since the httpd.conf is a generated file and gets overwritten every time a domain/sub domain is added/deleted. Following steps to move the virtualhost entries worked for us
  1. Created a file /var/cpanel/templates/apache2/ssl_vhost.local
  2. Added the nameVirtualHost directive there for port 443
  3. Added the virtualhost entries for port 443 there
  4. use the following to test if your changes pass a basic configtest by Apache:
    Code:

    /usr/local/apache/bin/apachectl configtest
  5. We didnt use # /usr/local/apache/bin/apachectl restart , but rather restarted apache from WHM because the apache didnt restart when we used this command
  6. Test if apache restarted successfully by checking its status
    Code:

    # /usr/local/apache/bin/apachectl status
  7. If Apache fails to restart (e.g., if it fails to respond to the status check or if that produces an error), then you may want to revert your Apache configuration back using the first backup created, followed by another restart and status check
  8. To have modifications retained, all modifications must be checked into configuration system by running
    Code:

    /usr/local/cpanel/bin/apache_conf_distiller –update
  9. To see if your changes will be conserved, regenerate the Apache configuration file by running
    Code:

    /usr/local/cpanel/bin/build_apache_conf
    The usual command
    Code:

    /scripts/rebuildhttpdconf
    didn't work for us.

Home this post helps peoples.


All times are GMT -5. The time now is 02:25 PM.