View Single Post
Old 08-26-2017, 08:52 AM   #9
Bookaboy
Junior Member
Bookaboy began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2017
Device: Ubuntu Linu
Virtual Host

Hi,

Thanks for you instructions on Apache. I would like to post this virtualhost example, this could be of help as well for people who are struggling with Apache and Calibre.

This is hosted on a Apache 2.4 server, and an SSL certificate by LetsEncrypt is used as well, no virtual directory was used, however.

Code:
   <VirtualHost                 *:80>
        ServerName              books.example.org
        RewriteEngine           on
        RewriteCond             %{SERVER_PORT} ^80$
        RewriteRule             ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
   </VirtualHost>

   <VirtualHost                 *:443>
        SSLEngine               On
        SSLCertificateFile      /etc/letsencrypt/live/books.example.org/fullchain.pem
        SSLCertificateKeyFile   /etc/letsencrypt/live/books.example.org/privkey.pem
        Include                 /etc/letsencrypt/options-ssl-apache.conf

        ServerName              books.example.org
        AllowEncodedSlashes     On
        RewriteEngine           On
        RewriteRule             ^/(.*) http://127.0.0.1:8081/$1 [proxy]
        RedirectMatch           301 ^/$ "/"
   </VirtualHost>
Bookaboy is offline   Reply With Quote