Appweb port to 2410

Source: Internet
Author: User
Tags builtin

There are many lightweight Web servers in many web servers, such as BOA, thttp,
Lighttpd and so on, but if you want to have a high security and can provide a convenient embedded web server for later web development and development
Server is too thin. The company requires the use of web to manage embedded products for development, and must have certain security performance. A comprehensive comparison of several lightweight, embedded web
Server. We recommend that you use two Web servers in the Michael o'brien architecture: GoAhead.
Http://webserver.goahead.com/webserver/webserver.htm
) And appweb (http://www.appwebserver.org/downloads/appWeb/download.php
).



The former is the embedded Management of goahead.
This software package is mainly used to solve the problems related to embedded system development in the future. This web server is very small and its win
The size of the compiled ce version is less than 60 kb, and its output is usually oriented to some small screen devices. GPL & Commercial
License is the leader of Embedded Web servers in the future.

 
The latter is Michael.
The first product of the company mbedthis created by O 'Brien, GPL & Commercial
License. Mob describes it as mini-Apache. during use, mob also feels this: Through appweb. conf
This configuration file supports dynamic loading of modules. The above two configuration files are the first choice for most routers and other devices.
Server features:

 
Appweb
Features ):

Appweb is a standards-based embedded HTTP server that has a wealth
Of features including:
1, standards compliant HTTP/1.1 web server core
2, embeddable in applications and devices (supports xip)
3, dynamically loadable modules
4, Embedded Server Pages (ESP) for Dynamic Content
(In fact, it is used to support ASP modules like goahead)
5. session State Data Management
6. server-side embedded Javascript
7. Secure Socket Layer (SSL ):


(OpenSSL and matrixssl)

8, in-process CGI as well as traditional CGI
9. romable web pages and configuration files
10, digest Authentication




********
11. HTTP client program and Library
12, extensive logging
13. Fastest performance in its class
14. modular source code and documentation provided
15. APACHE-style configuration, logging, and single-and
Multi-threaded apps.

 
Because the company's products need to consider security issues, we must point out the SSL of matrixssl.
3.0 implementation. matrixssl is an SSL designed for embedded products, far smaller than OpenSSL, GPL &
Commercial license, which occupies about 50 k ram.

In terms of performance, a 24mh
Z's 68040 processor, with a response speed of 20 times/second, uses a 266mhz Pentium processor to achieve a response speed of 50 times/second. It has the following features:

1. Support for ASP
2. Supports embedded Javascript
3. Standard CGI execution
4. Memory CGI processing gofroms
5. Extended APIs
6. Fast response. More than 50 requests can be processed per second.
7. fully compatible with the standard
8. If SSL is not included, only 60 kb of memory is required. If SSL is included, KB of memory is required.
9. The web page may exist in the ROM or file system.
10. Supports multiple operating systems, including ECOs, Linux, lynxos, QNX, VxWorks, WinCE, and PSOs.

 
Read dglwx

In the Linux ageStatic compilation of Web Server
Appweb (with matrixssl support) for arm9-+ Linux

I got a lot of help. Now let's talk about my porting process.

My development environment: linux2.6.14 + arm2410 (Board)

COMPUTER: fedora8 cross compiler 3.4.1

1, download the appweb source code: http://www.appwebserver.org/software/appweb-src-2.4.0-0.tar.gz

2. Unzip the package:
# Tar-xvzf appwe-src-2.4.0-0.tar.gz

3. Modify the environment variable:

# Export cc =/usr/local/ARM/3.4.1/bin/ARM-Linux-GCC # export AR =/usr/local/ARM/3.4.1/bin/ARM-Linux-ar # export LD =/usr/local/ARM/3.4.1/bin/ARM-Linux-lD # export ranlib =/usr/local/ARM/3.4.1/bin/ARM-Linux-ranlib # export strip =/usr/local/ARM/3.4.1/bin/ARM-Linux-Strip # export cc_for_build = gcc

4, download matrixssl source code: http://www.matrixssl.org/download.html

5. decompress the package to/root/wangyi:
# Tar-xvzf matrixssl-1-8-3-open.tar.gz
6, go to/root/wangyi/src/matrixssl-1-8-3-open/src to modify makefile:

Modify CC, strip, AR, and ranlib as our cross compiler, for example:
Cc =
/Opt/crosstool/gcc-3.4.1-glibc-2.3.3/ARM-softfloat-Linux-GNU/bin/ARM-softfloat-Linux-GNU-gcc

7. Make
The dynamic link library libmatrixssl. So and static Link Library libmatrixsslstatic. A will be generated in the current directory.

8. Perform./configure on appweb:
./Configure -- Host = arm-s3c2410-linux -- Build = i686-pc-linux
-- Port = 80 -- type = release -- disable-log -- enable-multi-thread
-- Disable-shared -- disable-samples -- disable-shared-libc
-- Enable-static -- disable-test -- disable-access-log -- enable-ejs
-- Disable-modules -- With-CGI = builtin -- With-copy = builtin
-- With-auth = builtin -- With-ESP = builtin -- With-upload = builtin
-- With-C-API = builtin -- without-php5 -- With-SSL = builtin
-- With-matrixssl = builtin
-- With-matrixssl-Dir =/root/wangyi/matrixssl-1-8-6-open/src
-- With-matrixssl-libpath =/root/wangyi/matrixssl-1-8-6-open/src
-- With-matrixssl-iflags = "-I/root/wangyi/matrixssl-1-8-6-open/src
-I/root/wangyi/matrixssl-1-8-6-open /"
-- With-matrixssl-libs = libmatrixsslstatic

You can use./configure -- help to view related instructions. For details about-with-matrixssl-libs, you must note that this option tells the linker that
The matrixssl lib library linked to the appweb executable file. If you want to dynamically compile the file, choose libmatrixssl. So. At this time, we should
Withmatrixssllibs = libmatrixssl;
If you want to perform static compilation, you should select libmatrixsslstatic. A as the static library file.
-- With-matrixssl-libs = libmatrixsslstatic.

 

9 make

In this process, the three function undefined errors in src/OS/Linux. C under the matrixssl source code will appear. In this case, we will comment out the relevant sections and then OK.

Line 123: pthread_mutexattr_init ()
Line 125 pthread_mutexattr_settype ();
Line 135 pthread_mutexattr_destroy ()

After successful make, the appweb and appweb. conf files will be generated under the appweb directory. In addition, there are some keys required for matrixssl running. These files include: appweb (BIN)
, Appweb. conf (configuration file), mime. Types
, Directory web (DocumentRoot), server. Key. Pem, server. CRT, server. Key
10. Run appweb and enable Web Services.

./Appweb-F appweb. conf

Enter https: // 192.168.2.16: 4443/in the browser/
However, CGI cannot be accessed, but HTML ....

Prompt: [root @ globaltime appweb] $./appweb-F appweb. conf
Unknown conditional openssl_module
Can't make Temp File/tmp/mpr_920_127.tmp, errno 30
Can't create stdio files

Can't open CGI output files
502 "Bad Gateway" for "/cgi-bin/login. cgi", file
"/Mnt/bin/appweb/www/cgi-bin/Lo
Gin. cgi ": cant write to CGI program

It turns out that he wants to write a super under/tmp, and my directory is read-only. Modify in source code:

You can edit MIP/Embedded. cpp and change
Mprmaketempfilename and change/tmp to whatever you
Need. This is the advice provided by the Code developer .. I replaced/tmp with/MNT.

OK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.