> ## Documentation Index
> Fetch the complete documentation index at: https://www.jetify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Apache

> Apache can be automatically configured by Devbox via the built-in Apache Plugin. This plugin will activate automatically when you install Apache using `devbox add apache`.

[**Example Repo**](https://github.com/jetify-com/devbox/tree/main/examples/servers/apache)

### Adding Apache to your Shell[​](#adding-apache-to-your-shell "Direct link to Adding Apache to your Shell")

Run `devbox add apache`, or add the following to your `devbox.json`

```json theme={null}
  "packages": [
    "apache@latest"
  ]
```

This will install the latest version of Apache. You can find other installable versions of Apache by
running `devbox search apache`. You can also view the available versions on
[Nixhub](https://www.nixhub.io/packages/apache)

## Apache Plugin Details[​](#apache-plugin-details "Direct link to Apache Plugin Details")

The Apache plugin will automatically create the following configuration when you install Apache with
`devbox add`.

### Services[​](#services "Direct link to Services")

* apache

Use `devbox services start|stop apache` to start and stop httpd in the background.

### Helper Files[​](#helper-files "Direct link to Helper Files")

The following helper files will be created in your project directory:

* \{PROJECT\_DIR}/devbox.d/apacheHttpd/httpd.conf
* \{PROJECT\_DIR}/devbox.d/web/index.html

Note that by default, Apache is configured with `./devbox.d/web` as the DocumentRoot. To change
this, you should copy and modify the default `./devbox.d/apacheHttpd/httpd.conf`.

### Environment Variables[​](#environment-variables "Direct link to Environment Variables")

```bash theme={null}
HTTPD_ACCESS_LOG_FILE={PROJECT_DIR}/.devbox/virtenv/apacheHttpd/access.log
HTTPD_ERROR_LOG_FILE={PROJECT_DIR}/.devbox/virtenv/apacheHttpd/error.log
HTTPD_PORT=8080
HTTPD_DEVBOX_CONFIG_DIR={PROJECT_DIR}
HTTPD_CONFDIR={PROJECT_DIR}/devbox.d/apacheHttpd
```

### Notes[​](#notes "Direct link to Notes")

We recommend copying your `httpd.conf` file to a new directory and updating HTTPD\_CONFDIR if you
decide to modify it.

### Disabling the Apache Plugin[​](#disabling-the-apache-plugin "Direct link to Disabling the Apache Plugin")

You can disable the Apache plugin by running `devbox add apache --disable-plugin`, or by setting the
`disable_plugin` field in your `devbox.json`:

```json theme={null}
{
  "packages": {
    "apache": {
      "version": "latest",
      "disable_plugin": true
    }
  }
}
```

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-examples/servers/apache/index.mdx)
