Hello, I’m trying to install seafile according to this tutorial https://www.howtoforge.com/tutorial/seafile-on-ubuntu-with-nginx/ for quite a while now, but I’m experiencing problems. After generating the certbot.conf file and adding the configuration ‘location /.well-known { alias /var/www/html/.well-known; }‘ to it and putting the include statement in /sites-available/default I receive the following error after restart of nginx: ‘nginx[9675]: nginx: [emerg] “location” directive is not allowed here in /etc/nginx/snippets/certbot.conf Please help. Many thanks in advance. Bernd
Hello, and thanks for the quick response. See the attached file. (Name changed from certbot.conf to certbot.txt due to forum rules) Seems to be as stated in the tutorial. right? Regards Bernd
I learned using Internet Search Engines that: "location" directive should be inside a 'server' directive, http://nginx.org/en/docs/http/ngx_http_core_module.html#server
Hello, I put a server directive around the location statement, using 'server_name "";' Does the default server work here? The error has gone, but is replaced by this now: nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/cloud.hakase-labs.io/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/cloud.hakase-labs.io/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file) For me it seems the system wants to create new files, but can't do, right? Regards Bernd
Rather it looks like nginx tries to read that file but fails because the file does not exist. There is configuration error, it is trying to find the file in the wrong place or with the wrong filename. That file looks like certificate file, have you created a certificate? Where is it?
Thats what I did concerning nginx: Code: sudo apt install nginx -y Code: systemctl start nginx systemctl enable nginx Code: sudo apt install letsencrypt -y Code: cd /etc/nginx/ vim snippets/certbot.conf I used nano instead of vim and added to certbot.conf Code: server { server_name ""; location /.well-known { alias /var/www/html/.well-known; } } Server directive added according to your post, Taleman Code: vim sites-available/default I used nano again and added after 'server {...}': Code: include snippets/certbot.conf; Code: nginx -t systemctl restart nginx Code: certbot certonly --rsa-key-size 4096 --webroot --agree-tos --no-eff-email --email [email protected] -w /var/www/html -d cloud.hakase-labs.io I wonder a bit about this hakase stuff, but got no error here so far I remember. I guess a file is fetched from cloud.hakase-labs.io and the mail address is the account credential, right? I think around here might be the problem. Code: openssl dhparam -out /etc/nginx/dhparam.pem 4096 this took quite some time and there is a file dhparam.pem under /etc/nginx
This command requests an SSL cert from Let's encrypt. cloud.hakase-labs.io is the domain that the tutorial author used. exchange it with your own domain name and change the email address to your own address as well.
Hello again, I invested another day and started from scratch again. I managed to get around all the trouble with synthax and have a configuration ready now, but still get errors. Here is again the link to the tutorial on howtoforge.com I'm working with: https://www.howtoforge.com/tutorial/seafile-on-ubuntu-with-nginx/ Everything is perfect till the installation of letsencrypt. Installation itself works fine, I get no more synthay errors for Code: nginx -t , but running Code: /etc/nginx# certbot certonly --rsa-key-size 4096 --webroot --agree-tos --no-eff-email --email [email protected] -w /var/www/html -d nginx-svr.bt results in : Code: Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator webroot, Installer None Obtaining a new certificate Performing the following challenges: http-01 challenge for nginx-svr.bt Using the webroot path /var/www/html for all unmatched domains. Waiting for verification... Cleaning up challenges Failed authorization procedure. nginx-svr.bt (http-01): urn:ietf:params:acme:error:dns :: DNS problem: NXDOMAIN looking up A for nginx-svr.bt IMPORTANT NOTES: - The following errors were reported by the server: Domain: nginx-svr.bt Type: None Detail: DNS problem: NXDOMAIN looking up A for nginx-svr.bt root@FILER_BT:/etc/nginx# So how do I have to advertise the server to the DNS-system? This is may certbot.conf file: Code: server { listen 80; listen [::]:80; server_name nginx-svr.bt; root /var/www/nginx-svr; index index.html; location /.well-known { alias /var/www/html/.well-known; } }