Crates.io | apache-rs |
lib.rs | apache-rs |
version | 0.0.4 |
source | src |
created_at | 2021-11-20 22:00:36.079617 |
updated_at | 2024-04-07 18:56:10.950386 |
description | Rust FFI for creating Apache httpd modules. |
homepage | |
repository | https://github.com/studersi/apache-rs |
max_upload_size | |
id | 485082 |
size | 18,152 |
Rust FFI for creating Apache httpd modules.
There is a bundled example implementing mod_example
from the Apache httpd documentation: https://httpd.apache.org/docs/2.4/developer/modguide.html.
sudo apt install llvm-dev libclang-dev clang
sudo apt install apache2-dev libapr1-dev
cargo build
cargo test --lib
mod_example
cd examples/mod_example/
cargo build
cd examples/mod_example/
cargo build
sudo apxs -i -a -n example ./target/debug/libmod_example.so
cd examples/mod_sum/
cargo build
sudo apxs -i -a -n sum ./target/debug/libmod_sum.so
sudo tee /etc/apache2/mods-available/example.conf > /dev/null <<EOT
<IfModule example_module>
<Location "/example">
SetHandler example-handler
</Location>
</IfModule>
EOT
sudo a2enmod example
sudo tee /etc/apache2/mods-available/sum.conf > /dev/null <<EOT
<IfModule sum_module>
AddHandler sum-handler .sum
</IfModule>
EOT
sudo a2enmod sum
sudo systemctl restart apache2
Navigate to http://localhost/example
Navigate to http://localhost/any/path.sum