The officially official Devuan Forum!

You are not logged in.

#1 2023-01-21 17:46:56

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

[SOLVED] nginx modules-available error

/etc/nginx/modules-available/ is empty

/usr/share/nginx/modules-available/ is populated

/etc/nginx/modules-enabled/ is populated

But /etc/nginx/modules-enabled/realupnow.conf" failed

I am familiar with sites-enabled and sited-enabled but cannot find anything online that explains modules-available and modules-enabled in a way that shows me how realupnow-conf would get there.

EDIT: Am I correct that I need to install nginx-module-geoip? https://stackoverflow.com/questions/365 … stallation

Last edited by dcolburn (2023-01-21 18:00:09)

Offline

#2 2023-01-21 17:59:58

steve_v
Member
Registered: 2018-01-11
Posts: 381  

Re: [SOLVED] nginx modules-available error

As you haven't told us what's in that file, I suppose I have to guess...
Going by your previous threads, perhaps it's the site definition for something you're trying to serve on the domain realupnow.com? If that is case, it's simply in the wrong directory, and the only explanation I can think of is that somebody put it there...


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#3 2023-01-21 18:02:51

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] nginx modules-available error

I'm sorry ... I'm getting tangled in the threads ...

nginx -t fusses about /etc/nginx/modules-enabled/realupnow.conf not being present.

This was in the sample code include /etc/nginx/modules-enabled/*.conf; but it errored - now I recall changing it ...

And now I recall that I never closed the loop on hunting the realupnow.conf file to put there ... sigh.

user www-data;
error_log logs/error.log notice;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/realupnow.conf;
load_module modules/ndk_http_module.so;
load_module modules/ngx_http_lua_module.so;
# include conf.d/http;
# include conf.d/stream;
# include conf.d/exchange-enhanced;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	server {
		listen     localhost:80;
	}

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# SSL Settings
	##

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# Virtual Host Configs
	##

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}

#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
#
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}

Last edited by dcolburn (2023-01-21 18:08:52)

Offline

#4 2023-01-21 18:14:14

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] nginx modules-available error

Ha! Found it on the backup USB drive (BTW: Deja Dup did not do a clean job of saving stuff at all.)

##
# Virtual Host configuration for realupnow.com
#
# Be sure to symlink this to ~/sites-enabled/ to enable it.
# sudo ln -s /etc/nginx/sites-available/realupnow.com /etc/nginx/sites-enabled/realupnow.com
#

server {
    listen 80;
    root /var/www/realupnow.com;
#   index index.html index.htm index.nginx-debian.html index.php;
    server_name realupnow.com www.realupnow.com;

    listen 443 ssl;

	location / {
		try_files $uri $uri/ =404;
	}

	# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
	}

    # RSA certificate
    ssl_certificate /etc/letsencrypt/live/realupnow.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/realupnow.com/privkey.pem;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;

	include /etc/letsencrypt/options-ssl-nginx.conf;

    # Redirect non-https traffic to https
    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    }
}

Just found this .. https://www.reddit.com/r/nginx/comments/j11tr3/whats_up_with_the_modulesenabled_directory/

It's incomplete but a little helpful ...

The relationship between /etc/nginx/modules-available/ /usr/share/nginx/modules-available/ and /etc/nginx/modules-enabled/ is unclear to me ... it's more complex than the singular relationship between /etc/nginx/sites-available and /etc/nginx-sites-enabled

And, I'm still worried that I may have broken something somewhere and maybe should completely uninstall and re-install nginx.

(Note: php-fpm has also been installed - I don't know if that might be impacted by anything I've done so far.)

WDYT?

Last edited by dcolburn (2023-01-21 18:27:20)

Offline

#5 2023-01-21 18:23:36

steve_v
Member
Registered: 2018-01-11
Posts: 381  

Re: [SOLVED] nginx modules-available error

dcolburn wrote:
include /etc/nginx/modules-enabled/realupnow.conf;

Well yeah, obviously. If you tell nginx to incude a file, it's going to try to load it, and it's going to bitch if it doesn't exist.

modules-enabled should (IIRC, I actually run apache, but the config directory layout is much the same, it's a Debian thing) contains symlinks to files in modules-available, which in turn contain load_module directives pointing at dynamic module .so files.

Only you can explain the presence of that include line, it's certainly not in any default configuration shipped with Devuan.

dcolburn wrote:

Am I correct that I need to install nginx-module-geoip?

That depends on whether or not you want to use module-geoip, no? I can't make that determination for you.

Ed. Since we're playing the edit game...

dcolburn wrote:

WDYT?

I think you should slow down, and go read the nginx manuals instead of jumping on random stackexchange and reddit posts.

Aside, while having your site definition in modules-enabled might work if you include it from some other config, it's pretty high on the list of "things that will cause a bunch of gratuitious confusion in about 2 hours time". Put it where it's supposed to go.

Last edited by steve_v (2023-01-21 18:41:38)


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#6 2023-01-21 18:33:34

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] nginx modules-available error

steve_v wrote:
dcolburn wrote:

Am I correct that I need to install nginx-module-geoip?

That depends on whether or not you want to use module-geoip, no? I can't make that determination for you.

Please disregard that question - I misread this thread as installing the module to populate defaults rather than merely using it because the OP wanted it.

https://stackoverflow.com/questions/36554405/how-to-enable-dynamic-module-with-an-existing-nginx-installation

Offline

#7 2023-01-21 18:43:30

steve_v
Member
Registered: 2018-01-11
Posts: 381  

Re: [SOLVED] nginx modules-available error

dcolburn wrote:

I misread this thread as installing the module to populate defaults rather than merely using it because the OP wanted it.

One of many reasons to read the manuals rather than just copying random things from stackoverflow...


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#8 2023-01-21 20:34:53

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] nginx modules-available error

I've tried reading the nginx instructions but find gaps and a lot of emphasis on their commercial version.

Rather than post every little question here I'm trying to Search for similar problems and then try to learn from them.

I've observed, in this Forum, that people offering help often point to non-official nginx sources where they've found explanations and examples.

(At this point it would be worth it to pay someone to set this up for me, nginx, local dns, ssl, and etc & successfully serving web pages - where I was before but for the unstable RAID1 setup. Locals either don't know this stuff or can't take on any new projects.)

Meanwhile, I'll just have to keep thrashing about until I get it working, again ...

Offline

#9 2023-01-21 21:07:42

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] nginx modules-available error

OK, problem solved ... the modules line has been deleted and realupnow.com renamed to realupnow.com.conf and the symlink fixed (sites-available to sites-enabled).

Making progress ... will mark this one as solved (cut & paste error or something) ... will open a new thread ...

Offline

Board footer