embedded-boa支持https

海思平台编译 Openssl

// 输入下面字符然后 tab 键补全,确认交叉编译环境是否正常
arm-

./config no-asm no-async shared --prefix=/bakpart/openssl/ --cross-compile-prefix=arm-hisiv100nptl-linux-

no-asm 在交叉编译过程中不使用汇编代码代码加速编译过程
no-async 没有提供GNU C的ucontext库,避免如下报错:
./libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
./libcrypto.so: undefined reference to `getcontext'
./libcrypto.so: undefined reference to `setcontext'
./libcrypto.so: undefined reference to `makecontext'
no-shared 生成静态链接库
--prefix 指定生成lib include bin目录的路径,不修改此项则默认为OPENSSLDIR目录

make

如果编译报错,并提示"m64"字样报错信息,多半是交叉编译器不支持m64选项。解决办法:
修改Makefile ,若有-m32或-m64 字段,直接删除即可

make install

完成安装后,你可以在/bakpart/openssl/发现include和lib。
其中include包含头文件集合,lib是生成的静态库(.a.1.1)和动态库文件(.so.1.1)。

编译带 openssl 的 BOA

创建 ca.cnf 文件

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no

[req_distinguished_name]
C = CH
ST = ShangHai
L = ShangHai
O = LanBe
OU = IT Department
CN = LanBe.com

[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
extendedKeyUsage = serverAuth

[alt_names]

# 改成自己的域名
# DNS.1 = 192.168.0.10

# 改成自己的ip
IP.1 = 192.168.0.10
https://sourceforge.net/projects/boa/
https://github.com/gpg/boa
下面这个完善,使用上有问题
https://github.com/lanzhongheng/boa-0.94-13-ssl

// boa-ssl.tar.gz 这个版本,不要 .configure 生成新的 makefile 使用现有的就可以,否则会丢配置
CC = arm-hisiv100nptl-linux-gcc
CPP = arm-hisiv100nptl-linux-gcc -E

make
// 去掉 debug 信息
arm-none-linux-gnueabi-strip boa

通过openssl生成私钥
openssl genrsa -out server.key 2048
根据私钥生成证书申请文件csr,按照提示信息,输入
openssl req -new -out server.csr -key server.key -config server.cnf
// 查看 csr 信息
openssl req -text -noout -in server.csr

使用私钥对证书申请进行签名从而生成证书
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile server.cnf
这样就生成了有效期为:10年的证书文件,对于自己内网服务使用足够。

指定boa的日志目录
boa有两种日志文件:记录其所出现的错误和记录其运行状态。
1)记录其所出现的错误。ErrorLog /var/log/boa/error_log
2)记录其运行状态。AccessLog /var/log/boa/access_log

指定网页所在的目录
如:DocumentRoot /home/httpd/html
表示网页文件需放在此目录下。
默认的主页名
如:DirectoryIndex index.html
表示默认的主页名为 index.html

指定cgi 脚本的目录
如:ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/

问题

Your client does not have permission to get URL /cgi-bin/