0

I'm using the Blackboard AMI from AWS and can't get the lighttpd to function on it. I continually get 502s.

I've run service lighttpd status which gave me back:

● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-03-02 09:33:49 EST; 4min 31s ago
  Process: 4770 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 4763 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 4770 (code=exited, status=255)

Mar 02 09:33:49 ip-172-31-27-103 systemd[1]: Stopped Lighttpd Daemon.
Mar 02 09:33:49 ip-172-31-27-103 systemd[1]: Starting Lighttpd Daemon...
Mar 02 09:33:49 ip-172-31-27-103 lighttpd[4763]: Syntax OK
Mar 02 09:33:49 ip-172-31-27-103 systemd[1]: Started Lighttpd Daemon.
Mar 02 09:33:49 ip-172-31-27-103 lighttpd[4770]: 2020-03-02 09:33:49: (network.c.409) can't bind to port:  443 Address already in use
Mar 02 09:33:49 ip-172-31-27-103 systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Mar 02 09:33:49 ip-172-31-27-103 systemd[1]: lighttpd.service: Unit entered failed state.
Mar 02 09:33:49 ip-172-31-27-103 systemd[1]: lighttpd.service: Failed with result 'exit-code'.

I then ran netstat -tulpn to see what was using 443 and got back:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1134/sshd       
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      1269/postgres   
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1895/nginx.conf 
tcp6       0      0 :::22                   :::*                    LISTEN      1134/sshd       
tcp6       0      0 :::9900                 :::*                    LISTEN      1963/node       
udp        0      0 0.0.0.0:68              0.0.0.0:*                           903/dhclient    
udp        0      0 172.31.27.103:123       0.0.0.0:*                           1230/ntpd       
udp        0      0 127.0.0.1:123           0.0.0.0:*                           1230/ntpd       
udp        0      0 0.0.0.0:123             0.0.0.0:*                           1230/ntpd       
udp6       0      0 fe80::cc5:7dff:fee9:123 :::*                                1230/ntpd       
udp6       0      0 ::1:123                 :::*                                1230/ntpd       
udp6       0      0 :::123                  :::*                                1230/ntpd       

I then tried various commands to see the status of nginx but they all return that it is not running on my machine.

Failed to restart nginx.service: Unit nginx.service not found.
sudo: /usr/sbin/nginx: command not found

Can nginx be running under another service, or how can I get my server functional? There is no support offered for the AMI.

Update ps -efl|grep 1895 | grep -v "grep" returns:

4 S root      1895  1864  0  80   0 - 14857 sigsus 08:07 ?        00:00:00 nginx: master process /usr/local/openresty/bin/openresty -c /usr/local/etc/openresty/nginx.conf
5 S nobody    1911  1895  0  80   0 - 15113 ep_pol 08:07 ?        00:00:00 nginx: worker process
5 S nobody    1912  1895  0  80   0 - 15113 ep_pol 08:07 ?        00:00:00 nginx: worker process
1
  • check the entire command line with ps -efl|grep 1895 . Or from /proc filesystem Mar 2, 2020 at 15:01

1 Answer 1

1

So this openresty listen on port 443. Its up to you how to resolve it.

  • stop and remove openresty
  • assign to openresty different port (do not forget to restart it)
  • assign different port to lighttpd
4
  • service --status-all doesn't have a service with that name. How can I determine which service it is running under? I do see [ ? ] blackboard in the services and the proc dir has lrwxrwxrwx 1 root root 0 Mar 2 10:12 cwd -> /usr/local/blackboard/router in it Mar 2, 2020 at 15:14
  • @user3783243, try to find it with command find /etc/systemd/system/ -name "*openresty*" Mar 2, 2020 at 15:16
  • That has no results returned. Mar 2, 2020 at 15:16
  • so seems like this is not under systemd management. Find all files which belong to this package. Find package name: rpm -qf /usr/local/openresty/bin/openresty. then rpm -ql packagename. But its possible someone compile and install from source Mar 2, 2020 at 15:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .