Hosting two websites on same webserver.

Discussion in 'Site & Server Administration' started by psb_hoit, Aug 13, 2012.

  1. #1
    Hi,I have following two queries:[1] Can i host two websites with different domain names on same webserver?[2] We have installed SSL Certificate on Apache Webserver. But when we browse the website with its domain name (without prefixing www), following error message is received:---There is a problem with this website's security certificate. The security certificate presented by this website was issued for a different website's address. Security certificate problems may indicate an attempt to fool you or intercept any data you send to the server. We recommend that you close this webpage and do not continue to this website. Click here to close this webpage. Continue to this website (not recommended). More information ---Thanks,
     
    psb_hoit, Aug 13, 2012 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    Hello there,

    Yes, you can host more than one website on the same web server, but your setup may dictate otherwise. Regarding your SSL issue, if the certificate was purchased with the 'www', then the certificate is only valid using the 'www', thus the reason that the non 'www' is flagging an error.

    Regards,
    Chris
     
    RHS-Chris, Aug 14, 2012 IP
  3. RoseHosting

    RoseHosting Well-Known Member

    Messages:
    230
    Likes Received:
    11
    Best Answers:
    11
    Trophy Points:
    138
    #3
    1. You can host multiple websites using virtual host directives. More information on how to create virtual host configurations on Apache web server you can find at http://httpd.apache.org/docs/2.2/vhosts/

    2. You can create a .htaccess file to redirect all 'non-www' to 'www' for both the HTTP and HTTPS requests.

    Create a .htaccess file to your website’s root directory and add the code below:

    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST}//s%{HTTPS} ^www\.(.*)//((s)on¦s.*)$ [NC]
    RewriteRule ^ http%3://%1%{REQUEST_URI} [L,R=301]
     
    RoseHosting, Aug 15, 2012 IP
  4. MilesWeb

    MilesWeb Well-Known Member

    Messages:
    869
    Likes Received:
    35
    Best Answers:
    7
    Trophy Points:
    173
    #4
    Yes, you can host multiple websites on the same servers. This is when VirtualHost entries comes in picture wherein you can host point multiple websites to a single IP address.

    SSL is host based so it will work only on the host which was used when issuing the SSL certificate.
     
    MilesWeb, Aug 18, 2012 IP