/srv/irclogs.ubuntu.com/2015/01/31/#ubuntu-server.txt

=== Lcawte is now known as Lcawte|Away
delinquentmehey all. I'm designing some analytical chemistry instruments on a linux system and I'm trying to sort out the best way to handle persisting / storage of 50 milisecond events -- each event is a really tiny numpy float1600:16
delinquentmea friend suggested syslog ... but  I cant help but think that buffering in memory ( not sure if syslog does this ) and then writing to a file00:17
delinquentmewould be a better solution00:17
=== bilde2910 is now known as bilde2910|away
=== markthomas is now known as markthomas|away
=== zz_DenBeiren is now known as DenBeiren
=== Lcawte|Away is now known as Lcawte
=== blanoz is now known as Blanoz
=== gblfxt_ is now known as gblfxt
Thornhello12:16
ThornI've got a new 14.04 server where SSL doesn't work at all (server vert verification fails). can't git clone from github, pip install doesn't work, etc.12:17
Thornupdate-ca-certificates --fresh didn't help12:18
Thornany idea how it can be fixed?12:19
spicypixelThorn: is it because openssl hasn't been updated?13:06
ThornI ran aptitude update; aptitude upgrade, it didn't update openssl13:07
Thorn(this is a dedicated server from leaseweb so I didn't install ubuntu myself. apparently it was updated from a previous version, and there were other weird things that I fixed. maybe I should reinstall the OS using ILO)13:08
devster31hi, can I avoid restarting the server after updating openssl package? this command cat /var/run/reboot-required.pkgs tells me it's the only package that's requesting a reboot but I'd avoid that if possible13:32
devster31the package is libssl1.0.013:40
Meerkatrestart apache. and anything else using openssl.13:43
devster31and the warning goes away?13:45
devster31I have nginx, i suppose it's the same13:45
ikoniadevster31: if you want server security - restart the server14:15
ikoniadevster31: if you don't take it seriously, try to work around it14:15
ikoniaso many things are linked against ssl - even if they are not using them14:15
devster31I don't take it very seriously, I run a very small server for 2 or 3 people without any kind of sensitive data, I'm making myself more comfortable with the admin tasks14:35
=== bilde2910|away is now known as bilde2910
=== DrStrangeRoy is now known as RoyK
=== Lcawte is now known as Lcawte|Away
=== Lcawte|Away is now known as Lcawte
=== Blanoz is now known as blanoz
=== blanoz is now known as Blanoz
OliPicardGreetings everyone, I'm having problems with my Nginx instance. I have setup the correct SSL information however if the config is setup to listen to port 443 nginx refuses to bind to the port. Nothing else is binding to the same port and ive tried killing all nginx proceses to no avail.19:19
TJ-OliPicard: what error message do you get? to bind to a privileged port (port number < 1024) the process needs netadmin capabilities, or run as root19:20
OliPicardone second, i'll paste the error19:21
OliPicardhttps://www.digitalocean.com/community/questions/nginx-is-unable-to-bind-to-44319:21
RoyKTJ-: nginx does that by default :P19:22
OliPicardid be happy to provide my nginx config as well.19:22
OliPicardhttps://gist.github.com/anonymous/cda414038cb8de41b86f <thats my config at the moment19:23
TJ-RoyK: Indeed... but if it is being launched under a non-privileged user ID, it won't be able to19:23
RoyKTJ-: well, if it can bind to port 80, it certainly can bind to port 44319:23
OliPicardthe master process is being run by root.19:24
TJ-OliPicard: What does it report in the log ?19:24
OliPicardroot has full access perms19:24
OliPicardnginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)19:24
OliPicardyet when i run a netstat it only shows nginx as running.19:25
OliPicardtcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      3494/nginx19:25
TJ-OliPicard: The way I read the docs, if you want to bind for IPv4 and IPv6, you just need a single "listen [::]:443" without "ipv6only=on" and no separate "listen 443 ssl" for IPv419:31
OliPicardTJ-: tried it but still wont bind19:34
OliPicardim thinking of just using http, too much fuss for https.19:34
TJ-OliPicard: Any other nginx config files being read that might be conflicting? It sounds to me that it has already bound to the port. With the single "listen [::]:443" do you get the same error report?19:35
OliPicardYup19:35
OliPicardand it's only 1 nginx instance running according to netstat.19:36
OliPicardwhich is the IPV6 version we just added.19:36
TJ-OliPicard: then I'm going to point at there being multiple configs being read19:36
OliPicardthe default config has been deleted19:37
OliPicardthe only config running is the current one i've been using.19:37
TJ-OliPicard: comment out that "listen" line so there are none you know of, and then try starting it, see what happens, whether something is bound to 443 in that case19:38
OliPicardTJ-: Nothing else running 443 after uncommenting that config.19:39
OliPicardwhen i comment it back and restart the only instance is the correct 443 one however nginx is saying it wont bind.19:40
OliPicardeven thought i can see in inside ubuntu that it's binding.19:40
OliPicarddecided to rebuild the instance on a different host to see if it improves.20:28
TJ-OliPicard: is it possible 2 instances of nginx are being started and the 2nd therefore fails? Any clues as to which PIDs generate the warning message?21:02
tewardTJ-: was going to say he only needs a `Listen 443` and it should autobind to everything, but I see a bigger problem in his config21:38
tewardTJ-: https://gist.github.com/anonymous/cda414038cb8de41b86f#file-gistfile1-txt-L9  Line 9 is ***BAD***21:39
teward(POODLE)21:39
tewardand i'm wrong, that'd be v4 only.  he needs at least the two listens, the one with ipv6only would bind to v621:41
tewardbut the bigger issue I see is POODLE21:41
TJ-teward: According to the docs, a single "listen" can bind to both IPv4 and IPv6 of the form "listen [::]:443""21:42
tewardTJ-: which docs?  If you say the nginx wiki i'mma smack you that's old21:42
teward(not really, but i'm going to reiterate that wiki hasn't been updated in eons)21:42
tewardif ipv6only=off is specified, then probably21:43
tewardbut it's default-on apparently21:44
tewardhttp://nginx.org/en/docs/http/ngx_http_core_module.html#listen21:44
tewardTJ-: whether that's the case or not, he's got a POODLE exploit path with that config there with SSLv321:44
tewardso he needs to update that if he shows up again21:44
OliPicardIve just tested my node.js https stack on a new host. The nginx problem still persists across platforms.21:51
tewardOliPicard: you have a bigger problem first21:52
tewardOliPicard: your setup and config open you up to POODLE - the vulnerability that effectively killed SSLv321:53
tewardOliPicard: paste *all* your configs for the site, you can sanitize auth and IP addresses, but put something in place as placeholders.  I mean all the configs.21:53
tewardnginx.conf21:53
tewardsite config21:53
tewarddefault.conf21:53
OliPicardRoger that, I'm all years.21:53
tewardeverything listed in /etc/nginx/sites-enabled21:53
OliPicardops ears*21:53
tewardOliPicard: and while we're at it, change line 9 in your site configs to this: `ssl_protocols TLSv1 TLSv1.1 TLSv1.2;`21:55
tewardremove the backticks in your conf too21:55
tewardI apologize if i'm sounding bossy, but debugging nginx loadtime problems?  Configs all help :)21:55
* teward yawns21:57
OliPicardno it's aboslutely fine :)21:57
OliPicardhttps://gist.github.com/anonymous/9523914622e2a574b3db21:57
tewardstaring at code all day didn't help either :)21:57
tewardOliPicard: that's your site configuration - i also need the other site(s) in /etc/nginx/sites-enabled (if any exist), and your nginx.conf21:57
tewardbecause i think you have a conflict in the one instance with something else listening21:57
tewardalso this will only listen on v4 with `listen 443 ssl` or similar21:58
OliPicardunder sites-enabled theres a default vhost (the default nginx config)21:58
OliPicardposting the nginx.conf shoftly :)21:58
tewardOliPicard: remove that if you don't need it21:59
tewardBTW, lets strive to use indentation for ease of reading - https://gist.github.com/teward/09313a3c16f29ea1cf4a21:59
OliPicardteward: https://gist.github.com/anonymous/d6fa7025fc9ffa9a1688 < thats the conf22:03
tewardOliPicard: remove the default config from sites-enabled (it's just a symlink, the original default config is in sites-available).  i assume your config is in sites-available and symlinked into sites-enabled?22:04
OliPicardteward: yup have gone ahead and done that. Yes the config is symlinked22:05
tewardOliPicard: okay, `sudo service nginx stop; sudo service nginx configtest`22:06
tewardsee whether there's any errors triggered22:06
teward(the reason i want you to stop is so it can forget the default config)22:06
OliPicardHave gone ahead and run both commands checking the logs now22:06
tewardit'd output any config errors22:07
tewardsaid "Config test passed" or "Failed" or something22:07
OliPicardhmm binding is still failing22:07
tewardworst case test: sudo nginx -t22:07
OliPicardconfig test passed22:07
tewardOliPicard: sudo netstat -tulpn | grep 44322:07
tewardpastebin the output22:07
teward(if its one line you can probably paste it here, if its more than one... well, pastebin)22:07
OliPicardroger that doing that now :)22:08
tewardOliPicard: was the binding error on 80 or 443?22:08
OliPicardhttps://gist.github.com/anonymous/5478aac9e1022393698822:08
OliPicardport 44322:08
OliPicardteward: sorry port 443 and the paste has been included above.22:10
tewardOliPicard: okay, it looks like nginx is running somewhere else as well... hmm...22:12
tewardOliPicard: did you stop the nginx service?22:12
OliPicardi did indeed :)22:12
tewardOliPicard: okay then you have a rogue nginx process22:12
tewardOliPicard: killall -15 nginx22:13
OliPicardi did a ps aux | grep nginx22:13
tewardOliPicard: it might be stale - still run the nuke to kill the processes22:13
OliPicardok then use the service again to boot up?22:13
tewardyes22:13
tewardsee if that solves the binding problem22:13
=== bilde2910 is now known as bilde2910|away
OliPicardteward: unfortunately it hasn't the strange part was that the default nginx page displayed for 5 seconds, upon refreshing the server had terminated the connect.22:16
OliPicard*connection22:16
TJ-:q22:16
tewardOliPicard: I'm not sure what you just said?  Are you saying that it was the default page and not your app instead of what you expected?22:17
tewardblah gotta run to take the girlfriend on the date i promised >.<22:18
OliPicardteward: the default nginx html page, refreshed and the server error still persists unfortunately22:18
tewardOliPicard: okay, i have to run, but if you don't get a resolution here, try in #nginx here on IRC, that's the main nginx support22:19
OliPicardThanks Teward!22:19
tewardgotta take the girlfriend out :)22:19
TJ-OliPicard: if it is any consolation I can reproduce your issue here22:30
OliPicardTJ-: Phew glad i'm not the only one!22:31
TJ-Makes it easier to diaagnose, for sure22:31
OliPicardYup, im wondering if it's a dependcy22:32
TJ-$ sudo netstat -tnlp | grep 44322:34
TJ-tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      15282/nginx22:34
TJ-tcp6       0      0 :::443                  :::*                    LISTEN      15282/nginx22:34
* TJ- laughs ... I think I know what you've *not* done!22:35
TJ-OliPicard: The config file you're editing - what is the exact path to it?22:35
OliPicardTJ-: the path is /etc/nginx/sites-available/host22:37
OliPicarddid an ls no other files in the same area22:37
TJ-OliPicard: That's it bingo!22:37
TJ-OliPicard: Did you forget to create the *symlink* to it in "/etc/nginx/sites-enabled/" ?22:38
OliPicardTJ-; Did create a syslink at that location :)22:39
TJ-OliPicard: I got your exact issue with no symlink... soon as it was created, nginx started correctly22:39
OliPicardsudo ln -s /etc/nginx/sites-available/hostconf /etc/nginx/sites-enabled/22:40
OliPicardthats what i used :)22:40
OliPicardTJ-: Not sure if that was the same as the link you did?22:42
TJ-OliPicard: Weird. I deleted the link again, and now the failure doesn't occur22:43
OliPicardhow did you delete the link?22:45
OliPicardi'll try again to create a link and see if that works22:45
OliPicardTJ-: Nope sadly the link didn't work for me22:48
TJ-OliPicard: Now, without the link nginx starts but doesn't bind to any sockets. With the link it starts and listens correctly.22:49
TJ-OliPicard: This is the config file: http://paste.ubuntu.com/9984494/22:50
OliPicard1 sec ill grab my current config :)22:52
TJ-OliPicard: Have you checked the SSL key and certs are reachable by nginx process?22:53
OliPicardTJ-: How do i check that?22:53
OliPicardTJ-: current config - http://paste.ubuntu.com/9984542/22:54
TJ-It probably won't cause that error - I tested it here, it gives a different specific missing file warning22:55
TJ-OliPicard: Has nginx ever started since installation?22:57
OliPicardTJ-: Yup it has just for some reason it struggles to bind on port 443. if i set it to port 80 its fine.22:58
TJ-I'm wondering if it might be caused by a default installation config issue, such as something not created/written under /var/lib/nginx/ for example. I'm purging and reinstalling it here, to test that, since I know I was able to reproduce the issue22:58
spicypixelso, bit weird, using winbind and 2012 AD, I've got to the point where I can log into any user on the AD list, and it shows the groups it's in, but brings up "groups: cannot find name for group ID 5001" on login, and groups confirms it's in the right group + 5001 which has no name, has no local entry not AD entry I can see23:00
OliPicardTJ-: Ok, i shall await to see if you can recreate the bug :)23:01
TJ-OliPicard: Grrr, no, I can't23:02
OliPicardTJ-: did you use a pass phrase on the certificate?23:04
TJ-OliPicard: No23:04
TJ-OliPicard: Hmmm, that's a good point! Did you?23:04
OliPicardI did!23:04
OliPicardlet me see if that's the problem23:05
TJ-OliPicard: It isn't - I added a passphrase to my private key and tested it. It prompts for the passphrase, and gives "[emerg] 17145#0: SSL_CTX_use_PrivateKey_file("/etc/ssl/private/iam.tj.key") failed (SSL: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt error:0906A065:PEM routines:PEM_do_header:bad decrypt error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib)"23:07
OliPicardhmm mine never prompts me for a passphrase23:08
TJ-OliPicard: Then it doesn't have one :)23:08
OliPicardTJ-; But during the CSR request i input a unique certificate passphrase.23:09
TJ-OliPicard: Use openssl to check it23:09
TJ-OliPicard: "openssl rsa -noout -text -in /srv/ssl/domain.io.key"23:11
OliPicardTJ-: Nope still not working. did decrypt the passphrase.23:14
TJ-OliPicard: Let's go back to basics. Ensure no nginx processes are running (use ps to confirm) then start it under strace: "strace -o /tmp/nginx.log -f nginx -c /etc/nginx/nginx.conf" then "pastebinit /tmp/nginx.log"23:16
OliPicardTJ-: https://gist.github.com/anonymous/25350d2b06007aaa01ee23:21
TJ-OliPicard: line 487 shows it worked23:22
OliPicardYup yet if i type sudo nginx the log shows it's not binding23:23
OliPicardi know it's binding from what i can see, just nginx doesn't think it is.23:24
TJ-OliPicard: how do you mean "if i type sudo nginx" ?23:24
TJ-OliPicard: If the service/process is already started that command would be expected to report the socket is already in use23:24
OliPicardTJ-: I'm seeing the msgs coming up also in my nginx logs.23:25
OliPicardsudo nginx nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use) nginx: [emerg] still could not bind()23:25
TJ-OliPicard: If it is already running that's what you'd expect. The strace log you showed, proves it is bound and listening correctly23:26
TJ-exit23:27
OliPicardTJ-: I'm seeing the same msg showing on /var/log/nginx/error.log23:27
TJ-OliPicard: But you'd expect to! the process is running until you kill it23:28
OliPicardI have!23:28
OliPicardUsing the killall command serval times23:28
TJ-OliPicard: When you run "nginx" it forks into the background. If you use "service nginx start" then you can "service nginx stop" to stop it, otherwise you have to "killall nginx"23:28
OliPicardevery time i boot up it gives the same error message about being unable to bind.23:28
TJ-OliPicard: You mean when the init system starts nginx automatically?23:29
OliPicardi'll try another start23:29
OliPicardYes TJ-:23:29
TJ-OliPicard: Is the network 'up' at that point?23:29
OliPicardI believe it is23:30
OliPicardI'm running the box off of a linode.23:30
TJ-OliPicard: OK, I'd expect it to be active then23:30
TJ-The thing is we've just proved, with strace, that it does start correctly, so there's something else going on23:31
OliPicardi also tried using a KVM based server to just to rule out it being an Xen issue.23:32
TJ-OliPicard: Is apache also installed/starting on that host?23:32
OliPicardi had to the exact same problems on the KVM box as i did on the Xen box23:32
OliPicardNope i checked :)23:32
OliPicardif i try to visit the site it's still down23:33
TJ-it's got to be something you are (not) doing :)23:33
=== Blanoz is now known as blanoz
TJ-OliPicard: OK, let's separate the site-down from whether the process is listening - DNS misconfiguration could cause site-down issues23:34
OliPicardok23:35
TJ-OliPicard: Silly question, but, the "already in use" messages in the log file - they *are* repeating, with new current timestamps?23:35
OliPicardTJ-: Not that i can see, the last timestamped bind error was 23:24pm23:36
TJ-OliPicard: If in a 2nd ssh shell you run "sudo tail -f /var/log/nginx/error.log", and then on the 1st ssh shell so "sudo service nginx restart" ... does the log tail show those errors23:36
OliPicardill check 1 second :)23:37
TJ-OliPicard: OK! So, those are *old* reports and do not represent what is happening *now*. My point being, it has likely been working correctly for a while now but your testing - via trying to access the site - may fail due to other reasons23:37
OliPicardTJ-: Ok, so normally you would see a gateway error at the least?23:39
TJ-OliPicard: That depends on a lot of variables! No.1 is to ensure after the process has started, it continues to run, and is listening on the port. USe "sudo netstat -tnlp | grep 443" for that23:40
TJ-OliPicard: If that shows it is listening... then proceed to figure out why a user agent can't access it. Likely to do with the proxy config, or firewall, or routing, or any number of other things23:41
OliPicardThe firewall is open to all on port 44323:42
OliPicardThe DNS has an A record pointing to the server.23:42
TJ-OliPicard: OK, but the config is to proxy to localhost:900123:42
TJ-OliPicard: the error could be coming from that23:43
TJ-OliPicard: Sorry, port 9000 now I see. It was 9001 earlier though, could that be an issue?23:43
TJ-OliPicard: Is it proxying for a Tomcat instance, or similar?23:44
OliPicardnope just a single nginx server running :)23:48
OliPicardits preoxying node .js23:48
OliPicardbrb gotta reconnect23:48
=== zz_DenBeiren is now known as DenBeiren
OliPicard_Im back sorry about that.23:58
OliPicard_Yeah my server app is running but nginx isn't processing the request23:58
TJ-OliPicard: test a connection locally using 'openssl s_client'23:59

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!