Dear all,
I try to install nginx revere proxy from the habian-config menu (running on Debian 10 on a laptop).
During the last step I get an error message and the config-menu tells me to report here in the community forum.
When I close the config-menu, I see these last lines with the error:
nginx: [emerg] “server_name” directive is not allowed here in /etc/nginx/sites-enabled/openhab:8
nginx: configuration file /etc/nginx/nginx.conf test failed
2020-05-02_21:31:27_CEST [openHABian] Checking for default openHABian username:password combination… SKIPPED (method not implemented)
all files in /etc/nginx and /etc/nginx/sites-enabled have owner:group root:root and -rw-r–r–.
Any advice?
I know, I always have to look that up. I wrote it to tell you what I am talking about, not as a manual. But you are right, should have written it correct for other users searching for info themselves.
In the attachements you find my openhab and nginx.conf -files: openhab.txt (2.0 KB) nginx.conf.txt (2.0 KB)
The file: /var/log/nginx/error.log is empty, and /etc/nginx/.htpasswd exists and has one line for the user I expected.
The only message that I get in openhabian-config is: ‘The installation of NGINX did not succeed, get help from the community’.
Then when I close openhabian-config, I see these messages that I posted in my first message.
nginx: [emerg] “server_name” directive is not allowed here in /etc/nginx/sites-enabled/openhab:8
nginx: configuration file /etc/nginx/nginx.conf test failed
[openHABian] Checking for default openHABian username:password combination… SKIPPED (method not implemented)
I did not get any other message!
When I try to connect the app, I thought it did not do anything, but that turned out to be a problem with port forwarding. But what does go wrong, is that I do not gave to use any username or password. Anything goes, even leaving u.n. and p.w. blank!
When I portforward port 80 to openhab, I get a page: ‘Welcome to nginx!~’ So nginx is running, but it’s not asking for credentials.
I’m sorry I didn’t tell that right away, but that was because I simply didn’t know. When the openhabian-config told me the installation didn’t succeed, I thought that it really didn’t. Now I see it did do something but not all is working. I really thought I told you all there is. I would never ask for help and deliberately leave out stuff that is important for the solution.
nginx: [emerg] “server_name” directive is not allowed here in /etc/nginx/sites-enabled/openhab:8
nginx: configuration file /etc/nginx/nginx.conf test failed
Line 8 in that file contains no such directive. I believe you have messed up your nginx setup earlier.
Upgrade to latest openhabian, delete nginx (apt-get purge nginx; rm -rf /etc/nginx), and reinstall using option 43.
Sorry, I missed the nginx -t part from your post. It gives me:
nginx: [emerg] “server_name” directive is not allowed here in /etc/nginx/sites-enabled/openhab:8
nginx: configuration file /etc/nginx/nginx.conf test failed
After flush nginx and remove the directories, I reinstalled using option 43. After the ssl-stuff I get the same error message, which I copied in the attached png-file.
After closing openhabian-config I see these lines at the end of nginx-installation:
Selecting previously unselected package nginx.
(Reading database … 156736 files and directories currently installed.)
Preparing to unpack …/nginx_1.14.2-2+deb10u1_all.deb …
Unpacking nginx (1.14.2-2+deb10u1) …
Setting up nginx (1.14.2-2+deb10u1) …
Updating FireMotD available updates count …
cp: cannot create regular file ‘/etc/nginx/sites-enabled/openhab’: No such file or directory
sed: can’t read /etc/nginx/sites-enabled/openhab: No such file or directory
And at the end of filling in the ssl-stuff:
sed: can’t read /etc/nginx/sites-enabled/openhab: No such file or directory
sed: can’t read /etc/nginx/sites-enabled/openhab: No such file or directory
sed: can’t read /etc/nginx/sites-enabled/openhab: No such file or directory
sed: can’t read /etc/nginx/sites-enabled/openhab: No such file or directory
sed: can’t read /etc/nginx/sites-enabled/openhab: No such file or directory
sed: can’t read /etc/nginx/sites-enabled/openhab: No such file or directory
nginx: [emerg] open() “/etc/nginx/nginx.conf” failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
2020-05-05_11:28:06_CEST [openHABian] Checking for default openHABian username:password combination… SKIPPED (method not implemented)
When I cd to /etc/nginx, this directory does not exist. But When I connect my browser to my outside ip, I get the ngix welcome-page:
And again, I can use the openhab-app without using authentication…
It is a relief that you can reproduce this!
Sorry I’d I sound stupid, but how do I restore from backup?
I tried ‘sudo restore> ls’ but that command is not known on my Debian install.
I understand youth don’t have pity with someone who doesn’t make backups.
What I don’t understand is why you expect me to make a backup of a fresh install when it is finished only half.
I do have the old installation, but that was on Debian 9 with openhab 2.4. Can I use that nginx backup? Or do I only need the file etc/nginx/sites-enabled/openhab?
Since it’s a fresh install, and since installing and reinstalling didn’t help, I’m afraid this is going nowhere.
I will try the backup from the old installation, if that fails I give up on nginx and keep an eye on this forum for others with the same problem on new installs.
My problem seams to be that I am not able to explain to you that installing nginx does not result in the proper directories with a working result. Must be my English. Nevermind, thanks for trying.