Open AyleKalani opened 3 months ago
Did you disable lighttpd? Pihole uses lighttpd by default and it must be disabled so it won't conflict with nginx.
Did you disable lighttpd? Pihole uses lighttpd by default and it must be disabled so it won't conflict with nginx.
Yes, but I ended up activating Apach2, could this be the problem?
The script is specifically for nginx server blocks not apache2 so it will never work on apache2 server, unless you know how to convert the server block manually.
The script is specifically for nginx server blocks not apache2 so it will never work on apache2 server, unless you know how to convert the server block manually.
I started from the beginning, but it still gave me an error. I wanted to see the details of the error, and this is what happened. (I had already disabled Lighttpd and Apache2 was not there)
root@AyKa-Teste:/home/ubuntu# systemctl status nginx.service
× nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sun 2024-06-02 01:32:33 -03; 29s ago
Duration: 195ms
Docs: man:nginx(8)
Process: 15342 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited>
CPU: 12ms
Jun 02 01:32:33 AyKa-Teste systemd[1]: Starting nginx.service - A high performance web server and a>
Jun 02 01:32:33 AyKa-Teste nginx[15342]: 2024/06/02 01:32:33 [emerg] 15342#15342: unknown directive>
Jun 02 01:32:33 AyKa-Teste nginx[15342]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jun 02 01:32:33 AyKa-Teste systemd[1]: nginx.service: Control process exited, code=exited, status=1>
Jun 02 01:32:33 AyKa-Teste systemd[1]: nginx.service: Failed with result 'exit-code'.
Jun 02 01:32:33 AyKa-Teste systemd[1]: Failed to start nginx.service - A high performance web serve>
lines 1-14/14 (END)...skipping...
× nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sun 2024-06-02 01:32:33 -03; 29s ago
Duration: 195ms
Docs: man:nginx(8)
Process: 15342 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
CPU: 12ms
Jun 02 01:32:33 AyKa-Teste systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
Jun 02 01:32:33 AyKa-Teste nginx[15342]: 2024/06/02 01:32:33 [emerg] 15342#15342: unknown directive "stream" in /etc/nginx/nginx.conf:85
Jun 02 01:32:33 AyKa-Teste nginx[15342]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jun 02 01:32:33 AyKa-Teste systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jun 02 01:32:33 AyKa-Teste systemd[1]: nginx.service: Failed with result 'exit-code'.
Jun 02 01:32:33 AyKa-Teste systemd[1]: Failed to start nginx.service - A high performance web server and a reverse proxy server.```
make sure that you have streams module installed - that's the error you're getting --> unknown directive "stream" in /etc/nginx/nginx.conf:85
make sure that you have streams module installed - that's the error you're getting --> unknown directive "stream" in /etc/nginx/nginx.conf:85
I tried again, I did everything manually without the automatic script. (Still still gets the same error.)
Manual installation: https://varunsridharan.hashnode.dev/configure-pi-hole-with-dns-over-tls-private-dns
I tried changing the location where the line is placed and it didn't help.
unknown directive "stream" in /etc/nginx/nginx.conf:62
make sure that you have streams module installed - that's the error you're getting --> unknown directive "stream" in /etc/nginx/nginx.conf:85
I tried again, I did everything manually without the automatic script. (Still still gets the same error.)
Manual installation: https://varunsridharan.hashnode.dev/configure-pi-hole-with-dns-over-tls-private-dns
I tried changing the location where the line is placed and it didn't help.
unknown directive "stream" in /etc/nginx/nginx.conf:63
ubuntu@AyKa-PiHole:~$ journalctl -xeu nginx.service
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit nginx.service has finished with a failure.
░░
░░ The job identifier is 176 and the job result is failed.
Jun 02 11:08:38 AyKa-PiHole systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
░░ Subject: A start job for unit nginx.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit nginx.service has begun execution.
░░
░░ The job identifier is 971.
Jun 02 11:08:38 AyKa-PiHole nginx[1191]: 2024/06/02 11:08:38 [emerg] 1191#1191: unknown directive "stream" in /etc/nginx/nginx.conf:62
Jun 02 11:08:38 AyKa-PiHole nginx[1191]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jun 02 11:08:38 AyKa-PiHole systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStartPre= process belonging to unit nginx.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Jun 02 11:08:38 AyKa-PiHole systemd[1]: nginx.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit nginx.service has entered the 'failed' state with result 'exit-code'.
Jun 02 11:08:38 AyKa-PiHole systemd[1]: Failed to start nginx.service - A high performance web server and a reverse proxy server.
░░ Subject: A start job for unit nginx.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit nginx.service has finished with a failure.
░░
░░ The job identifier is 971 and the job result is failed.```
After testing on a new machine without using multipass, it always gives an error when starting or restarting Nginx. (Lighttpd disabled or did not give an error when restarting Nginx.)
In this attempt I tried on Debian.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior: