varunsridharan / pi-hole-android-private-dns

Script to auto-install & configure Android Private DNS For Pi-Hole
GNU General Public License v3.0
120 stars 13 forks source link

Error when installing using multipass. #21

Open AyleKalani opened 3 months ago

AyleKalani commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...' Install Multipass on Windows and then add Pi-Hole. (With the Static IP already configured.)
  2. Click on '....' Run the script, and then the email plus the domain. (In this case I am using no-ip to configure Static IP.)
  3. Scroll down to '....' Error, but it says that everything was configured
  4. See error Error details:
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Certificate not yet due for renewal

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Certificate not yet due for renewal; no action taken.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

==============================
Stopping Nginx's HTTP Server.
==============================

Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.

==============================
Setting Up Nginx To Run A DNS Stream For Android Private DNS Feature
==============================

Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.

=======================================================================================
Congrats Pi-Hole With Android Private DNS is configured.
heybrodes commented 3 months ago

Did you disable lighttpd? Pihole uses lighttpd by default and it must be disabled so it won't conflict with nginx.

AyleKalani commented 3 months ago

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?

heybrodes commented 3 months ago

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.

AyleKalani commented 3 months ago

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.``` 
heybrodes commented 3 months ago

make sure that you have streams module installed - that's the error you're getting --> unknown directive "stream" in /etc/nginx/nginx.conf:85

AyleKalani commented 3 months ago

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
AyleKalani commented 3 months ago

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.``` 
AyleKalani commented 3 months ago

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.