OpenWrt Forum Archive

Topic: Apache on OpenWRT?

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I know the performance won't be good, but I've wanted apache running on my WRT54GS for a long time. I have a working SD mod, but everything I try has failed thus far: the Optware apache doesn't work the versions I'd compiled myself always seem to have problems.

Is OpenWRT ever going to release an official Apache package?
Or does anyone out there have a working package?

Thanks in advance, and sorry if anyone thinks this is a dumb question.

Well, https://dev.openwrt.org/browser/packages/net/apache here is the offical Apache package for OpenWrt ported and packaged by cracy_imp.

I've it working but compiled it by myself for my target using the Kamikaze build-system.

(Last edited by forum2006 on 28 Jul 2007, 12:37)

I saw that, but its just a couple of patches, makefile, and httpd.conf, not any kind of package.
It would be nice if this means that maybe an official package is on its way.

I'm not opposed to using the new build-system, just haven't tried it yet since the White Russian build system failed miserably for me years ago when I tried it. I've had more luck with compiling on my device with the optware toolchain using 2.4. I.e. it actually compiles, just doesn't run correctly. When apache starts the threads go zombie.

Was anything special needed to build it yourself?
Also, what set of sources did you use? (1.3, 2.2, 2.4, etc.)

Thanks again.

Okay, I tried the buildroot. It seemed to fail miserably. After going over the online documentation and making the latex documentation that comes with the buildroot, I'm still quite lost.

Here's the steps I think I needed to do to add the package:

cd ~/Desktop
svn checkout https://svn.openwrt.org/openwrt/trunk kamikaze                                   
cd kamikaze
svn checkout https://svn.openwrt.org/openwrt/packages packages                  
ln -s ~/Desktop/kamikaze/packages/*/* ~/Desktop/kamikaze/package/
make menuconfig

(Okay, apache now shows up in list. I'll just build the default stuff for now though)

make

make menuconfig (select apache)
make package/apache-clean 

make package/apache-install V=99
make[1]: Entering directory `/home/templarapheonix/Desktop/kamikaze'
make -C package apache-install
make[2]: Entering directory `/home/templarapheonix/Desktop/kamikaze/package'
make -j1 -C apache install
find: /home/templarapheonix/Desktop/kamikaze/build_mipsel/httpd-2.2.4: No such file or directory
make[3]: Entering directory `/home/templarapheonix/Desktop/kamikaze/packages/net/apache'
mkdir -p /home/templarapheonix/Desktop/kamikaze/dl
/home/templarapheonix/Desktop/kamikaze/scripts/download.pl "/home/templarapheonix/Desktop/kamikaze/dl" "httpd-2.2.4.tar.gz" "3add41e0b924d4bb53c2dee55a38c09e" http://ftp.uni-erlangen.de/pub/mirrors/apache/httpd/
--02:04:42--  http://ftp.uni-erlangen.de/pub/mirrors/apache/httpd/httpd-2.2.4.tar.gz
           => `-'
Resolving ftp.uni-erlangen.de... 131.188.12.212
Connecting to ftp.uni-erlangen.de|131.188.12.212|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6,365,535 (6.1M) [application/x-gzip]

100%[====================================>] 6,365,535    295.54K/s    ETA 00:00

02:05:06 (263.38 KB/s) - `-' saved [6365535/6365535]

gzip -dc /home/templarapheonix/Desktop/kamikaze/dl/httpd-2.2.4.tar.gz | /bin/tar -C /home/templarapheonix/Desktop/kamikaze/build_mipsel/httpd-2.2.4/.. -xf -

Applying ./patches/001-Makefile_in.patch using plaintext:
patching file server/Makefile.in

Applying ./patches/002-test_char_h.patch using plaintext:
patching file server/test_char.h

Applying ./patches/003-logdir_fix.patch using plaintext:
patching file build/mkconfNW.awk
patching file config.layout

Applying ./patches/004-pidfile_fix.patch using plaintext:
patching file include/scoreboard.h
touch /home/templarapheonix/Desktop/kamikaze/build_mipsel/httpd-2.2.4/.prepared_563fd5462533dd973ffffe1b757e9595
(cd /home/templarapheonix/Desktop/kamikaze/build_mipsel/httpd-2.2.4/./; if [ -x ./configure ]; then cp -fpR /home/templarapheonix/Desktop/kamikaze/scripts/config.{guess,sub} /home/templarapheonix/Desktop/kamikaze/build_mipsel/httpd-2.2.4// && AR=mipsel-linux-uclibc-ar AS="mipsel-linux-uclibc-gcc -c -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time" LD=mipsel-linux-uclibc-ld NM=mipsel-linux-uclibc-nm CC="mipsel-linux-uclibc-gcc" GCC="mipsel-linux-uclibc-gcc" CXX=mipsel-linux-uclibc-g++ RANLIB=mipsel-linux-uclibc-ranlib STRIP=mipsel-linux-uclibc-strip OBJCOPY=mipsel-linux-uclibc-objcopy OBJDUMP=mipsel-linux-uclibc-objdump SIZE=mipsel-linux-uclibc-size CFLAGS="-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -I/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/include -I/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/include" CXXFLAGS="-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -I/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/include -I/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/include" CPPFLAGS="-I/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/include -I/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/include -I/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/include -I/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/include" LDFLAGS="-L/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/lib -L/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/lib" PKG_CONFIG_PATH="/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/lib/pkgconfig" PKG_CONFIG_LIBDIR="/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/lib/pkgconfig"  ./configure --target=mipsel-linux --host=mipsel-linux --build=i486-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls  --with-apr="/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/bin/apr-1-config" --with-apr-util="/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/bin/apu-1-config" --with-pcre="/home/templarapheonix/Desktop/kamikaze/staging_dir_mipsel/usr/bin/pcre-config" --enable-http --enable-ssl --disable-disk-cache --enable-maintainer-mode --enable-mime-magic --without-suexec-bin ap_void_ptr_lt_long=no logfiledir="/var/log" ; fi; )
configure: loading site script /home/templarapheonix/Desktop/kamikaze/include/site/mipsel-linux-uclibc
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... i486-pc-linux-gnu
checking host system type... mipsel-unknown-linux-gnu
checking target system type... mipsel-unknown-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
make[3]: *** [/home/templarapheonix/Desktop/kamikaze/build_mipsel/httpd-2.2.4/.configured] Error 1
make[3]: Leaving directory `/home/templarapheonix/Desktop/kamikaze/packages/net/apache'
make[2]: *** [apache-install] Error 2
make[2]: Leaving directory `/home/templarapheonix/Desktop/kamikaze/package'
make[1]: *** [package/apache-install] Error 2
make[1]: Leaving directory `/home/templarapheonix/Desktop/kamikaze'
make: *** [package/apache-install] Error 2

(Last edited by TemplaraPhoenix on 29 Jul 2007, 13:03)

Please try again with the build-system from Kamikaze 7.07. Trunk tends to be broken from time to time...

cd ~/
wget http://downloads.openwrt.org/kamikaze/7.07/kamikaze_7.07.tar.bz2
tar xf kamikaze_7.07.tar.bz2
svn checkout https://svn.openwrt.org/openwrt/packages/ ~/kamikaze_7.07/feeds/packages/
cd ~/kamikaze_7.07/package/
ln -sf ../feeds/packages/*/ .
cd ~/kamikaze_7.07/
make menuconfig

Select your target and the packages. Run 'make world'. It takes some time to build depending on the number of packages you selected. If you have some packages missing on your host-system, the prereq check (called automatically by 'make world' or manually by 'make prereq') will tell you before the build starts.

(Last edited by forum2006 on 29 Jul 2007, 10:03)

Thank you! I got it to compile and for the first time I was able to install a version of apache and get it to serve web pages.

The code above should have been

ln -sf ../feeds/packages/*/* .

but that was minor. The main issue was not that trunk was broken but that make package/foo-install seems to not work by itself since it doesn't call dependencies. Make prereq doesn't seem to either. However, make world or make does, and thus I was able to get apache running. I'm also amazed at how small it is! I don't have mod-rewrite or PHP installed yet, but right now all of Kamikaze 7.07 is taking up only 4MB on the flash and no space on the SD of my GS.

Okay, I celebrated too soon. I can't seem to build shared modules. I'm fairly sure this is needed to do PHP. Any suggestions?

I added

--enable-so

to the makefile and now get

configure: error: mod_so has been requested but cannot be built on your system.

Okay, I tracked down the problem. ./configure can't find dlopen(). My guess is I need an extra include somewhere. I'm assuming OpenWRT has DSO abilities. Anybody know howto do this?

(Last edited by TemplaraPhoenix on 29 Jul 2007, 22:51)

Hi, hope it's not too late for you, but yesterday I managed to build apache with shared modules support, mod_dav_svn, and some others...
First of all I've enabled in the apache package building shared modules by

--enable-mods-shared=most

Then I've got the same error as you

 configure: error: mod_so has been requested but cannot be built on your system.

After some investigation I've found that APR is built without DSO support. therefore I've changed following line int Makefile for libs\apr\Makefile

--enable-dso

Then I've got an compile error about missing find_if_fuction. I digged the code and found out that this is caused by

--disable-ipv6

in apr Makefile. After removing it, apr built successfully as well as apache with most so modules.

I was working on trunk about 2 weeks ago, I will check this exactly at home.

Hope this helps ...

(Last edited by adam.horacek on 18 Mar 2008, 13:07)

FRIKKIN AWESOME!

thx!

I am a bit lazy but I will compile my own package if I really have to.
The apache that is in the 8.09.2 repository doesn't have mod_dav_svn which is what I am really looking for. Could you provide your compiled package:D? If you're on brcm-2.4 as well, for example.
Thanks.

The discussion might have continued from here.