Lighttpd problem??

Posted by TechSephie 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Lighttpd problem??
February 20, 2018 03:04PM
Everything seems to start okay, but when it goes to start lighttpd it says:
[....] starting lighttpd...:2018-02-20 10:00:28: (network.c.473) listen failed: address already in use
I have tried searching for answers to this problem with no results for my particular issue, any help appreciated

ps. sorry if this is the wrong place to post this tongue sticking out smiley
Re: Lighttpd problem??
February 20, 2018 03:09PM
Hi,
to help you, I need some more information:

What platform is your PirateBox running on? RPi , OpenWrt? Self installed?
Which howto did you follow?

Best regards Matthias
Re: Lighttpd problem??
February 20, 2018 03:15PM
I am running it on an old laptop running debian 9.3 following [piratebox.cc] this guide
Re: Lighttpd problem??
February 20, 2018 03:22PM
ok, thank you for the information.

The main reason for the error message is, that there is already an instance of lighttpd (or apache) running on port 80. This can be an result of forgetting to stop & disable lighttpd at the beginning of the tutorial.

Did you get any error messages at this point in the tutorial ?

 sudo apt-get -y install lighttpd
 sudo /etc/init.d/lighttpd stop
 sudo update-rc.d lighttpd disable

You can alternatively try the following tutorial, which is more recent. [piratebox.cc]
Armbian is nearly 1:1 to a normal debian.

best regards Matthias,
who needs to update the laptop-DIY page *sigh*
Re: Lighttpd problem??
February 20, 2018 03:24PM
no it didn't give any errors when installing lighttpd assuming that nothing is outputted after running the disable command
Re: Lighttpd problem??
February 20, 2018 03:30PM
nothing is usually good.
Lets try just a stupid thing:

sudo /etc/init.d/lighttpd stop
sudo /etc/init.d/piratebox stop
sudo /etc/init.d/piratebox start

best regards Matthias
Re: Lighttpd problem??
February 20, 2018 03:37PM
yields the same result as before, so tonight I'll try the armbian install instructions to see if that works
Re: Lighttpd problem??
February 20, 2018 05:12PM
Can you provide the output of

sudo ps -ef
sudo netstat --listen -p

that might help to identify the process, which blocks port 80

best regards Matthias
Re: Lighttpd problem??
February 20, 2018 06:18PM
here is your massive wall of text:

UID PID PPID C STIME TTY TIME CMD
root 1 0 2 13:02 ? 00:00:01 /sbin/init
root 2 0 0 13:02 ? 00:00:00 [kthreadd]
root 3 2 0 13:02 ? 00:00:00 [ksoftirqd/0]
root 4 2 0 13:02 ? 00:00:00 [kworker/0:0]
root 5 2 0 13:02 ? 00:00:00 [kworker/0:0H]
root 6 2 0 13:02 ? 00:00:00 [kworker/u8:0]
root 7 2 0 13:02 ? 00:00:00 [rcu_sched]
root 8 2 0 13:02 ? 00:00:00 [rcu_bh]
root 9 2 0 13:02 ? 00:00:00 [migration/0]
root 10 2 0 13:02 ? 00:00:00 [lru-add-drain]
root 11 2 0 13:02 ? 00:00:00 [watchdog/0]
root 12 2 0 13:02 ? 00:00:00 [cpuhp/0]
root 13 2 0 13:02 ? 00:00:00 [cpuhp/1]
root 14 2 0 13:02 ? 00:00:00 [watchdog/1]
root 15 2 0 13:02 ? 00:00:00 [migration/1]
root 16 2 0 13:02 ? 00:00:00 [ksoftirqd/1]
root 17 2 0 13:02 ? 00:00:00 [kworker/1:0]
root 18 2 0 13:02 ? 00:00:00 [kworker/1:0H]
root 19 2 0 13:02 ? 00:00:00 [cpuhp/2]
root 20 2 0 13:02 ? 00:00:00 [watchdog/2]
root 21 2 0 13:02 ? 00:00:00 [migration/2]
root 22 2 0 13:02 ? 00:00:00 [ksoftirqd/2]
root 23 2 0 13:02 ? 00:00:00 [kworker/2:0]
root 24 2 0 13:02 ? 00:00:00 [kworker/2:0H]
root 25 2 0 13:02 ? 00:00:00 [cpuhp/3]
root 26 2 0 13:02 ? 00:00:00 [watchdog/3]
root 27 2 0 13:02 ? 00:00:00 [migration/3]
root 28 2 0 13:02 ? 00:00:00 [ksoftirqd/3]
root 29 2 0 13:02 ? 00:00:00 [kworker/3:0]
root 30 2 0 13:02 ? 00:00:00 [kworker/3:0H]
root 31 2 0 13:02 ? 00:00:00 [kdevtmpfs]
root 32 2 0 13:02 ? 00:00:00 [netns]
root 33 2 0 13:02 ? 00:00:00 [khungtaskd]
root 34 2 0 13:02 ? 00:00:00 [oom_reaper]
root 35 2 0 13:02 ? 00:00:00 [writeback]
root 36 2 0 13:02 ? 00:00:00 [kcompactd0]
root 37 2 0 13:02 ? 00:00:00 [kworker/2:1]
root 38 2 0 13:02 ? 00:00:00 [ksmd]
root 39 2 0 13:02 ? 00:00:00 [khugepaged]
root 40 2 0 13:02 ? 00:00:00 [crypto]
root 41 2 0 13:02 ? 00:00:00 [kintegrityd]
root 42 2 0 13:02 ? 00:00:00 [bioset]
root 43 2 0 13:02 ? 00:00:00 [kblockd]
root 44 2 0 13:02 ? 00:00:00 [kworker/0:1]
root 45 2 0 13:02 ? 00:00:00 [devfreq_wq]
root 46 2 0 13:02 ? 00:00:00 [watchdogd]
root 47 2 0 13:02 ? 00:00:00 [kworker/1:1]
root 48 2 0 13:02 ? 00:00:00 [kswapd0]
root 49 2 0 13:02 ? 00:00:00 [vmstat]
root 61 2 0 13:02 ? 00:00:00 [kthrotld]
root 62 2 0 13:02 ? 00:00:00 [kworker/3:1]
root 63 2 0 13:02 ? 00:00:00 [ipv6_addrconf]
root 64 2 0 13:02 ? 00:00:00 [kworker/1:2]
root 96 2 0 13:02 ? 00:00:00 [acpi_thermal_pm]
root 97 2 0 13:02 ? 00:00:00 [ata_sff]
root 110 2 0 13:02 ? 00:00:00 [kworker/u8:1]
root 130 2 0 13:02 ? 00:00:00 [scsi_eh_0]
root 131 2 0 13:02 ? 00:00:00 [scsi_tmf_0]
root 132 2 0 13:02 ? 00:00:00 [scsi_eh_1]
root 133 2 0 13:02 ? 00:00:00 [scsi_tmf_1]
root 134 2 0 13:02 ? 00:00:00 [scsi_eh_2]
root 135 2 0 13:02 ? 00:00:00 [scsi_tmf_2]
root 136 2 0 13:02 ? 00:00:00 [scsi_eh_3]
root 137 2 0 13:02 ? 00:00:00 [scsi_tmf_3]
root 138 2 0 13:02 ? 00:00:00 [kworker/u8:2]
root 139 2 0 13:02 ? 00:00:00 [kworker/u8:3]
root 140 2 0 13:02 ? 00:00:00 [kworker/u8:4]
root 141 2 0 13:02 ? 00:00:00 [kworker/0:2]
root 142 2 0 13:02 ? 00:00:00 [bioset]
root 143 2 0 13:02 ? 00:00:00 [bioset]
root 146 2 0 13:02 ? 00:00:00 [kworker/2:1H]
root 147 2 0 13:02 ? 00:00:00 [kworker/3:1H]
root 148 2 0 13:02 ? 00:00:00 [kworker/0:1H]
root 149 2 0 13:02 ? 00:00:00 [kworker/1:1H]
root 150 2 0 13:02 ? 00:00:00 [kworker/0:3]
root 152 2 0 13:02 ? 00:00:00 [kworker/2:2]
root 189 2 0 13:02 ? 00:00:00 [jbd2/sda2-8]
root 190 2 0 13:02 ? 00:00:00 [ext4-rsv-conver]
root 221 2 0 13:02 ? 00:00:00 [kworker/1:3]
root 226 1 0 13:02 ? 00:00:00 /lib/systemd/systemd-journald
root 231 2 0 13:02 ? 00:00:00 [kauditd]
root 251 1 0 13:02 ? 00:00:00 /lib/systemd/systemd-udevd
root 271 2 0 13:02 ? 00:00:00 [kworker/3:2]
root 274 2 0 13:02 ? 00:00:00 [kmemstick]
root 275 2 0 13:02 ? 00:00:00 [cfg80211]
root 278 2 0 13:02 ? 00:00:00 [kworker/2:3]
root 297 2 0 13:02 ? 00:00:00 [edac-poller]
root 300 2 0 13:02 ? 00:00:00 [kworker/u8:5]
root 324 2 0 13:02 ? 00:00:00 [kworker/3:3]
systemd+ 445 1 0 13:02 ? 00:00:00 /lib/systemd/systemd-timesyncd
avahi 477 1 0 13:02 ? 00:00:00 avahi-daemon: running [debian.lo
rtkit 478 1 0 13:02 ? 00:00:00 /usr/lib/rtkit/rtkit-daemon
message+ 479 1 0 13:02 ? 00:00:00 /usr/bin/dbus-daemon --system --
avahi 480 477 0 13:02 ? 00:00:00 avahi-daemon: chroot helper
root 483 1 0 13:02 ? 00:00:00 /usr/sbin/cron -f
root 484 1 0 13:02 ? 00:00:00 /lib/systemd/systemd-logind
root 485 1 1 13:02 ? 00:00:00 /usr/sbin/NetworkManager --no-da
root 486 1 0 13:02 ? 00:00:00 /usr/sbin/ModemManager
root 490 1 0 13:02 ? 00:00:00 /usr/sbin/cupsd -l
root 491 1 0 13:02 ? 00:00:00 /usr/sbin/cups-browsed
root 493 1 0 13:02 ? 00:00:00 /usr/sbin/rsyslogd -n
root 509 1 0 13:02 ? 00:00:00 /usr/lib/policykit-1/polkitd --n
root 525 1 0 13:02 tty1 00:00:00 /sbin/agetty --noclear tty1 linu
root 532 1 0 13:02 ? 00:00:00 /usr/sbin/lightdm
root 550 532 2 13:02 tty7 00:00:00 /usr/lib/xorg/Xorg :0 -seat seat
root 554 1 0 13:02 ? 00:00:00 /usr/sbin/sshd -D
root 558 1 0 13:02 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 559 558 0 13:02 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 560 558 0 13:02 ? 00:00:00 /usr/sbin/apache2 -k start
root 618 1 0 13:02 ? 00:00:00 /sbin/wpa_supplicant -u -s -O /r
lightdm 631 1 0 13:02 ? 00:00:00 /lib/systemd/systemd --user
lightdm 632 631 0 13:02 ? 00:00:00 (sd-pam)
lightdm 643 631 0 13:02 ? 00:00:00 /usr/bin/dbus-daemon --session -
lightdm 651 1 0 13:02 ? 00:00:00 /usr/lib/at-spi2-core/at-spi2-re
lightdm 655 631 0 13:02 ? 00:00:00 /usr/lib/gvfs/gvfsd
Debian-+ 920 1 0 13:02 ? 00:00:00 /usr/sbin/exim4 -bd -q30m
root 923 532 0 13:02 ? 00:00:00 lightdm --session-child 14 23
seph 929 1 0 13:03 ? 00:00:00 /lib/systemd/systemd --user
seph 930 929 0 13:03 ? 00:00:00 (sd-pam)
seph 936 1 0 13:03 ? 00:00:00 /usr/bin/gnome-keyring-daemon --
seph 938 923 0 13:03 ? 00:00:00 /bin/sh /etc/xdg/xfce4/xinitrc -
seph 946 929 0 13:03 ? 00:00:00 /usr/bin/dbus-daemon --session -
seph 981 938 0 13:03 ? 00:00:00 /usr/bin/ssh-agent x-session-man
seph 991 938 0 13:03 ? 00:00:00 xfce4-session
seph 992 929 0 13:03 ? 00:00:00 /usr/lib/at-spi2-core/at-spi-bus
seph 997 992 0 13:03 ? 00:00:00 /usr/bin/dbus-daemon --config-fi
seph 999 929 0 13:03 ? 00:00:00 /usr/lib/at-spi2-core/at-spi2-re
seph 1003 929 0 13:03 ? 00:00:00 /usr/lib/x86_64-linux-gnu/xfce4/
seph 1009 929 0 13:03 ? 00:00:00 /usr/bin/gpg-agent --supervised
seph 1011 991 1 13:03 ? 00:00:00 xfwm4 --display :0.0 --sm-client
seph 1012 991 0 13:03 ? 00:00:00 Thunar --sm-client-id 279f1ea06-
seph 1014 991 1 13:03 ? 00:00:00 xfce4-panel --display :0.0 --sm-
seph 1015 1 0 13:03 ? 00:00:00 xfsettingsd --display :0.0 --sm-
seph 1017 991 2 13:03 ? 00:00:00 xfdesktop --display :0.0 --sm-cl
root 1021 1 0 13:03 ? 00:00:00 /usr/lib/upower/upowerd
seph 1028 1 0 13:03 ? 00:00:00 xfce4-power-manager --restart --
seph 1029 929 0 13:03 ? 00:00:00 /usr/lib/gvfs/gvfsd
seph 1030 991 2 13:03 ? 00:00:00 /usr/bin/python3 /usr/share/syst
seph 1037 1 0 13:03 ? 00:00:00 xfce4-power-manager
seph 1039 929 0 13:03 ? 00:00:00 /usr/lib/x86_64-linux-gnu/tumble
seph 1041 991 0 13:03 ? 00:00:00 /usr/lib/policykit-1-gnome/polki
seph 1043 991 0 13:03 ? 00:00:00 light-locker
seph 1064 929 0 13:03 ? 00:00:00 /usr/lib/dconf/dconf-service
seph 1066 991 0 13:03 ? 00:00:00 nm-applet
seph 1076 929 0 13:03 ? 00:00:00 /usr/lib/x86_64-linux-gnu/xfce4/
seph 1079 1014 0 13:03 ? 00:00:00 /usr/lib/x86_64-linux-gnu/xfce4/
seph 1080 1014 0 13:03 ? 00:00:00 /usr/lib/x86_64-linux-gnu/xfce4/
seph 1081 1014 0 13:03 ? 00:00:00 /usr/lib/x86_64-linux-gnu/xfce4/
seph 1088 1 0 13:03 ? 00:00:00 /usr/bin/pulseaudio --start --lo
seph 1101 929 0 13:03 ? 00:00:00 /usr/lib/gvfs/gvfs-udisks2-volum
root 1104 1 0 13:03 ? 00:00:00 /usr/lib/udisks2/udisksd --no-de
seph 1118 929 0 13:03 ? 00:00:00 /usr/lib/gvfs/gvfsd-trash --spaw
seph 1124 929 0 13:03 ? 00:00:00 /usr/lib/gvfs/gvfsd-metadata
seph 1132 1 1 13:03 ? 00:00:00 xfce4-terminal
seph 1137 1132 0 13:03 pts/0 00:00:00 bash
root 1142 1137 0 13:03 pts/0 00:00:00 su
root 1143 1142 0 13:03 pts/0 00:00:00 bash
root 1151 1143 0 13:03 pts/0 00:00:00 ps -ef
root@debian:/home/seph# netstat --listen -p
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:ssh 0.0.0.0:* LISTEN 554/sshd
tcp 0 0 localhost:ipp 0.0.0.0:* LISTEN 490/cupsd
tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN 920/exim4
tcp6 0 0 [::]:http [::]:* LISTEN 558/apache2
tcp6 0 0 [::]:ssh [::]:* LISTEN 554/sshd
tcp6 0 0 localhost:ipp [::]:* LISTEN 490/cupsd
tcp6 0 0 localhost:smtp [::]:* LISTEN 920/exim4
udp 0 0 0.0.0.0:33055 0.0.0.0:* 477/avahi-daemon: r
udp 0 0 0.0.0.0:ipp 0.0.0.0:* 491/cups-browsed
udp 0 0 0.0.0.0:mdns 0.0.0.0:* 477/avahi-daemon: r
udp6 0 0 [::]:mdns [::]:* 477/avahi-daemon: r
udp6 0 0 [::]:51810 [::]:* 477/avahi-daemon: r
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 14334 1/init /var/run/cups/cups.sock
unix 2 [ ACC ] SEQPACKET LISTENING 1543 1/init /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 11528 1/init /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 17308 981/ssh-agent /tmp/ssh-JSel0pwnWwEn/agent.938
unix 2 [ ACC ] STREAM LISTENING 17531 550/Xorg /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 17530 550/Xorg @/tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 16183 929/systemd /run/user/1000/systemd/private
unix 2 [ ACC ] STREAM LISTENING 18091 991/xfce4-session /tmp/.ICE-unix/991
unix 2 [ ACC ] STREAM LISTENING 16188 929/systemd /run/user/1000/gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 16191 929/systemd /run/user/1000/gnupg/S.gpg-agent.extra
unix 2 [ ACC ] STREAM LISTENING 16193 929/systemd /run/user/1000/gnupg/S.gpg-agent.ssh
unix 2 [ ACC ] STREAM LISTENING 16195 929/systemd /run/user/1000/gnupg/S.gpg-agent.browser
unix 2 [ ACC ] STREAM LISTENING 16197 929/systemd /run/user/1000/bus
unix 2 [ ACC ] STREAM LISTENING 18010 936/gnome-keyring-d /run/user/1000/keyring/control
unix 2 [ ACC ] STREAM LISTENING 18090 991/xfce4-session @/tmp/.ICE-unix/991
unix 2 [ ACC ] STREAM LISTENING 17322 997/dbus-daemon @/tmp/dbus-DHN8E7lw3j
unix 2 [ ACC ] STREAM LISTENING 10417 1/init /run/systemd/fsck.progress
unix 2 [ ACC ] STREAM LISTENING 15027 631/systemd /run/user/113/systemd/private
unix 2 [ ACC ] STREAM LISTENING 10429 1/init /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 15819 631/systemd /run/user/113/gnupg/S.gpg-agent.ssh
unix 2 [ ACC ] STREAM LISTENING 15822 631/systemd /run/user/113/gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 15824 631/systemd /run/user/113/bus
unix 2 [ ACC ] STREAM LISTENING 15826 631/systemd /run/user/113/gnupg/S.gpg-agent.extra
unix 2 [ ACC ] STREAM LISTENING 15828 631/systemd /run/user/113/gnupg/S.gpg-agent.browser
unix 2 [ ACC ] STREAM LISTENING 20703 1088/pulseaudio /run/user/1000/pulse/native
unix 2 [ ACC ] STREAM LISTENING 14328 1/init /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 14331 1/init /var/run/avahi-daemon/socket
Re: Lighttpd problem??
February 20, 2018 06:21PM
Hi,
ok it is like I assumed. an already running apache is blocking the port.

So, the temporary fix is

sudo systemctl stop apache2 
sudo systemctl restart piratebox

best regards Matthias
Re: Lighttpd problem??
February 20, 2018 06:24PM
what gave that away and is there a permanent fix?
Re: Lighttpd problem??
February 20, 2018 06:29PM
Is there a reason why you installed the apache server on your box?
If you do not need it (apache server), the permanent fix is:

sudo systemctl disable apache2

best regards Matthias
Re: Lighttpd problem??
February 20, 2018 06:32PM
I didn't install it, the only things I did upon installing debian was install neofetch and piratebox

and now theres a new issue, with a invalid bin path "usr/bin/php-cgi" and I can confirm this file doesn't exist
Re: Lighttpd problem??
February 20, 2018 06:38PM
Mh, yes. that might be the result of the old laptop howto.

 sudo apt-get install iw perl lighttpd dnsmasq hostapd python php5-cgi zip avahi-daemon hostapd libcgi-pm-perl

best regards Matthias
Re: Lighttpd problem??
February 20, 2018 06:48PM
alright its all seemingly working, it didn't give any errors and I can't find it on my other laptop, the connection I mean
Re: Lighttpd problem??
February 20, 2018 06:54PM
I saw, that you are running the network manager. It is recommended to disable it, because it interferes with the network configuration PirateBox does activate.
I think you can stop it temporarily like this
sudo systemctl stop NetworkManager

or blacklist the wifi device for the NetworkManager -> see [piratebox.cc][]=armbian#disable_management_of_wifi_card_in_networkmanager

The question is, do you want to use the notebook as PirateBox only? if no, you should not blacklist the wifi card
Re: Lighttpd problem??
February 20, 2018 06:56PM
root@debian:/home/seph# systemctl stop networkmanager
failed to stop networkmanager.service: unit networkmanager.service not loaded.
Re: Lighttpd problem??
February 20, 2018 07:28PM
be aware of the capital letters..

sudo systemctl stop NetworkManager.service
Re: Lighttpd problem??
February 20, 2018 07:32PM
yeah that did it, thanks so much for the help, I really appreciate it
Re: Lighttpd problem??
February 20, 2018 07:34PM
After stopping the network manager, you should restart piratebox

sudo systemctl restart piratebox

-
no problem. But this is my last post for today..