nginx and Aptly

69 views
Skip to first unread message

David Leader

unread,
Apr 9, 2023, 10:41:29 AM4/9/23
to aptly-discuss
I am new to linux and aptly.  I have had this working in a lab environment.  However when I have come to doing aptly live I am having problems with nginx.  I have got all of the aptly bits working.  However after publishing a snapshot I am getting a 403 error.  I have tried all sorts, changing folder and file permissions, folder owner..  I have not been able to find a good document on how to setup nginx with aptly.

I am looking for some help with this. Part of the problem I am having is we are not allowed to use github repos for our live environment.  So some of the things I have been looking at I cant download ie docker setups.

I can see from the log that the boxes are talking to the repo but getting a 403 error (13: Permission denied).

Jeremy C. Reed

unread,
Apr 10, 2023, 10:33:05 AM4/10/23
to David Leader, aptly-discuss
Are you using nginx to server just files? Does your nginx server "root"
configuration point to the public aptly directory?

Or are you attempting to use the Aptly API?

Look at your nginx error and access log files as they should have
better details.

David Leader

unread,
Apr 11, 2023, 3:30:27 AM4/11/23
to aptly-discuss
Yes I am using nginx in just files.  It is pointing to the public folder.  Here is a section of the logs and error files.

2023/04/11 07:13:14 [error] 37829#37829: *9 open() "/media/storage/aptly/public/dists/jammy/Release" failed (13: Permission denied), client:

10.64.42.27 - - [11/Apr/2023:07:13:14 +0100] "GET /dists/jammy/Release HTTP/1.1" 403 162 "-" "Debian APT-HTTP/1.3 (2.4.8) non-interactive"

I am not using the aptly API

Jeremy C. Reed

unread,
Apr 11, 2023, 3:16:55 PM4/11/23
to David Leader, aptly-discuss
On Tue, 11 Apr 2023, 'David Leader' via aptly-discuss wrote:

> Yes I am using nginx in just files.  It is pointing to the public folder. 
> Here is a section of the logs and error files.
> 2023/04/11 07:13:14 [error] 37829#37829: *9 open()
> "/media/storage/aptly/public/dists/jammy/Release" failed (13: Permission
> denied), client:

Check read and browse permissions for other (world) for each level.

For example, my nginx config has
root /srv/aptly/repo/public;


aptly@prod-repo-deb-2:/home/reed$ ls -ld / /srv/ /srv/aptly /srv/aptly/repo /srv/aptly/repo/public
drwxr-xr-x 22 root root 4096 May 19 2022 /
drwxr-xr-x 5 root root 4096 Mar 15 2021 /srv/
drwxr-xr-x 18 aptly aptly 1499136 Apr 11 19:14 /srv/aptly
drwxr-xr-x 5 aptly aptly 4096 Jun 27 2018 /srv/aptly/repo
drwxr-xr-x 11 aptly aptly 4096 Nov 20 2021 /srv/aptly/repo/public

See the drwxr-xr-x

and check the directories and files down to your Release file

David Leader

unread,
Apr 13, 2023, 9:18:26 AM4/13/23
to aptly-discuss
Thanks for that.  Looks like my problem was the uppermost folder did not have the correct permissions. 
Reply all
Reply to author
Forward
0 new messages