一、Getting Started:
On Windows, Appweb is managed by two programs:
1、The Appweb Manager
Windows services run in the background with little interaction with the user. So to provide more convenient access to manage Appweb.
If Appweb fails, Appman will automatically restart it.
操作方法:控制面板->管理工具->服务->Embedthis Appweb .
2、The Appweb Monitor
runs and is accessible from the windows system tray (taskbar notification area). You can start and stop Appweb using either the manager or Monitor programs.
二、Configuring Appweb
including what ports and addresses to listen to, what modules to load, where to find the web pages and how to log requests.
2、配置方法:
1、Appweb API
2、appweb.conf:
The configuration file may include other configuration files。
Compatibility with the Apache configuration file but there are a few differences.
F:/appweb_p/appweb-6.0.0/doc/dist/users/directives.html
3、配置文件:
."#" character are comments and are ignored
.支持Include Directives,Conditional Directives。
.The configuration file is parsed in a single top-to-bottom pass. The order of directives is important as certain directives depend on others. For example, you must define the Home before using the LoadModule directive.
4、Configuration Blocks:
Global Directives:全局目录
Route Blocks:The block is created by the Route directive.
Virtual Host Blocks:A Virtual host block defines a group of directives that apply to a virtual sub-server. A virtual server may be associated with a virtual server name or with an IP address. Virtual hosts enable you to segment the web server to serve unique content for different domains or IP addresses.
三、Web Frameworks
Appweb provides a rich set of options(four options) to use when creating web pages or web applications.
1、Embedded Server Pages:
ESP is a new web framework that provides templates, caching, Model-View-Controller paradigm, and an application and scaffold generator.
2、Action Handler
The action handler is a simple Appweb request handler that maps URIs to C functions.
The action handler is ideal for simple bindings from URI to C code.
3、PHP Framework
it typically has a memory footprint of more than 5 MB for the PHP code alone. For embedded systems, this is often too big and so we recommend using ESP instead.
4、Common Gateway Interface (CGI)
It is standard but slow. Unless you have legacy CGI programs or need to run a scripting language via CGI, you are better served by using either ESP.
四、Using Loadable Modules
An Appweb loadable module is a discrete(分离) unit of functionality that may be linked into Appweb to enhance the core HTTP server. Loadable Modules may be dynamically loaded via shared libraries or DLLs
mod_cgi
Common Gateway Interface (CGI) handler
mod_esp
Embedded Server Pages (ESP) handler
mod_ejs
Ejscript Server-Side JavaScript) module
mod_ssl Secure Sockets Layer (SSL) module
指定模块方法:
The LoadModule directive will load a module and activate it for processing.
On Windows, this directive will load libmyModule.dll. On Linux, it will load libmyModule.so. If the module is statically linked into Appweb, the Load Module directive will not need to load it.
例:LoadModule myModule lib/libmyModule
指定搜索目录:
Appweb will look for the module in the directory specified relative to the directory defined by the Home directive. Appweb will search other directories if a LoadModulePath directive is specified.
例:LoadModulePath "../macosx-x64-debug/bin"
|
ESP |
Action Handler |
CGI |
Target Use |
Web user interfaces, comms services |
Simple C functions to serve content |
Have existing CGI program |
Enterprise web pages and forms |
Memory (excluding core Appweb) |
200K plus app code |
5K |
External program |
20-50MB plus app code |
Performance |
Very fast |
Fast |
Very slow |
Medium speed but large memory consumption |
Advantages |
Efficient and powerful framework |
Simple, fast processing |
Standard in wide-use |
Large base of PHP code and developers |
Disadvantages |
No enterprise connectivity to MySQL |
No web templates or higher-level functionality |
Slow. Limit to forms. Low functionality |
Large memory footprint |