0

I have a VPS with Ubuntu 14.04 with two websites A and B.

I set up HTTPS for website A and everything is ok with https://a.com.

I don't want B to have HTTPS but when I access https://b.com, Chrome throws me a warning and if I proceed to continue viewing the website, it renders the website A.

Also, main IP of the VPS is IP1 (Which is used for website B), and I purchased another IP address IP2 (used for website A).

What do I need to change in my configuration to make Apache use separate IP addresses for the two sites?

These are the config files:

a.com-le-ssl.conf

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerAdmin lienhe.a.com
        ServerName a.com
        ServerAlias www.a.com
        DocumentRoot "/var/www/a/frontend/web"
        <Directory "/var/www/a/frontend/web">
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride All
                    Order allow,deny
                    allow from all
            </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined


    SSLCertificateFile /etc/letsencrypt/live/a.com/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/a.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLCertificateChainFile /etc/letsencrypt/live/a.com/chain.pem
    </VirtualHost>
</IfModule>

a.com.conf

<VirtualHost *:80>
    ServerAdmin lienhe.a.com
    ServerName a.com
    ServerAlias www.a.com
    DocumentRoot "/var/www/a/frontend/web"
    <Directory "/var/www/a/frontend/web">
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


RewriteEngine on
RewriteCond %{SERVER_NAME} =a.com [OR]
RewriteCond %{SERVER_NAME} =www.a.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

b.com.conf

<VirtualHost *:80>
    ServerAdmin cskh.b.com
    ServerName b.com
    ServerAlias www.b.com
    DocumentRoot "/var/www/b"
    <Directory "/var/www/b">
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


</VirtualHost>
Dave M
  • 4,514
  • 22
  • 31
  • 30
  • @JennyD I've edited the question, please help – Miller Newbie Mar 19 '19 at 10:23
  • 2
    @MillerNewbie You can make this work with different IPs (which it looks you have bought), if you mention the webserver you are using, we can probably tell you what configuration to have so each website is bound to a different IP. Having said this, having a non-ssl site is a no-no nowadays. Get a free cert from [letsencrypt](https://certbot.eff.org/). – Augusto Mar 19 '19 at 11:40
  • If you want help with your configuration, you need to actually show the configuration you have now that's not working the way you want it to. We're not going to be able to deduce which web server software you're using and how you want it to be configured out of thin air. – Jenny D Mar 19 '19 at 15:49
  • I've updated the question, please check above. Please tell if you need to see what other config files, thanks – Miller Newbie Mar 20 '19 at 03:40

0 Answers0