Setting up lighttpd 1.4.17 with ImageMagick
How many of you are simply using DNS-323 as a Network Attached Storage? Probably you are missing out on Peer-to-Peer applications like MLDonkey.
How about setting up a web server on the DNS-323 so that you can share your files with your friends, or perhaps host a image gallery on it to share your memories with your loved ones?
This writeup will guide you through the process of setting up lighttpd 1.4.14 with ImageMagick (completed with libpng, libjpeg) so that you can do some manipulation with images. But do take note image manipulation could take some time on the DNS-323.
So let begin by getting the required files.
Required files
- funplug-0.3.tar.gz
- lighttpd-1.4.17.tgz
- php-5.2.4.tgz
- imagemagick-6.3.4_9.tgz
- libjpeg-6b.tgz
- libpng-1.2.18.tgz
These files can be downloaded from fonz’s website.
Download all the files to Volume_1 of your DNS-323.
If you have already set up fun_plug (at least version 0.3) by fonz, then you can skip to Upgrading the lighttpd.
Setting up fonz’s fun_plug
- Extract the contents of funplug-0.3.tar.gz by winrar or other tools
- Place the contents on \\<DNS-323’s IP>\Volume_1\. So you would have \\<DNS-323’s IP>\Volume_1\fun_plug and \\<DNS-323’s IP>\Volume_1\fun_plug.tar
- Restart your DNS-323
- Wait for 60 seconds before proceeding to the next section
Upgrading the lighttpd
Telnet into your DNS323 by using a suitable client (e.g. putty). Execute the following commands.
/ # cd /mnt/HD_a2
/mnt/HD_a2 # funpkg.sh lighttpd-1.4.17.tgz
Unpacking lighttpd-1.4.17.tgz …
Installing files to /mnt/HD_a2/fun_plug.d …
Cleaning up
/mnt/HD_a2 #
Installing PHP 5.2.4
/mnt/HD_a2 # funpkg.sh php-5.2.4.tgz
Unpacking php-5.2.4.tgz …
Installing files to /mnt/HD_a2/fun_plug.d …
Cleaning up
/mnt/HD_a2 #
Configuring lighttpd
/mnt/HD_a2 # cp fun_plug.d/etc/lighttpd.conf-with-php-sample fun_plug.d/etc/lighttpd.conf
/mnt/HD_a2 # chmod +x funplug.d/start/lighttpd.sh
Installing ImageMagick, libpng, libjpeg
/mnt/HD_a2 # funpkg.sh imagemagick-6.3.4_9.tgz
Unpacking imagemagick-6.3.4_9.tgz …
Installing files to /mnt/HD_a2/fun_plug.d …
Cleaning up
/mnt/HD_a2 # funpkg.sh libpng-1.2.18.tgz
Unpacking libpng-1.2.18.tgz …
Installing files to /mnt/HD_a2/fun_plug.d …
Cleaning up
/mnt/HD_a2 # funpkg.sh libjpeg-6b.tgz
Unpacking libjpeg-6b.tgz …
Installing files to /mnt/HD_a2/fun_plug.d …
Cleaning up
/mnt/HD_a2 #
Setting up the necessary folders
/mnt/HD_a2 # mkdir -p www/pages
/mnt/HD_a2 # mkdir -p www/logs
/mnt/HD_a2 # chmod 0777 www/pages
Running lighttpd for the first time
/mnt/HD_a2 # ./fun_plug.d/start/lighttpd.sh
Point your web browser to the following address http://<DNS-323’s IP>:8080. If your lighttpd installation is successful, you should see the following page.
phpinfo() page
Place your webpages in /mnt/HD_a2/www/pages and you would be able to view them through lighttpd. The lighttpd will autostart everytime the DNS-323 is rebooted.
Have fun!
hey thanks for the write up. however i don’t see where imagemagick figures in this? How do we use it to share photos on the http?
ciac,
Most of the image/photo gallery scripts on the web requires some form of image manipulation libraries (e.g. ImageMagick or GDLib). So this guide actually sets up the basics for all these gallery scripts
I followed your steps, without any reported errors. But when i point the browser to http://:8080 there is no page to display. In the fun_plug log file it shows that lighttpd has started.
Any ideas?
oops, sorry, it seemed not to post it at first
/mnt/HD_a2/fun_plug.d/start # ${BINDIR}/lighttpd -f ${ETCDIR}/lighttpd.conf
2008-02-11 17:51:44: (mod_accesslog.c.535) opening access-log failed: Noch file or directory /mnt/HD_a2/www/logs/access.log
2008-02-11 17:51:44: (server.c.880) Configuration of plugins failed. Going down.
Solution: Make logs directory 😉
Hi I’ve followed the instructions word for word for installing and settign up Lighthttp but I’m having some problems starting lighthttp as it never seems to start I start it but I don’t see it under procesess, I’ve did a strace but the stuff spit out makes absolute no sense to me (sorry Linux newb)
/mnt/HD_a2 # strace ./fun_plug.d/start/lighttpd.sh
execve(“./fun_plug.d/start/lighttpd.sh”, [“./fun_plug.d/start/lighttpd.sh”], [/*
16 vars */]) = 0
old_mmap(NULL, 20, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4
0005000
stat(“/etc/ld-uclibc.so.cache”, 0xbec57a2c) = -1 ENOENT (No such file or directo
ry)
open(“/mnt/HD_a2/fun_plug.d/lib/libc.so.0”, O_RDONLY) = -1 ENOENT (No such file
or directory)
open(“/lib/libc.so.0”, O_RDONLY) = 3
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
x40006000
read(3, “\177ELF\1\1\1a\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`\346\0\000″…, 4096) = 4
096
old_mmap(NULL, 364544, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4000d000
old_mmap(0x4000d000, 306644, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) =
0x4000d000
old_mmap(0x4005f000, 7876, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x4a0
00) = 0x4005f000
old_mmap(0x40061000, 18528, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANON
YMOUS, -1, 0) = 0x40061000
close(3) = 0
munmap(0x40006000, 4096) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo …}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo …}) = 0
rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
getpid() = 30759
brk(0) = 0x11f000
brk(0x121000) = 0x121000
getcwd(“/mnt/HD_a2”, 4098) = 11
geteuid() = 0
getppid() = 30758
open(“./fun_plug.d/start/lighttpd.sh”, O_RDONLY|O_LARGEFILE) = 3
fcntl64(3, F_DUPFD, 10) = 10
close(3) = 0
fcntl64(10, F_SETFD, FD_CLOEXEC) = 0
rt_sigaction(SIGINT, NULL, {SIG_IGN}, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_IGN}, 8) = 0
rt_sigaction(SIGHUP, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGHUP, {SIG_DFL}, NULL, 8) = 0
rt_sigaction(SIGTSTP, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGTSTP, {SIG_DFL}, NULL, 8) = 0
rt_sigaction(SIGPIPE, NULL, {SIG_IGN}, 8) = 0
read(10, “#!/bin/sh\n\nlighttpd_start() {\n “…, 4095) = 753
stat(“.”, {st_mode=S_IFDIR|0777, st_size=4096, …}) = 0
open(“.”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
brk(0x122000) = 0x122000
getdents64(3, /* 20 entries */, 4096) = 664
getdents64(3, /* 0 entries */, 4096) = 0
close(3) = 0
stat(“.”, {st_mode=S_IFDIR|0777, st_size=4096, …}) = 0
open(“.”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 20 entries */, 4096) = 664
getdents64(3, /* 0 entries */, 4096) = 0
close(3) = 0
stat(“.”, {st_mode=S_IFDIR|0777, st_size=4096, …}) = 0
open(“.”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 20 entries */, 4096) = 664
getdents64(3, /* 0 entries */, 4096) = 0
close(3) = 0
stat(“/mnt/HD_a2/fun_plug.d/bin”, {st_mode=S_IFDIR|0755, st_size=8192, …}) = 0
open(“/mnt/HD_a2/fun_plug.d/bin”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 141 entries */, 4096) = 4080
getdents64(3, /* 135 entries */, 4096) = 4088
close(3) = 0
stat(“.”, {st_mode=S_IFDIR|0777, st_size=4096, …}) = 0
open(“.”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 20 entries */, 4096) = 664
getdents64(3, /* 0 entries */, 4096) = 0
close(3) = 0
stat64(“/mnt/HD_a2/fun_plug.d/bin/[“, {st_mode=S_IFREG|S_ISUID|0755, st_size=751
500, …}) = 0
fork() = 30760
— SIGCHLD (Child exited) @ 0 (0) —
getpgrp() = 30758
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30760
stat(“.”, {st_mode=S_IFDIR|0777, st_size=4096, …}) = 0
open(“.”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 20 entries */, 4096) = 664
getdents64(3, /* 0 entries */, 4096) = 0
close(3) = 0
stat(“.”, {st_mode=S_IFDIR|0777, st_size=4096, …}) = 0
open(“.”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 20 entries */, 4096) = 664
getdents64(3, /* 0 entries */, 4096) = 0
close(3) = 0
stat64(“/mnt/HD_a2/fun_plug.d/bin/echo”, {st_mode=S_IFREG|S_ISUID|0755, st_size=
751500, …}) = 0
fork(Starting lighttpd…
) = 30761
— SIGCHLD (Child exited) @ 0 (0) —
getpgrp() = 30758
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30761
stat(“/mnt/HD_a2/fun_plug.d/bin”, {st_mode=S_IFDIR|0755, st_size=8192, …}) = 0
open(“/mnt/HD_a2/fun_plug.d/bin”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 141 entries */, 4096) = 4080
getdents64(3, /* 135 entries */, 4096) = 4088
close(3) = 0
stat(“.”, {st_mode=S_IFDIR|0777, st_size=4096, …}) = 0
open(“.”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 20 entries */, 4096) = 664
getdents64(3, /* 0 entries */, 4096) = 0
close(3) = 0
stat(“/mnt/HD_a2/fun_plug.d/etc”, {st_mode=S_IFDIR|0755, st_size=4096, …}) = 0
open(“/mnt/HD_a2/fun_plug.d/etc”, O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 10 entries */, 4096) = 368
close(3) = 0
fork() = 30762
getpgrp() = 30758
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30762
— SIGCHLD (Child exited) @ 0 (0) —
read(10, “”, 4095) = 0
_exit(0) = ?
Process 30759 detached
/mnt/HD_a2 #
Any ideas?
Hi,
Tried your instruction installing lighttpd. Does’nt work with me, i get a permission denied error
BusyBox v1.8.1 (2007-11-20 23:39:08 CET) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.
/mnt/HD_a2 # /mnt/HD_a2 # funpkg.sh lighttpd-1.4.18.tgz
/mnt/HD_a2/fun_plug.d/bin/sh: /mnt/HD_a2: Permission denied
i tried chmod a+x for the tgz file and also 777, no difference
there should also be a guide of how to add ampache (it really will be gread boost to this nas) as well as daap server (firefly )