Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Getting lighttpd to work: (14 Items)
   
Getting lighttpd to work  
Hi all,

I've dowloaded the lighttpd-1.4.29nb1-Package from pkgsrc but I fail to run the Server:
Library "libpcre.so.0" is missing.

Where can I find this Lib for QNX, or has anybody already launched the Lighttpd successfully?

Regards,
Christian
Re: Getting lighttpd to work  
You should use 'pkg_add' to install packages.  It resolves dependencies.

http://community.qnx.com/sf/projects/pkgsrc
http://community.qnx.com/sf/wiki/do/viewPage/projects.pkgsrc/wiki/BinaryPackages

ftp://ftp.netbsd.org/pub/pkgsrc/packages/QNX/i386/6.5.0_head_20110826/All/pcre-8.13.tgz



On Mon, Apr 22, 2013 at 09:12:00AM -0400, Christian Reinecke wrote:
> Hi all,
> 
> I've dowloaded the lighttpd-1.4.29nb1-Package from pkgsrc but I fail to run the Server:
> Library "libpcre.so.0" is missing.
> 
> Where can I find this Lib for QNX, or has anybody already launched the Lighttpd successfully?
> 
> Regards,
> Christian
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post100773
> To cancel your subscription to this discussion, please e-mail general-community-unsubscribe@community.qnx.com
Re: Getting lighttpd to work  
Thank you!
Re: Getting lighttpd to work  
I have been able to cross-compile lighttpd 1.4.35 and run it on a QNX6.6 x86 target.  This took a fair amount of web 
searching and trial and error but I have a working server and am testing functionality of all modules.

I had great difficultly generating the required shared libraries, starting with mod_indexfile.so.  libtool 2.4.2 does 
not support shared libraries for QNX and the qcc compiler/linker.  The closest I got with shared libraries was 
generating the *.so file but symbols were unresolved when called during runtime.

My solution was to do a static build with CFLAG=$CFLAGS -DLIGHTTPD_STATIC" and follow the guidance of http://
codemonkeytips.blogspot.com/2010/02/lighttpd-with-static-modules.html.  It is not apparent that --enable-static and --
enable-shared ./configure flags have any effect.

Additional changes on top of link above:
 - Add ntox86 to config.sub: http://www.sourceware.org/ml/gdb-patches/2003-02/msg00597.html
 - Rename mod_secure_download* files and calls to mod_secdownload.
 - Remove mod_rrdtool as rrdtool is not native in QNX and requires glib library to be cross-compiled and available.  
This tool is on the way out so I removed it from the build process starting with ./configure 
 - ordered module plugin loading in plugin.c according to config/modules.conf list

Next steps are to cross-compile pcre and integrate it. Then call QNX's openssl library and use that.

I built this with Ubuntu 12.04 with Momentics 5.0.1 from the terminal and the following commands after sourcing the QNX6
.6 paths:
CPPFLAGS="$CPPFLAGS $MAKEFLAGS" \
CFLAGS="$CFLAGS -Vgcc_ntox86 -w9 -DLIGHTTPD_STATIC" \
LDFLAGS="$LDFLAGS -Vgcc_ntox86 " \
ARCH=x86 NM=ntox86-nm AR=ntox86-ar \
RANLIB=ntox86-ranlib STRIP=ntox86-strip \
./configure --prefix=$HOME/build_lighttpd/ \
--host=arm-linux-gnueabi \
--target=ntox86 CC=qcc LD=qcc \
--enable-shared=no --enable-static=yes \
--without-mysql --without-zlib --without-bzip2 \
--disable-ipv6 --without-pcre
Re: Getting lighttpd to work  
Just wondering, why didn't you use pkgsrc?  pcre, glib libtool may just work.
Re: Getting lighttpd to work  
I plan to try setting up pkgsrc for a cross-compile environment once I implement pcre - and yes that may allow me to 
build libtool that allows shared library generation.  I'm not interested in porting a compiler to the target OS though 
in order to run pkgsrc from the target.  I have not gone through the cross-compilation pkgsrc user's guide yet.  Perhaps
 it is worth investing time in next.
Re: Getting lighttpd to work  
Do you have any suggestions on the correct procedure to get pkgsrc cross-compiling?  I am able to bootstrap it with gcc 
and can compile some tools, such as lighttpd, with only the --unprivileged flag.  However the path to cross-compiling is
 not as clear.  My native machine is x86 Linux Ubuntu and the target is x86 (or ARM) QNX6.6.  I have a copy of the 
QNX660 pkgsrc.  I am looking to build on the native machine and simply copy files and set paths on the target.  Any help
 is much appreciated!

Should pkgsrc be bootstraped with gcc and then the cross-compile options set in mk.conf to further build packages?  Or 
does the default pkgsrc/mk/defaults/mk.conf need to be configured with the suggestions per pkgsrc/doc/HOWTO-use-
crosscompile?


When I bootstrap pkgsrc with --compiler=qcc and with QNX Momentics sourced in the path, I get the following error:
----------------------------------------------------------------
./bootstrap --compiler=qcc --unprivileged --prefix="$HOME/pkg_qnx"
........
........
===> Installing packages
===> running: (cd /home/user/pkgsrc_qnx/pkgtools/bootstrap-mk-files && /home/user/pkgsrc_qnx/bootstrap/work/bin/bmake  
USE_DESTDIR=no -DPKG_PRESERVE MAKECONF=/home/user/pkgsrc_qnx/bootstrap/work/mk.conf install)
ERROR: This package has set PKG_FAIL_REASON:
ERROR: No acceptable compiler found for bootstrap-mk-files-20130703.
*** Error code 1

Stop.
bmake: stopped in /home/user/pkgsrc_qnx/pkgtools/bootstrap-mk-files
----------------------------------------------------------------
Re: Getting lighttpd to work  
You can fool it into thinking it has self hosted tools.

http://community.qnx.com/sf/wiki/do/viewPage/projects.pkgsrc/wiki/PkgsrcOnQnx6.6

Just bootstrap it normally without the '--compiler' option and let it detect
gcc.

> Do you have any suggestions on the correct procedure to get pkgsrc cross-
> compiling?  I am able to bootstrap it with gcc and can compile some tools, 
> such as lighttpd, with only the --unprivileged flag.  However the path to 
> cross-compiling is not as clear.  My native machine is x86 Linux Ubuntu and 
> the target is x86 (or ARM) QNX6.6.  I have a copy of the QNX660 pkgsrc.  I am 
> looking to build on the native machine and simply copy files and set paths on 
> the target.  Any help is much appreciated!
> 
> Should pkgsrc be bootstraped with gcc and then the cross-compile options set 
> in mk.conf to further build packages?  Or does the default pkgsrc/mk/defaults/
> mk.conf need to be configured with the suggestions per pkgsrc/doc/HOWTO-use-
> crosscompile?
> 
> 
> When I bootstrap pkgsrc with --compiler=qcc and with QNX Momentics sourced in 
> the path, I get the following error:
> ----------------------------------------------------------------
> ./bootstrap --compiler=qcc --unprivileged --prefix="$HOME/pkg_qnx"
> ........
> ........
> ===> Installing packages
> ===> running: (cd /home/user/pkgsrc_qnx/pkgtools/bootstrap-mk-files && /home/
> user/pkgsrc_qnx/bootstrap/work/bin/bmake  
USE_DESTDIR=no -DPKG_PRESERVE 
> MAKECONF=/home/user/pkgsrc_qnx/bootstrap/work/mk.conf install)
> ERROR: This package has set PKG_FAIL_REASON:
> ERROR: No acceptable compiler found for bootstrap-mk-files-20130703.
> *** Error code 1
> 
> Stop.
> bmake: stopped in /home/user/pkgsrc_qnx/pkgtools/bootstrap-mk-files
> ----------------------------------------------------------------


Re: Getting lighttpd to work  
Hi Aaron,

I think part of your trouble with getting so's to work is that it looks like you may have the --host argument incorrect.
   The standard for GNU autoconf configures is:

--build: the machine the build is running on - in your case, your Ubuntu 12.04 system
--host: the machine the build output is to run on: try x86-nto-qnx for an x86 QNX machine
--target: only used if you're building a compiler: what the compiler is to target, for the "Canadian Cross" - ie using a
 Linux machine (--build) to build gcc for the win32 tools distribution (--host) that compiles for an ARM processor 
running qnx (--target).

(References:  http://jingfenghanmax.blogspot.co.uk/2010/09/configure-with-host-target-and-build.html and https://gcc.gnu
.org/onlinedocs/gccint/Configure-Terms.html ) 

Usually it's only necessary to set --host=x86-nto-qnx, the --build will be auto detected.   With that --host flag, 
libtool 2.4.2 will correctly set the -shared flag to get qcc to build working so files.

Hope this helps,
-Will
Re: Getting lighttpd to work  
Thank you Will - as I've been going through the pkgsrc documentation I see I was not interpreting host correctly.  I 
will try that next to see if shared libraries are enabled.

Sean, I've spent the day setting up pkgsrc per "wiki7146: PkgsrcOnQnx6.6".  To summarize the steps:
-QNX6.6 and header patch installed on host (Linux)
-p4.tar.gz installed on target (QNX) and added to PATH
-CPU, HOST, QNXINSTALL set in doit
-NFS mounts for ~/pkgsrc, /usr/pkg, ${QNX_TARGET}/usr/include
-ssh-agent configured with UseDNS=no
- USE_BUILTIN* lines added to /usr/pkg/etc/mk.conf

I verified NFS mounts work and I can SSH out of the target.  When I then run ./bootstrap from the target, it gets 
through bmake but fails in libnbcompat.  I'm attaching the 2 config.log files.  Do you have any insight to the breakdown
 here? Perhaps I'm missing something to include in the PATH or a library include?  Thank you anything you can offer.
Attachment: Compressed file config_logs.tar 76.5 KB
Re: Getting lighttpd to work  
/home/ubuntu/qnx660/host/linux/x86/usr/bin/i486-pc-nto-qnx6.6.0-ld:
cannot open output file a.out: Permission denied


You don't have write perms over the nfs mount.  Maybe you're running
as root and have root squashed?  If so you may need 'anonuid=0' in the
mount specifications in /etc/exports on the host.



On Fri, Feb 06, 2015 at 05:17:52PM -0500, Aaron Gawlik wrote:
> Thank you Will - as I've been going through the pkgsrc documentation I see I was not interpreting host correctly.  I 
will try that next to see if shared libraries are enabled.
> 
> Sean, I've spent the day setting up pkgsrc per "wiki7146: PkgsrcOnQnx6.6".  To summarize the steps:
> -QNX6.6 and header patch installed on host (Linux)
> -p4.tar.gz installed on target (QNX) and added to PATH
> -CPU, HOST, QNXINSTALL set in doit
> -NFS mounts for ~/pkgsrc, /usr/pkg, ${QNX_TARGET}/usr/include
> -ssh-agent configured with UseDNS=no
> - USE_BUILTIN* lines added to /usr/pkg/etc/mk.conf
> 
> I verified NFS mounts work and I can SSH out of the target.  When I then run ./bootstrap from the target, it gets 
through bmake but fails in libnbcompat.  I'm attaching the 2 config.log files.  Do you have any insight to the breakdown
 here? Perhaps I'm missing something to include in the PATH or a library include?  Thank you anything you can offer.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post113253
> To cancel your subscription to this discussion, please e-mail general-community-unsubscribe@community.qnx.com


Re: Getting lighttpd to work  
You were correct about permissions. I changed no_root_squash to all_squash,anonuid=0,anongid=0.  I also had to enable 
ssh root login.  That allowed the bootstrap to complete successfully.  Thank you for pointing me in the right direction.
  Any help on this next issue is greatly appreciated as well.

I'm not able to use bmake because /bin/bash is not available on the target (QNX).  Does this also need to be linked 
similarly as $HOME/bin/pkgsrc items were so it actually runs on the host machine (Ubuntu)?  I have internet access from 
the target and host.  I also was not able o use bmake fetch-list due to /bin/bash error.  I tried to build pkgsrc/shells
/bash (with the distfile already fetched via the host) but I got the following:
------------------------------------------------------------------------------------
/bin/bash: No such file or directory
===> Skipping vulnerability checks.
WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities'.
===> Installing dependencies for bash-4.2nb3
The following variables will affect the build process of this package,
bash-4.2nb3.  Their current value is shown below:
        * CURSES_DEFAULT = ncurses
Based on these variables, the following variables have been set:
        * CURSES_TYPE = ncurses
        * TERMCAP_TYPE = curses
You may want to abort the process now with CTRL-C and change their value
before continuing.  Be sure to run `/usr/pkg/bin/bmake clean' after
the changes.
==========================================================================
/bin/bash: No such file or directory
*** Error code 1

Stop.
bmake: stopped in /home/ubuntu/pkgsrc/shells/bash
------------------------------------------------------------------------------------

When I tried to bmake the dependency ncurses:
------------------------------------------------------------------------------------
/bin/bash: No such file or directory
===> Skipping vulnerability checks.
WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities'.
=> Fetching ncurses-5.9.tar.gz
/bin/bash: No such file or directory
*** Error code 1

Stop.
bmake: stopped in /home/ubuntu/pkgsrc/devel/ncurses
------------------------------------------------------------------------------------
Re: Getting lighttpd to work  
The bash issue is strange. There should be no such dependency at this stage. What does the following show in a 
particular package (misc/figlet for example)

# bmake show-var VARNAME=TOOLS_PLATFORM.sh

The default should be /bin/sh from mk/tools/tools.QNX.mk

Sent from my BlackBerry 10 smartphone on the Rogers network.
  Original Message
From: Aaron Gawlik
Sent: Saturday, February 7, 2015 2:52 PM
To: general-community
Reply To: general-community@community.qnx.com
Subject: Re: Getting lighttpd to work


You were correct about permissions. I changed no_root_squash to all_squash,anonuid=0,anongid=0.  I also had to enable 
ssh root login.  That allowed the bootstrap to complete successfully.  Thank you for pointing me in the right direction.
  Any help on this next issue is greatly appreciated as well.

I'm not able to use bmake because /bin/bash is not available on the target (QNX).  Does this also need to be linked 
similarly as $HOME/bin/pkgsrc items were so it actually runs on the host machine (Ubuntu)?  I have internet access from 
the target and host.  I also was not able o use bmake fetch-list due to /bin/bash error.  I tried to build pkgsrc/shells
/bash (with the distfile already fetched via the host) but I got the following:
------------------------------------------------------------------------------------
/bin/bash: No such file or directory
===> Skipping vulnerability checks.
WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities'.
===> Installing dependencies for bash-4.2nb3
The following variables will affect the build process of this package,
bash-4.2nb3.  Their current value is shown below:
        * CURSES_DEFAULT = ncurses
Based on these variables, the following variables have been set:
        * CURSES_TYPE = ncurses
        * TERMCAP_TYPE = curses
You may want to abort the process now with CTRL-C and change their value
before continuing.  Be sure to run `/usr/pkg/bin/bmake clean' after
the changes.
==========================================================================
/bin/bash: No such file or directory
*** Error code 1

Stop.
bmake: stopped in /home/ubuntu/pkgsrc/shells/bash
------------------------------------------------------------------------------------

When I tried to bmake the dependency ncurses:
------------------------------------------------------------------------------------
/bin/bash: No such file or directory
===> Skipping vulnerability checks.
WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities'.
=> Fetching ncurses-5.9.tar.gz
/bin/bash: No such file or directory
*** Error code 1

Stop.
bmake: stopped in /home/ubuntu/pkgsrc/devel/ncurses
------------------------------------------------------------------------------------




_______________________________________________

General
http://community.qnx.com/sf/go/post113258
To cancel your subscription to this discussion, please e-mail general-community-unsubscribe@community.qnx.com
Re: Getting lighttpd to work  
# bmake show-var VARNAME=TOOLS_PLATFORM.sh
/bin/bash

but looking in mk/tools/tools.QNX.mk, TOOLS_PLATFORM.sh was set to sh.  It's possible the discrepancy could have been 
left over from running pkgsrc tests on the host and not being cleaned properly.  I removed all pkgsrc generated files 
from host and started with a fresh target and have successfully built bootstrap, figlet, and lighttpd.

It's a clever method to run the gnu tools off the host directly onto the target and is quite simple once set up.  Thank 
you for providing it and the very quick responses to help me along!