We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 65217

PetaLinux 2015.2 - How Can I Replace the uWeb Web Server Application?


By default, PetaLinux 2015.2 includes the uWeb web server for hosting web content.

Is it possible to replace this with an alternative web server?


Yes, this is possible. The demonstration below will replace uWeb with another lightweight web server called BOA.

First, disable the uWeb application in the PetaLinux root filesystem configuration:

petalinux-config -c rootfs

Next, compile the BOA application:

1. Open a terminal and source the petalinux setting script.

2. Under /boa-0.94.13/src, run ./configure

3. A Makefile is now generated in /boa-0.94.13/src. 

Modify it to specify the cross-compiler:

CC=arm-xilinx-linux-gnueabi-gcc CPP= arm-xilinx-linux-gnueabi-gcc -E

4. Modify the following files:

In boa.c, remove the following code,

if (setuid(0) != -1) {
            DIE("icky Linux kernel bug!");

In compat.h row 120, modify the following

#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff

change it to

#define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff

In config.c, remove the following:

if (!server_name) {.}.

This is the block of code from line 266 to line 286.

In log.c, remove the following code segment,

if (dup2(error_log, STDERR_FILENO) == -1) {
            DIE("unable to dup2 the error log");

5. Once the modifications are in place, run make. 

The binaries boa and boa_indexer are generated under /boa-0.94.13/src

6. To finalize the build, run the following:

arm-xilinx-linux-gnueabi-strip boa

Create the necessary files and directory in rootfs:

  1. Copy boa.conf to /etc/boa/boa.conf.
    boa.conf can be found in / boa-0.94.13.
    This file might need some modifications according to the needs of your system.
    An example modified version file is attached to this Answer Record.

  2. According to boa.conf, create the following directory in the root filesystem area of your PetaLinux project:
    /mnt/log/boa/, /mnt/www/, /mnt/www/cgi_bin/

  3. In the root filesystem /etc, there should be three files: passwd, group, and mime.types.
    The PetaLinux root filesystem might already have passwd and group in /etc.

  4. Copy binaries boa and boa_indexer to the root filesystem /bin area.
    Copy your HTML content and related folders to /mnt/www.

  5. Build the PetaLinux project like normal and generate a boot image.

  6. Boot Linux on the target platform. The web content can be accessed using a web browser and navigating to the IP address of the webserver.

An example boot image for Xilinx ZC706 is attached to this answer record.


Associated Attachments

Name File Size File Type
boa-0.94.13.tar.gz 119 KB GZ
boa.conf 7 KB CONF
mime.types 42 KB TYPES
boa_indexer 22 KB NA
web_page.zip 407 KB ZIP
image.ub 6 MB UB
AR# 65217
Date Created 08/14/2015
Last Updated 10/02/2015
Status Active
Type General Article
  • Zynq-7000
  • PetaLinux
  • PetaLinux - 2015.2