Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 12-06-2018, 02:39 PM   #1
yourrable
Member
yourrable began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2018
Location: India
Device: none
How to enable HTTPS in Ubuntu server?

Hello,

I have Ubuntu VPS running a WordPress blog already. It is using SSL from Let's Encrypt. My calibre-server is running on port 5770. How do I enable HTTPS on my VPS for calibre?

I am running Ubuntu 16 and WordPress site on Apache.

Thank you.
yourrable is offline   Reply With Quote
Old 12-07-2018, 03:07 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
use one of the reverse proxy setups, as described here: https://manual.calibre-ebook.com/server.html
kovidgoyal is online now   Reply With Quote
Advert
Old 12-07-2018, 05:16 AM   #3
yourrable
Member
yourrable began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2018
Location: India
Device: none
Quote:
Originally Posted by kovidgoyal View Post
use one of the reverse proxy setups, as described here: https://manual.calibre-ebook.com/server.html
Thank you for the reply.

I am using "Using a URL prefix" as I am not familiar with full virtulhost method and I am afraid of breaking my existing website that is running on my tld with https.

I have added `--url-prefix /calibre` but I can not see anything at `/calibre`. I it still being serverd at `hostnameort/`

What can I do?
yourrable is offline   Reply With Quote
Old 12-07-2018, 08:56 PM   #4
yourrable
Member
yourrable began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2018
Location: India
Device: none
Quote:
Originally Posted by yourrable View Post
Thank you for the reply.

I am using "Using a URL prefix" as I am not familiar with full virtulhost method and I am afraid of breaking my existing website that is running on my tld with https.

I have added `--url-prefix /calibre` but I can not see anything at `/calibre`. I it still being serverd at `hostnameort/`

What can I do?
I figured it out. I was pointing to the wrong key and certificate file to begin with. I have successfully enabled HTTPS on my calibre server.

Thank you so much.
yourrable is offline   Reply With Quote
Old 12-14-2018, 02:54 PM   #5
dator
Member
dator began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Jul 2018
Device: Kobo Aura HD
Hello,

Would it be too much to ask for little step by step turtorial on how to utilize HTTPS in calibre server?
Despite following these instruction https://manual.calibre-ebook.com/server.html I can't figure it out.

I have purchased domain and would like to use its SSL certificate.
dator is offline   Reply With Quote
Advert
Old 12-15-2018, 09:30 AM   #6
yourrable
Member
yourrable began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2018
Location: India
Device: none
Quote:
Originally Posted by dator View Post
Hello,

Would it be too much to ask for little step by step turtorial on how to utilize HTTPS in calibre server?
Despite following these instruction https://manual.calibre-ebook.com/server.html I can't figure it out.

I have purchased domain and would like to use its SSL certificate.

Do you have VPS, if yes install certbot. Then generate certificate using certbot. Most of time, it will be done by running simple command, `$ certbot`.

Your certificate and keyfile will be located at `/etc/letsencrypt/live/{your domain name here}/{fullchain.pem & privkey.pem}. Give them necessary read permissions and use it as follow,

Code:
/opt/calibre/calibre-server      --enable-auth     --ssl-keyfile /etc/letsencrypt/live/{your domain here}/privkey.pem   --ssl-certfile /etc/letsencrypt/live/{your domain here}/fullchain.pem    --log=/var/log/calibre-server.log     --port=5770    --daemonize "library path"
and you're good to go.

Access your server with `https://ip:port`

Hope it helps.

P.S. Sorry for my bad English.

Last edited by yourrable; 12-17-2018 at 10:28 PM. Reason: insert noparse tags
yourrable is offline   Reply With Quote
Old 12-17-2018, 11:19 AM   #7
dator
Member
dator began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Jul 2018
Device: Kobo Aura HD
Quote:
Originally Posted by yourrable View Post
Do you have VPS, if yes install certbot. Then generate certificate using certbot. Most of time, it will be done by running simple command, `$ certbot`.

Your certificate and keyfile will be located at `/etc/letsencrypt/live/{your domain name here}/{fullchain.pem & privkey.pem}. Give them necessary read permissions and use it as follow,

`/opt/calibre/calibre-server --enable-auth --ssl-keyfile /etc/letsencrypt/live/{your domain here}/privkey.pem --ssl-certfile /etc/letsencrypt/live/{your domain here}/fullchain.pem --log=/var/log/calibre-server.log --port=5770 --daemonize "library path"` and you're good to go.

Access your server with `https://ip:port`

Hope it helps.

P.S. Sorry for my bad English.
Thanks for your post. I tired it but got this error

Code:
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open log
dator is offline   Reply With Quote
Old 12-17-2018, 10:27 PM   #8
yourrable
Member
yourrable began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2018
Location: India
Device: none
Quote:
Originally Posted by dator View Post
Thanks for your post. I tired it but got this error

Code:
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open log
This article may help:
https://www.liquidweb.com/kb/error-9...ubuntu-solved/

Why are you running calibre-server from port 80?
yourrable is offline   Reply With Quote
Old 12-23-2018, 03:58 PM   #9
dator
Member
dator began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Jul 2018
Device: Kobo Aura HD
Quote:
Originally Posted by yourrable View Post
This article may help:
https://www.liquidweb.com/kb/error-9...ubuntu-solved/

Why are you running calibre-server from port 80?
Thank you for pointing me in right direction, yourrable.

Strangely I'm experiencing more problems. I simply can't start calibre server. Here's the error

Code:
user@xxx:~$ sudo systemctl status calibre.service
● calibre.service - Calibre Service
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)


Dec 24 09:30:39 xxx systemd[1]: [/lib/systemd/system/calibre.service:12] Unknown lvalue '--max-opds-ungrouped-items' in section 'Se
Dec 24 09:30:39 xxx systemd[1]: [/lib/systemd/system/calibre.service:13] Unknown lvalue '--port 8283  --log' in section 'Service'
Dec 24 09:30:39 xxx systemd[1]: [/lib/systemd/system/calibre.service:14] Missing '='.
Dec 24 09:31:35 xxx systemd[1]: [/lib/systemd/system/calibre.service:11] Unknown lvalue '--max-opds-items' in section 'Service'
Dec 24 09:31:35 xxx systemd[1]: [/lib/systemd/system/calibre.service:12] Missing '='.
Dec 24 09:41:15 xxx systemd[1]: [/lib/systemd/system/calibre.service:11] Unknown lvalue '--max-opds-items' in section 'Service'
Dec 24 09:41:15 xxx systemd[1]: [/lib/systemd/system/calibre.service:12] Unknown lvalue '--max-opds-ungrouped-items' in section 'Se
Dec 24 09:41:15 xxx systemd[1]: [/lib/systemd/system/calibre.service:13] Missing '='.
Dec 24 09:50:38 xxx systemd[1]: [/lib/systemd/system/calibre.service:11] Missing '='.
Dec 24 09:50:38 xxx systemd[1]: [/lib/systemd/system/calibre.service:11] Missing '='.
My configuration is as follow

Code:
[Unit]
Description=Calibre Service
After=network.target

[Service]
Type=simple
User=xxx
Group=calibre

ExecStart=/usr/bin/calibre-server\
--max-opds-items=30\
--max-opds-ungrouped-items=100\
--port 8282 \
--log=/logfile/.log \
--enable-auth \
--ssl-keyfile /etc/letsencrypt/live/domain/privkey.pem \
--ssl-certfile /etc/letsencrypt/live/domain/fullchain.pem \

"/path/to /library"

[Install]
WantedBy=multi-user.target
I'm really puzzled right now.

Last edited by dator; 12-24-2018 at 04:17 AM.
dator is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you enable HTTPS on the content server? Inukami Server 17 03-27-2020 08:15 PM
installing Calibre content server 3 on ubuntu server 16_04 khyox Calibre 22 01-06-2018 11:34 PM
Calibre-server ubuntu server GeekNbOne Calibre 1 10-03-2017 09:52 PM
Ubuntu Server Karlieth Devices 8 12-13-2015 01:02 AM
Content server on ubuntu 12.04 headless server ImageMagick: libltdl.so.7 Cool Javelin Calibre 5 04-08-2015 02:20 AM


All times are GMT -4. The time now is 03:45 AM.


MobileRead.com is a privately owned, operated and funded community.