Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighttp can't start , any idea why? #262

Closed
Ondjultomte opened this issue Jan 29, 2016 · 38 comments
Closed

Lighttp can't start , any idea why? #262

Ondjultomte opened this issue Jan 29, 2016 · 38 comments

Comments

@Ondjultomte
Copy link

sudo service lighttpd start
Job for lighttpd.service failed. See 'systemctl status lighttpd.service' and 'journalctl -xn' for details.

/etc/lighttpd$ systemctl status lighttpd.service
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled)
   Active: failed (Result: exit-code) since fre 2016-01-29 10:58:31 CET; 13s ago
  Process: 7891 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)


/etc/lighttpd$ journalctl -xn
No journal files were found.


● debian
    State: degraded
     Jobs: 0 queued
   Failed: 1 units
    Since: ons 2016-01-27 00:26:37 CET; 2 days ago
   CGroup: /
           ├─1 /sbin/init
           └─system.slice
             ├─dbus.service
             │ └─436 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
             ├─cron.service
             │ └─428 /usr/sbin/cron -f
             ├─nfs-common.service
             │ ├─413 /sbin/rpc.statd
             │ └─427 /usr/sbin/rpc.idmapd
             ├─exim4.service
             │ └─751 /usr/sbin/exim4 -bd -q30m
             ├─fail2ban.service
             │ └─580 /usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid
             ├─atd.service
             │ └─430 /usr/sbin/atd -f
             ├─systemd-journald.service
             │ └─151 /lib/systemd/systemd-journald
             ├─dnsmasq.service
             │ └─471 /usr/sbin/dnsmasq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
             ├─ssh.service
             │ ├─ 431 /usr/sbin/sshd -D
             │ ├─ 780 tmux
             │ ├─ 781 -bash
             │ ├─ 790 -bash
             │ ├─ 799 htop
             │ ├─ 801 -bash
             │ ├─2136 tail -f /var/log/pihole.log
             │ ├─2466 -bash
             │ ├─6226 irssi
             │ ├─7498 sshd: kristoffer [priv
             │ ├─7500 sshd: kristoffer@pts/
             │ ├─7501 -bash
             │ ├─7512 tmux attach -t 0
             │ ├─7936 sudo systemctl status --full
             │ └─7937 systemctl status --full
             ├─systemd-logind.service
             │ └─433 /lib/systemd/systemd-logind
             ├─system-getty.slice
             │ └─getty@tty1.service
             │   └─457 /sbin/agetty --noclear tty1 linux
   ├─systemd-udevd.service
             │ └─150 /lib/systemd/systemd-udevd
             ├─rpcbind.service
             │ └─404 /sbin/rpcbind -w
             ├─rsyslog.service
             │ └─448 /usr/sbin/rsyslogd -n
             └─acpid.service
               └─451 /usr/sbin/acpid
@PromoFaux
Copy link
Member

Hey can you run cat /etc/lighttpd/lighttpd.conf and paste in the output please?

@PromoFaux
Copy link
Member

Also cat /etc/pihole/install.log

@DonLexos
Copy link

And to trouble shoot maybe the last bits of lighttpd cat /var/log/lighttpd/error.log

@Ondjultomte
Copy link
Author

/etc/lighttpd$ cat /etc/lighttpd/lighttpd.conf
server.modules = (
        "mod_expire",
        "mod_compress",
        "mod_redirect",
        "mod_rewrite"
)

server.document-root        = "/var/www"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

# Set access to 1 day for better query performance when the list gets so large
# http://jacobsalmela.com/raspberry-pi-block-ads-adtrap/#comment-2013820434
$HTTP["url"] =~ "^/pihole/" {
        expire.url = ("" => "access plus 1 days")
}

# Rewrites all URLs to the /var/www/pihole/index.html
$HTTP["host"] =~ ".*" {
     url.rewrite = (".*" => "pihole/index.html")
}

@Ondjultomte
Copy link
Author

:::    Checking for dnsutils... already installed!
:::    Checking for bc... already installed!
:::    Checking for toilet... already installed!
:::    Checking for figlet... already installed!
:::    Checking for dnsmasq... already installed!
:::    Checking for lighttpd... already installed!
:::    Checking for php5-common... already installed!
:::    Checking for php5-cgi... already installed!
:::    Checking for php5... already installed!
:::    Checking for git... already installed!
:::    Checking for curl... already installed!
:::    Checking for unzip... already installed!
:::    Checking for wget... already installed!
:::
::: Stopping services. done.
:::
::: Checking for existing base files...
:::    Checking /etc/.pihole is a repo... OK!
:::     Updating repo in /etc/.pihole.. done!
:::
::: Checking for existing web interface...
:::    Checking /var/www/html/admin is a repo... OK!
:::     Updating repo in /var/www/html/admin.. done!
:::
::: Installing scripts... done.
:::
::: Installing configs... done.
:::
::: Creating log file and changing owner to dnsmasq... already exists!
:::
::: Installing pihole custom index page... Existing page detected, not overwriting
:::
::: Installing latest Cron script... done!
:::
::: Preparing to run gravity.sh to refresh hosts...
::: Cleaning up previous install (preserving whitelist/blacklist)
::: Running gravity.sh
:::
:::
::: sudo will be used.
::: Neutrino emissions detected...
:::
::: Getting adaway.org list... List updated, transport successful!
::: Getting adblock.gjtech.net list... List updated, transport successful!
::: Getting hosts-file.net list... List updated, transport successful!
::: Getting www.malwaredomainlist.com list... List updated, transport successful!
::: Getting pgl.yoyo.org list... List updated, transport successful!
::: Getting someonewhocares.org list... List updated, transport successful!
::: Getting winhelp2002.mvps.org list... List updated, transport successful!
::: Getting mirror1.malwaredomains.com list... List updated, transport successful!
:::
::: Aggregating list of domains.. done!
::: Formatting list of domains to remove comments... done!
::: 97612 domains being pulled in by gravity...
::: Removing duplicate domains... done!
::: 88494 unique domains trapped in the event horizon.
::: Formatting domains into a HOSTS file...
:::
::: Adding 8 ad list sources to the whitelist... done!
::: Running whitelist script to update HOSTS file... 8 domains whitelisted!
::: Running blacklist script to update HOSTS file... 0 domains blacklisted!
:::
::: Refresh lists in dnsmasq.. done!

@Ondjultomte
Copy link
Author

cat: /var/log/lighttpd/error.log: No such file or directory

@PromoFaux
Copy link
Member

Hmm, your lighttpd.conf doesn't look right. For comparrison, heres mine:

 cat /etc/lighttpd/lighttpd.conf
server.modules = (
        "mod_access",
        "mod_accesslog",
        "mod_expire",
        "mod_compress",
        "mod_redirect",
        "mod_setenv",
        "mod_rewrite"
)

server.document-root        = "/var/www/html"
server.error-handler-404        = "pihole/index.html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80
accesslog.filename                      = "/var/log/lighttpd/access.log"
accesslog.format                        = "%{%s}t|%V|%r|%s|%b"


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

# If the URL starts with /admin, it is the Web interface
$HTTP["url"] =~ "^/admin/" {
        # Create a response header for debugging using curl -I
        setenv.add-response-header = ( "X-Pi-hole" => "The Pi-hole Web interface is working!" )
}

# If the URL does not start with /admin, then it is a query for an ad domain
$HTTP["url"] =~ "^(?!/admin)/.*" {
        # Create a response header for debugging using curl -I
        setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." )
}

@PromoFaux
Copy link
Member

as per this

can you run curl -L install.pi-hole.net | bash again please

@Ondjultomte
Copy link
Author

 uname -a
Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux

@Ondjultomte
Copy link
Author

I'll run the install again

@PromoFaux
Copy link
Member

Interestingly, looking at the history of the file, your lighttpd.conf is from October 15!

@Ondjultomte
Copy link
Author

I'm not on the rpi tho as you can see. Thought it was slow to resolve so I moved it to a vm debian

That is odd I just installed it yesterday or so :)

@Ondjultomte
Copy link
Author

done.

usermod: user 'pi' does not exist

:::
::: Checking for existing base files...
:::    Checking /etc/.pihole is a repo... OK!
:::     Updating repo in /etc/.pihole.. done!
:::
::: Checking for existing web interface...
:::    Checking /var/www/html/admin is a repo... OK!
:::     Updating repo in /var/www/html/admin.. done!
:::
::: Installing scripts... done.
:::
::: Installing configs... done.
:::
::: Creating log file and changing owner to dnsmasq... already exists!
:::
::: Installing pihole custom index page... Existing page detected, not overwriting
:::
::: Installing latest Cron script... done!
:::
::: Preparing to run gravity.sh to refresh hosts...
::: Cleaning up previous install (preserving whitelist/blacklist)
::: Running gravity.sh
:::
:::
::: sudo will be used.
::: Neutrino emissions detected...
:::
::: Getting adaway.org list... List updated, transport successful!
::: Getting adblock.gjtech.net list... List updated, transport successful!
::: Getting hosts-file.net list... List updated, transport successful!
::: Getting www.malwaredomainlist.com list... List updated, transport successful!
::: Getting pgl.yoyo.org list... List updated, transport successful!
::: Getting someonewhocares.org list... List updated, transport successful!
::: Getting winhelp2002.mvps.org list... List updated, transport successful!
::: Getting mirror1.malwaredomains.com list... List updated, transport successful!
:::
::: Aggregating list of domains.. done!
::: Formatting list of domains to remove comments... done!
::: 97982 domains being pulled in by gravity...
::: Removing duplicate domains... done!
::: 88861 unique domains trapped in the event horizon.
::: Formatting domains into a HOSTS file...
:::
::: Adding 8 ad list sources to the whitelist... done!
::: Running whitelist script to update HOSTS file... 8 domains whitelisted!
::: Running blacklist script to update HOSTS file... 0 domains blacklisted!
:::
::: Refresh lists in dnsmasq.. done!

You have new mail in /var/mail/kristoffer

@Ondjultomte
Copy link
Author

Im running as another user and did a manual install, forgot to add that

@Ondjultomte
Copy link
Author

It's up and running now with apache tho

@PromoFaux
Copy link
Member

We have a Pull Request open at the moment (#242) to make it easier to install on other distros, though we need to test it before we merge into master.

Try this:
in etc/.pihole/automated\ install/ there is a file called basic-install.sh
Change line 464 to read $SUDO usermod -a -G www-data <yourusername>

and then run bash /etc/.pihole/automated\ install/basic-install.sh

Just a hint, if you put "```" (without ") on newlines either side of your paste, it makes it easier to read :)

@Ondjultomte
Copy link
Author

I thought the script installed lighttp?

@PromoFaux
Copy link
Member

Wait.. did you configure it to use apache? Or did the script make it run apache?

@Ondjultomte
Copy link
Author

I just ran curl -L install.pi-hole.net | bash, perrequest and then apache answered at the IP! :)

@PromoFaux
Copy link
Member

OK, i've not actually tried installing on another distro yet.. so i'm a little out of my depth here.

Did apache come preinstalled on your vm? try disabling it then running the install script again... Might be a conflict.

@Ondjultomte
Copy link
Author

Can you make dnsmasq reload the conf file?

@PromoFaux
Copy link
Member

I still am not sure why your lighttpd.conf is s out of date though! can you cat it again please?

@Ondjultomte
Copy link
Author

No I did a minimal install of debian, nothing on it.

raspbian is debian so I guess it's only the username that changes. As long as you add all the dependencies.

@PromoFaux
Copy link
Member

Sure. I'm at work at the moment, but I'll try and get a minimal debian install up and running on my lunch and see what I can see.

@Ondjultomte
Copy link
Author

kristoffer@debian:/etc$ cat /etc/lighttpd/lighttpd.conf
server.modules = (
        "mod_access",
        "mod_accesslog",
        "mod_expire",
        "mod_compress",
        "mod_redirect",
        "mod_setenv",
        "mod_rewrite"
)

server.document-root        = "/var/www/html"
server.error-handler-404        = "pihole/index.html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80
accesslog.filename                      = "/var/log/lighttpd/access.log"
accesslog.format                        = "%{%s}t|%V|%r|%s|%b"


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

# If the URL starts with /admin, it is the Web interface
$HTTP["url"] =~ "^/admin/" {
        # Create a response header for debugging using curl -I
        setenv.add-response-header = ( "X-Pi-hole" => "The Pi-hole Web interface is working!" )
}

# If the URL does not start with /admin, then it is a query for an ad domain
$HTTP["url"] =~ "^(?!/admin)/.*" {
        # Create a response header for debugging using curl -I
        setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." )

@PromoFaux
Copy link
Member

OK, that has updated, at least. Disable apache, and try and start lighttpd

@Ondjultomte
Copy link
Author

No error message starting lighttp nor restarting it!

 ps aux | grep lighttp
www-data  9161  0.0  0.2  65944  5176 ?        Ss   12:19   0:00 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

@PromoFaux
Copy link
Member

Was that with disabling apache?

Are you able to navigate to http://ipaddressofyourVM/admin in a browser now?

@Ondjultomte
Copy link
Author

Didn't check before and after removing apache2.

Yes ofc :) In my case http://192.168.1.176/admin/

Thnx for all the help!

@Ondjultomte
Copy link
Author

I never thought of trying to run the script straight up but did a manual install and was tinkering around for awhile there.

The script runs just fine on a pure debian install fyi :)

I wonder how much work it would take to run it in a freeBSD jail tho.

@PromoFaux
Copy link
Member

I wonder how much work it would take to run it in a freeBSD jail tho.

No work is too much work for us! We like challenges...

@Ondjultomte
Copy link
Author

I'll add that to my todo list! :)

I

@ovizii
Copy link

ovizii commented Dec 3, 2016

I'm also interested on running this inside a freeBSD jail as I have an always-on NAS running freeNAS based on freeBSD so no point in adding an extra raspberry.

Any progress on a freeBSD port?

@JeMunos
Copy link

JeMunos commented Mar 8, 2017

I would also like to run this on FreeBSD. Any word on the port?

@dschaper
Copy link
Member

dschaper commented Mar 8, 2017

We welcome community assistance in porting the code to other platforms. If you can help us with finding us information on how FreeBSD packages their code and what versions of the daemons are available, that would be helpful. What kind of init system does FreeBSD run? Would this be in pure BSD, or more of a chroot/jailed configuration that is running on another platform?

@JeMunos
Copy link

JeMunos commented Mar 8, 2017

I'll help anyway I can, but I am not a software developer or a coder.
To start with freeBSD uses ports for installing and maintaining packages.
Here is the link to the ports documentation:
https://www.freebsd.org/doc/en/books/porters-handbook/

Here is a reference guide for how initialization works in freeBSD. It isn't SysV so there are some fairly solid differences in the approach, but the concept appears to be the same.
https://www.freebsd.org/doc/en/articles/rc-scripting/

I'm not sure what daemons you would like info on. If you give me a list of them I will see what information I can find.

@dschaper
Copy link
Member

dschaper commented Mar 8, 2017

Looking over the portage information, I don't know if we'd actually need to create a full port, or just modify our installer script to grab the dnsmasq and lighttpd ports that already exist. The major issue would then be down to handling the init system and our new FTL engine daemon. The best place to discuss this would be over on https://discourse.pi-hole.net in the Feature Request forum, where it could be voted on and prioritized with the other tasks that we are currently working on...

@killerkalamari
Copy link

This page came up in the google search results for this error:
/bin/bash: /usr/share/lighttpd/create-mime.assign.pl: No such file or directory

The solution for me was to change a line in lighttpd.conf:
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
to:
include_shell "/usr/share/lighttpd/create-mime.conf.pl"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants