Skip to content
Merged
47 changes: 30 additions & 17 deletions crowdsec-docs/unversioned/bouncers/apache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,45 @@ At the back, this component uses `mod_proxy`, `mod_ssl` for requests to LAPI, an

:::warning

There is not yet publicly available packages or this Remediation Component.
Packages are only available for debian and ubuntu systems.

We are providing ways to build your own while we're working on packaging.
The module can be built and installed on other platform as well.

:::

Clone or download directly [from our GitHub repository](https://github.com/crowdsecurity/cs-apache2-bouncer).
Please keep in mind that this bouncer only supports live mode.

:::

<Tabs
defaultValue="nginx_debian"
defaultValue="apache_debian"
values={[
{ label: 'Debian/Ubuntu', value: 'nginx_debian' ,},
{ label: 'Debian/Ubuntu', value: 'apache_debian' ,},
{ label: 'Others (build from source)', value: 'others' ,},
]
}>
<TabItem value="nginx_debian">
<TabItem value="apache_debian">

### Repository configuration

:::warning
Please note that the repository for this package is not the same as the one holding CrowdSec's binary packages,
:::

```bash
curl -s https://packagecloud.io/install/repositories/crowdsec/crowdsec-apache/script.deb.sh | sudo bash
```

### Installation

```bash
dpkg-buildpackage -us -uc
sudo dpkg -i ../crowdsec-apache2-bouncer_1.0.0_amd64.deb
sudo apt-get install crowdsec-apache2-bouncer
```

</TabItem>

<TabItem value="others">

Clone or download directly [from our GitHub repository](https://github.com/crowdsecurity/cs-apache2-bouncer).

```bash
aclocal
autoconf
Expand All @@ -87,10 +99,6 @@ sudo mkdir -p /etc/crowdsec/bouncers/
sudo cp ./config/crowdsec-apache2-bouncer.conf /etc/crowdsec/bouncers/
```

</TabItem>

</Tabs>

### Initial Configuration

Enable the mod_crowdsec module:
Expand All @@ -110,7 +118,6 @@ Remediation Component config's is located in `/etc/crowdsec/bouncers/crowdsec-ap
```bash
## Replace the API key with the newly generated one [1]
CrowdsecAPIKey this_is_a_bad_password
...
```

:::info
Expand All @@ -121,8 +128,14 @@ If needed, edit `CrowdsecURL` (and other parameters)
sudo systemctl restart apache2
```

</TabItem>
</Tabs>


## Configuration directives

The configuration file is stored in `/etc/crowdsec/bouncers/crowdsec-apache2-bouncer.conf` by default.

### `Crowdsec`

> on|off
Expand All @@ -138,9 +151,9 @@ Behavior can be overriden in any location.
> fail|block|allow

How to respond if the Crowdsec API is not available:
- `fail` (**default**) returns a 500 Internal Server Error.
- `fail` returns a 500 Internal Server Error.
- `block` returns a 302 Redirect (or 429 Too Many Requests if CrowdsecLocation is unset).
- `allow` will allow the request through.
- `allow` (**default**) will allow the request through.

### `CrowdsecBlockedHTTPCode`

Expand Down