Przejdź do treści
Biblioteka skilli
DevOps i chmura · Budowanie i kod

apache

/apache

Wspiera konfigurację serwera Apache HTTP: hosty wirtualne, mod_rewrite, reverse proxy, SSL/TLS i .htaccess.

Repozytorium
Agent-Skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
01.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
5
Przestarzałość

Brak sygnałów. Repozytorium zmienione 01.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wspiera konfigurację serwera Apache HTTP: hosty wirtualne, mod_rewrite, reverse proxy, SSL/TLS i .htaccess.

Oryginalny opis (EN)

Expert Apache HTTP Server assistance covering virtual hosts, mod_rewrite, reverse proxying, SSL/TLS, and .htaccess. Use when configuring Apache web servers, URL redirection, or legacy web hosts.

Jak działa

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Sekcje z nagłówków SKILL.md, w oryginale · 153 linii, 545 słów
Podgląd SKILL.md
---
name: apache
description: Expert Apache HTTP Server assistance covering virtual hosts, mod_rewrite, reverse proxying, SSL/TLS, and .htaccess. Use when configuring Apache web servers, URL redirection, or legacy web hosts.
---

# Apache HTTP Server (httpd)

Apache HTTP Server is a battle-tested, modular web server offering extensive configuration flexibility via `.htaccess`, dynamic module loading, and reliable reverse-proxy capabilities.

## When to Use

- **Enterprise HTTP Reverse Proxy & Web Serving**: Serving dynamic applications and static assets with Apache HTTP Server (httpd).
- **PHP & Mod_Security WAF Deployments**: Deploying PHP applications (WordPress, Drupal) and Web Application Firewalls (OWASP CRS).
- **Fine-Grained Access Control & .htaccess**: Delegating directory-level access rules and rewrites to non-root developers.
- **Complex URL Rewriting & Reverse Proxying**: Utilizing `mod_rewrite` and `mod_proxy` for intricate request routing.

## Quick Start

```apache
<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/html

    <Directory /var/www/html>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/example_error.log
    CustomLog ${APACHE_LOG_DIR}/example_access.log combined
</VirtualHost>
```

## Core Concepts

### VirtualHost Configuration with TLS and HTTP/2

Production VirtualHost configuration with modern TLS parameters:

```apache
<VirtualHost *:443>
    ServerName api.example.com
    ServerAdmin sysadmin@example.com
    DocumentRoot /var/www/api/public

    Protocols h2 http/1.1
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/api.example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/api.example.com/privkey.pem

    # Modern TLS Security Headers
    Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
    Header always set X-Frame-Options "DENY"
    Header always set X-Content-Type-Options "nosniff"

    <Directory /var/www/api/public>
        Options -Indexes +FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>

    CustomLog /var/log/apache2/api_access.log combined
    ErrorLog /var/log/apache2/api_error.log
</VirtualHost>
```

### Reverse Proxy with mod_proxy & Load Balancing

Forwarding traffic to backend microservices with health checks:

```apache
<Proxy balancer://appcluster>
    BalancerMember http://10.0.1.10:3000 route=node1 retry=10
    BalancerMember http://10.0.1.11:3000 route=node2 retry=10
    ProxySet lbmethod=byrequests
</Proxy>

<Location /api>
    ProxyPass balancer://appcluster/api
    ProxyPassReverse balancer://appcluster/api
    ProxyPreserveHost On
    RequestHeader set X-Forwarded-Proto "https"
</Location>
```

### URL Rewriting with mod_rewrite

Handling Single Page Application routing:

```apache
<Directory /var/www/spa/dist>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.html$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.html [L]
</Directory>
```

## Common Patterns

### Reverse Proxy with SSL Termination and WebSocket Upgrade

**Problem**: Forwarding external HTTPS traffic to an internal Node/Go service while supporting WebSockets.

**Solution**:
Enable `proxy` and `proxy_wstunnel` modules:

```apache
<VirtualHost *:443>
    ServerName api.example.com
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/api.crt
    SSLCertificateKeyFile /etc/ssl/private/api.key

    # WebSocket forwarding
    RewriteEngine on
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "ws://127.0.0.1:3000/$1" [P,L]

    # HTTP API proxying
    ProxyPass / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/
</VirtualHost>
```

## Best Practices

**Do**:

- Disable `AllowOverride All` in production to prevent performance hits from filesystem `.htaccess` lookups.
- Enable `Protocols h2 http/1.1` to take advantage of HTTP/2 multiplexing.
- Hide server signatures by setting `ServerTokens Prod` and `ServerSignature Off`.
- Test configuration syntax with `apachectl configtest` before reloading the service.

**Don't**:

- Use the prefork MPM for high-concurrency modern workloads; use the `event` MPM (`mpm_event`).
- Leave directory listings enabled (`Options +Indexes`); always use `Options -Indexes`.
- Run Apache as root; ensure worker processes run under dedicated unprivileged users (`www-data`).

## Troubleshooting

| Error                                                              | Cause                                                                   | Solution                                                                           |
| :----------------------------------------------------------------- | :---------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
| `AH00072: make_sock: could not bind to address [::]:80`            | Port 80 occupied by Nginx, another Apache, or Docker container.         | Kill conflicting process: `sudo fuser -k 80/tcp`.                                  |
| `403 Forbidden: You don't have permission to access this resource` | Directory permissions too restrictive or missing `Require all granted`. | Check filesystem ownership (`chown -R www-data:www-data`) and `<Directory>` block. |
| `Invalid command 'RewriteEngine'`                                  | `mod_rewrite` module not enabled.                                       | Run `sudo a2enmod rewrite && sudo systemctl restart apache2`.                      |

## References

- [Apache HTTP Server Documentation](https://httpd.apache.org/docs/2.4/)

Wersje

W bazie nie ma innych skilli o nazwie apache.

Migawka bazy z 13.11.2026 · wersja paczki 1fd36e6223c8 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100nginx
    Wspiera pracę z serwerem Nginx: reverse proxy, równoważenie obciążenia, cache, SSL/TLS i HTTP/2/3 dla serwerów o wysokiej współbieżności i bramek API.
  • 95ubuntu-web-servers
    Konfiguruje serwery WWW na Ubuntu 24.04: Nginx, Apache i Caddy, certyfikaty z Let's Encrypt, reverse proxy i nagłówki bezpieczeństwa.
  • 91rhel-web-servers
    Konfiguruje serwery WWW na RHEL 9 i pochodnych: Nginx, Apache, Caddy, certyfikaty TLS, reverse proxy i reguły SELinux dla usług webowych.
  • 100nginx-expert
    Wspiera konfigurację Nginx, reverse proxy, równoważenie obciążenia, SSL/TLS, cache i strojenie wydajności.
  • 95nginx
    Konfiguruje Nginx jako reverse proxy i serwer WWW: terminację HTTPS/TLS, hosty wirtualne, load balancing, rate limiting, kompresję gzip, cache oraz nagłówki bezpieczeństwa takie jak HSTS i CSP.
  • 100nginx
    Pomaga konfigurować Nginx jako serwer WWW, reverse proxy i load balancer: pliki statyczne, TLS, cache, rate limiting i nagłówki bezpieczeństwa.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.