How to Run Web TWAIN App on Nginx within Docker Container

Dynamic Web TWAIN (DWT) is a Web-based TWAIN scanning solution, which could be deployed to Windows, Mac OS X, and Linux. Users could visit DWT apps via any HTML5-comptible Web browsers on Windows or Mac. To facilitate the process of Web project deployment, we can use Docker. In this post, I’m going to demo how to build a Web TWAIN docker image, and how to run the Web TWAIN “hello world” with commands in one line.

Read more

How to Configure and Install Nginx on Mac OS X

In this tutorial, I would like to show how to configure and install nginx on Mac OS X. My Mac system is Mavericks 10.9.2.

mac environment

Prerequisites

You have to install Xcode command line tools.

Install Nginx

1. Download the latest stable version – nginx 1.4.7.

2. Unzip the downloaded package by the command “tar xvzf nginx-1.4.7.tar.gz”.

3. “cd nginx-1.4.7”.

4. “sudo ./configure”. There is an error displayed:

./configure: error: the HTTP rewrite module requires the PCRE library.

You can either disable the module by using --without-http_rewrite_module

option, or install the PCRE library into the system, or build the PCRE library

statically from the source with nginx by using --with-pcre=<path> option.

5. To fix the error, visit the tutorial page and read “Building nginx from Sources”, in which you can find the link of PCRE library.

6. Go to PCRE official site, and find the latest version of PCRE library on SourceForge.

7. Download the package and unzip it by the command “tar xvzf pcre-8.34.tar.bz2”.

8. Now, you can run the configure file again with the parameters  “sudo ./configure –with-pcre=path”.

9. Configuration is done.

  nginx path prefix: "/usr/local/nginx"

  nginx binary file: "/usr/local/nginx/sbin/nginx"

  nginx configuration prefix: "/usr/local/nginx/conf"

  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"

  nginx pid file: "/usr/local/nginx/logs/nginx.pid"

  nginx error log file: "/usr/local/nginx/logs/error.log"

  nginx http access log file: "/usr/local/nginx/logs/access.log"

  nginx http client request body temporary files: "client_body_temp"

  nginx http proxy temporary files: "proxy_temp"

  nginx http fastcgi temporary files: "fastcgi_temp"

  nginx http uwsgi temporary files: "uwsgi_temp"

  nginx http scgi temporary files: "scgi_temp" 

the default nginx path prefix is “/usr/local/nginx”.

10. To install nginx, type in “sudo make install”.

11. Find the executable file “cd /usr/local/nginx/sbin”

12. Launch nginx “sudo ./nginx”

The nginx is successfully running now!

nginx running

If you have any questions, just email {desmond at dynamsoft dot com}.