Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Latest commit

 

History

History
61 lines (47 loc) · 947 Bytes

README.md

File metadata and controls

61 lines (47 loc) · 947 Bytes

Rust Apache httpd module

Clone repository

git clone https://github.com/studersi/rust-test-apache.git
cd rust-test-apache

Apache httpd src

  • Download Apache httpd
wget -P downloads/ https://downloads.apache.org/httpd/httpd-2.4.46.tar.gz
tar -xvf downloads/httpd-2.4.46.tar.gz -C downloads/
  • Download APR
wget -P downloads/ https://downloads.apache.org/apr/apr-1.7.0.tar.gz
tar -xvf downloads/apr-1.7.0.tar.gz -C downloads/

Docker

  • Build container
docker build -t rust-apache .
  • Run container
docker run -it -v "$(pwd):/home/rustacian" rust-apache

C example

  • Build module
apxs -a -c mod_example.c

Rust example

  • Update wrapper.h
grep "#include.*.h" mod_example.c | sed 's/[<>]/"/g' > mod_rs/wrapper.h
  • Build Rust project
cd mod_rs
cargo build