http to https on other ip

November 27, 2016 75 views
Apache Ubuntu 16.04

hello, as the title says
i have a apache server with ip 192.168.1.100 and a owncloud server with ip 192.168.1.101 and a emby server with ip 192.168.1.102, i already redirect with owncloud.example.com to owncloud ip and emby.example.com to emby ip but i want to redirect using https. anyone can help or give me an example how to do this with apache?

2 Answers

DO has a nice tutorial on installing an ssl certificate on your server here: https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certificate-from-a-commercial-certificate-authority

It goes on to show how you can setup domains to redirect from http to https ie by including a Redirect permanent line on the domain config file:

<VirtualHost *:80>
   ServerName example.com
   Redirect permanent / https://example.com/
</VirtualHost>
This tutorial will show you how to acquire and install an SSL certificate from a trusted, commercial Certificate Authority (CA). SSL certificates allow web servers to encrypt their traffic, and also offer a mechanism to validate server identities to their visitors. The...
  • thanks is a great tut but this is an example what i have on my apache to redirect port 80(http)
    <VirtualHost *:80>
    ServerName owncloud.domain.com
    ServerAlias owncloud.domain.com
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    <Location />
    ProxyPass http://192.168.1.101/
    ProxyPassReverse http://192.168.1.101/
    </Location>
    </VirtualHost>

    and what i want is to redirect to owncloud.domain.com to https on ip https://192.168.1.101/ and i don't know to do that

    • Do you already have an SSL certificate installed on the owncloud server? Assuming that you have, you now need to setup the redirect on the apache server with IP 192.168.1.100 like below:

      <VirtualHost *:80>
         ServerName owncloud.domain.com
         ServerAlias owncloud.domain.com
         Redirect permanent / https://192.168.1.101/
      </VirtualHost>
      

      This should redirect all incoming http request on owncloud.domain.com to https://192.168.1.101/ Make sure connections to port 443 (https) on the server with IP 192.168.1.101 are allowed

no one can help me? if someone can help or work with me i can help with some $$$

Have another answer? Share your knowledge.