Administers Apache HTTP Server: config validation, virtual hosts, module inspection, htpasswd basic auth, and graceful reloads.
Agentic Workflow: Read -> Reason -> Act (apache-httpd)
You are Apache Httpd (api/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — api context for apache-httpd
- Domain: Administers Apache HTTP Server: config validation, virtual hosts, module inspection, htpasswd basic auth, and graceful reloads.
- config-management: Validate, dump, and hot-reload the Apache configuration. —
apachectl -t
- vhost-and-auth: Configure virtual hosts and protect directories with htpasswd. —
htpasswd -c /etc/httpd/conf/.htpasswd alice
- Check
knowledge and prerequisites: apachectl, htpasswd, httpd
2. Reason — think for apache-httpd
- For
config-management: Validate, dump, and hot-reload the Apache configuration. — decide which checks to run
- For
vhost-and-auth: Configure virtual hosts and protect directories with htpasswd. — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with apache-httpd tools
- Tools:
Glob, Grep, Read, Apachectl, Httpd (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
apache-httpd:462b2819
Apache HTTP Server
What this skill does
Administers Apache httpd: validating configs before reload, inspecting virtual hosts and modules, configuring reverse proxies and SSL, and protecting paths with htpasswd basic auth.
When to use
- A config change must be validated before a reload
- Setting up a virtual host for a new site
- Password-protecting an internal path
Real commands
# Validate config
apachectl -t
# Dump vhost summary
apachectl -S
# Check loaded modules
httpd -t -D DUMP_MODULES | grep -E "ssl|proxy"
# Graceful reload
apachectl graceful
# htpasswd management
htpasswd -c /etc/httpd/conf/.htpasswd alice
htpasswd -b /etc/httpd/conf/.htpasswd bob bobpass
apachectl -t && apachectl graceful
Vhost example
<VirtualHost *:443>
ServerName api.your-app.test
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/api.crt
SSLCertificateKeyFile /etc/pki/tls/private/api.key
ProxyPass /api/ http://backend:8080/api/
ErrorLog logs/api-error.log
CustomLog logs/api-access.log combined
</VirtualHost>
Basic auth block
<Location /admin>
AuthType Basic
AuthName "Admin"
AuthUserFile /etc/httpd/conf/.htpasswd
Require valid-user
</Location>
Testing
- Always run
apachectl -t before graceful
- Test auth with curl -u and confirm 401 without credentials
Best practices
- Prefer graceful over restart to avoid dropping connections
- Use bcrypt (htpasswd -B) for password files
- Check apachectl -S after adding vhosts for name collisions
Capabilities
config-management
Validate, dump, and hot-reload the Apache configuration.
Parameters:
config_file (string): Alternate config file via -f
module (string): Module name to check via DUMP_MODULES
Commands:
apachectl -t
apachectl -S
httpd -V
apachectl graceful
apachectl configtest
Examples:
- apachectl -t && apachectl graceful
- apachectl -S | grep -E "port|vhost"
- httpd -t -D DUMP_MODULES | grep ssl
vhost-and-auth
Configure virtual hosts and protect directories with htpasswd.
Parameters:
file (string): htpasswd file path
user (string): Username to add/remove
bcrypt (boolean): -B enables bcrypt hashing
Commands:
htpasswd -c /etc/httpd/conf/.htpasswd alice
htpasswd -b /etc/httpd/conf/.htpasswd bob bobpass
htpasswd -D /etc/httpd/conf/.htpasswd bob
htpasswd -nB alice
curl -u alice:pass -I http://localhost/private/
Examples:
- htpasswd -c .htpasswd admin && apachectl -t && apachectl graceful
- curl -I -u alice:secret http://localhost/private/
- htpasswd -bB /etc/httpd/conf/.htpasswd deploy deploypass
References
1---2name: "apache-httpd"3description: "Administers Apache HTTP Server: config validation, virtual hosts, module inspection, htpasswd basic auth, and graceful reloads. Use when working with config management, vhost and auth, api or when the user mentions config management, vhost and auth, api."4license: "MIT"5compatibility: "Requires apachectl, htpasswd, httpd. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/apache-httpd8 author: Kdesk9 version: 2.0.010 category: api11allowed-tools: "Glob Grep Read Bash(apachectl:*) Bash(curl:*) Bash(htpasswd:*) Bash(httpd:*)"12---1314Administers Apache HTTP Server: config validation, virtual hosts, module inspection, htpasswd basic auth, and graceful reloads.1516## Agentic Workflow: Read -> Reason -> Act (apache-httpd)1718You are **Apache Httpd** (api/general) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — api context for `apache-httpd`21- Domain: Administers Apache HTTP Server: config validation, virtual hosts, module inspection, htpasswd basic auth, and graceful reloads.22- **config-management**: Validate, dump, and hot-reload the Apache configuration. — `apachectl -t`23- **vhost-and-auth**: Configure virtual hosts and protect directories with htpasswd. — `htpasswd -c /etc/httpd/conf/.htpasswd alice`24- Check `knowledge` and `prerequisites: apachectl, htpasswd, httpd`2526### 2. Reason — think for `apache-httpd`27- For `config-management`: Validate, dump, and hot-reload the Apache configuration. — decide which checks to run28- For `vhost-and-auth`: Configure virtual hosts and protect directories with htpasswd. — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `apache-httpd` tools32- Tools: `Glob`, `Grep`, `Read`, `Apachectl`, `Httpd` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `apache-httpd:462b2819`3536# Apache HTTP Server3738## What this skill does3940Administers Apache httpd: validating configs before reload, inspecting virtual hosts and modules, configuring reverse proxies and SSL, and protecting paths with htpasswd basic auth.4142## When to use4344- A config change must be validated before a reload45- Setting up a virtual host for a new site46- Password-protecting an internal path4748## Real commands4950```bash51# Validate config52apachectl -t5354# Dump vhost summary55apachectl -S5657# Check loaded modules58httpd -t -D DUMP_MODULES | grep -E "ssl|proxy"5960# Graceful reload61apachectl graceful6263# htpasswd management64htpasswd -c /etc/httpd/conf/.htpasswd alice65htpasswd -b /etc/httpd/conf/.htpasswd bob bobpass66apachectl -t && apachectl graceful67```6869## Vhost example7071```apache72<VirtualHost *:443>73 ServerName api.your-app.test74 SSLEngine on75 SSLCertificateFile /etc/pki/tls/certs/api.crt76 SSLCertificateKeyFile /etc/pki/tls/private/api.key77 ProxyPass /api/ http://backend:8080/api/78 ErrorLog logs/api-error.log79 CustomLog logs/api-access.log combined80</VirtualHost>81```8283## Basic auth block8485```apache86<Location /admin>87 AuthType Basic88 AuthName "Admin"89 AuthUserFile /etc/httpd/conf/.htpasswd90 Require valid-user91</Location>92```9394## Testing9596- Always run `apachectl -t` before `graceful`97- Test auth with curl -u and confirm 401 without credentials9899## Best practices100101- Prefer graceful over restart to avoid dropping connections102- Use bcrypt (htpasswd -B) for password files103- Check apachectl -S after adding vhosts for name collisions104105## Capabilities106107### config-management108Validate, dump, and hot-reload the Apache configuration.109110**Parameters:**111- `config_file` (string): Alternate config file via -f112- `module` (string): Module name to check via DUMP_MODULES113114**Commands:**115- `apachectl -t`116- `apachectl -S`117- `httpd -V`118- `apachectl graceful`119- `apachectl configtest`120121**Examples:**122- apachectl -t && apachectl graceful123- apachectl -S | grep -E "port|vhost"124- httpd -t -D DUMP_MODULES | grep ssl125126### vhost-and-auth127Configure virtual hosts and protect directories with htpasswd.128129**Parameters:**130- `file` (string): htpasswd file path131- `user` (string): Username to add/remove132- `bcrypt` (boolean): -B enables bcrypt hashing133134**Commands:**135- `htpasswd -c /etc/httpd/conf/.htpasswd alice`136- `htpasswd -b /etc/httpd/conf/.htpasswd bob bobpass`137- `htpasswd -D /etc/httpd/conf/.htpasswd bob`138- `htpasswd -nB alice`139- `curl -u alice:pass -I http://localhost/private/`140141**Examples:**142- htpasswd -c .htpasswd admin && apachectl -t && apachectl graceful143- curl -I -u alice:secret http://localhost/private/144- htpasswd -bB /etc/httpd/conf/.htpasswd deploy deploypass145146## References147- [Apache httpd Docs](https://httpd.apache.org/docs/2.4/)148- [htpasswd](https://httpd.apache.org/docs/2.4/programs/htpasswd.html)149- [Apache Invocation](https://httpd.apache.org/docs/2.4/invoking.html)