fattain-naime/cwp-superpowers/cwp-webserver

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

This skill should be used when the user asks to "configure Apache", "configure Nginx", "set up Varnish", "switch web server stack", "edit vhost template", "rebuild vhosts", "fix web server errors", "configure SSL for web server", "set up reverse proxy", "enable Brotli compression", "fix 502 bad gateway", "fix redirect loop", "manage web server modules", or needs to manage any CWP web server stack component.

Install

npx vskill@latest install fattain-naime/cwp-superpowers/cwp-webserver

SKILL.md

CWP Web Server Management

Manage Apache, Nginx, Varnish, and LiteSpeed web server configurations within CWP. Handle vhost templates, module management, reverse proxy setups, and common web server issues.

Overview

Choose from multiple web server stacks. The selected stack determines how requests are processed and which configuration files to edit.

StackDescriptionUse Case
Apache + PHP-FPMStandard configurationGeneral hosting
Nginx + PHP-FPMHigh-performanceStatic-heavy sites
Nginx -> Varnish -> ApacheMaximum performanceHigh-traffic sites
Apache + suPHPLegacy compatibilityLegacy PHP apps
LiteSpeed EnterpriseCommercial optionEnterprise hosting

Service Detection

Detect which web servers are installed:

bash
# Apache
systemctl is-active httpd 2>/dev/null && echo "Apache: active" || echo "Apache: not running"
# Nginx
systemctl is-active nginx 2>/dev/null && echo "Nginx: active" || echo "Nginx: not running"
# Varnish
systemctl is-active varnish 2>/dev/null && echo "Varnish: active" || echo "Varnish: not running"
# LiteSpeed (optional)
systemctl is-active lsws 2>/dev/null && echo "LiteSpeed: active" || echo "LiteSpeed: not installed"

Port Mapping

PortService
80HTTP (Apache or Nginx)
443HTTPS (Apache or Nginx)
82Varnish cache
8181Apache behind Nginx proxy
8080Tomcat (if enabled)

Vhost Templates

Location: /usr/local/cwpsrv/htdocs/resources/conf/web_servers/

DirectoryContents
vhosts/httpd/Apache templates (main, php-fpm, proxy)
vhosts/nginx/Nginx templates (main, php-fpm)
vhosts/varnish/Varnish templates (main only)

Critical: Never edit templates directly -- they are overwritten on CWP updates. Create custom copies with different names.

Template Variables

Templates support these replacement variables:

  • %domain% -- Domain name
  • %ip% -- Server IP address
  • %user% -- Username
  • %docroot% -- Document root path
Rebuilding Vhosts
bash
# Rebuild all vhosts
/scripts/cwp_api webservers rebuild_all
# Rebuild for specific user
/scripts/cwp_api webservers rebuild_user USERNAME
# Rebuild user configs
/scripts/cwpsrv_rebuild_user_conf

Apache Configuration

Main Config Files
FilePurpose
/usr/local/apache/conf/httpd.confMain Apache configuration
/usr/local/apache/conf.d/Module and site configs
/usr/local/apache/conf.d/ssl.confSSL configuration
/usr/local/apache/logs/Apache error/access logs
/usr/local/apache/domlogs/Per-domain access logs
Apache Modules
ModulePurpose
mod_xsendfileX-SENDFILE header processing
mod_cloudflareReal IP from Cloudflare
mod_brotliBrotli compression
mod_pagespeedGoogle page optimization
mod_limitsDDoS protection
mod_suexecCGI scripts run as file owner
mod_cgidCGI script execution
mod_userdirPer-user web directories
Common Apache Operations
bash
# Restart Apache
systemctl restart httpd
# Test configuration
apachectl configtest
# Check loaded modules
apachectl -M
# View error log
tail -f /usr/local/apache/logs/error_log
# View domain log
tail -f /usr/local/apache/domlogs/DOMAIN.log
SSL Configuration

For SSL certificate management, AutoSSL, and TLS hardening, see the cwp-security skill (references/ssl-tls.md).

Improve SSL grade by editing /usr/local/apache/conf.d/ssl.conf:

apache
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder on

Nginx Configuration

Main Config Files
FilePurpose
/etc/nginx/nginx.confMain Nginx configuration
/etc/nginx/conf.d/Additional configs
/etc/nginx/modules/Dynamic modules
Common Nginx Operations
bash
# Restart Nginx
systemctl restart nginx
# Test configuration
nginx -t
# Reload without downtime
nginx -s reload
# Check version and modules
nginx -V
Nginx as Reverse Proxy

When using Nginx -> Apache stack, Nginx handles static files and proxies dynamic requests to Apache on port 8181.

Brotli Compression (Nginx)

For detailed Brotli compression setup and configuration, see the cwp-performance skill (references/compression.md).

bash
cd /etc/nginx/modules
wget http://dl1.centos-webpanel.com/files/nginx/modules/nginx-brotli-modules.zip
unzip nginx-brotli-modules.zip

Varnish Cache

Configuration
FilePurpose
/etc/varnish/varnish.paramsVarnish parameters
/etc/varnish/default.vclVCL configuration
Common Varnish Operations
bash
# Clear Varnish cache
/scripts/varnish_clear_cache
# Restart Varnish
systemctl restart varnish
# Check Varnish stats
varnishstat
# Check VCL syntax
varnishd -C -f /etc/varnish/default.vcl
Varnish Port Configuration

Varnish port varies by CWP version (80 or 82). Detect the actual port:

bash
# Detect Varnish listening port
VARNISH_PORT=$(ss -tlnp | grep varnish | grep -oP ':\K\d+' | head -1)
echo "Varnish port: ${VARNISH_PORT:-unknown}"
# Or check configuration
grep VARNISH_LISTEN_PORT /etc/varnish/varnish.params 2>/dev/null || \
grep listen /etc/varnish/varnish.params 2>/dev/null

Common Varnish ports:

  • Port 82 -- Most common in newer CWP versions
  • Port 80 -- Some older configurations

Configure in /etc/varnish/varnish.params:

VARNISH_LISTEN_PORT=82
Varnish Backend Configuration

Backend port also varies. Check actual configuration:

bash
# Detect Varnish backend port
grep -E '\.port\s*=' /etc/varnish/default.vcl 2>/dev/null

Common backend ports:

  • 8181 -- Apache behind Nginx proxy (newer CWP)
  • 8080 -- Apache behind Nginx proxy (older CWP)

Brotli Compression (Apache)

For detailed Apache Brotli setup, see the cwp-performance skill (references/compression.md).

bash
yum install pcre-devel cmake -y
cd /usr/local/src
git clone https://github.com/google/brotli.git
cd brotli && git checkout v1.0
./configure-cmake && make && make install

Redirect and Proxy Headers

ERR_TOO_MANY_REDIRECTS Fix

When using Nginx -> Varnish -> Apache, add to .htaccess:

apache
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
Cloudflare Real IP

Ensure mod_cloudflare is loaded to see real visitor IPs instead of Cloudflare IPs.

Troubleshooting

IssueSolution
ERR_TOO_MANY_REDIRECTSUse X-Forwarded-Proto header in .htaccess
502 Bad GatewayRestart PHP-FPM, increase process limit
503 Service UnavailableCheck port redirection, PHP-FPM socket
504 Gateway TimeoutRestart Apache/PHP-FPM, increase limits
Apache proxy mutex`ipcs -s \awk -v user=nobody '$3==user {system("ipcrm -s "$2)}'`
Default page for all domainsRebuild vHosts, check shared IP setting
Varnish fails on AlmaLinux 9Manual Varnish installation required
Quick Diagnostic Commands
bash
# Check all web services
systemctl status httpd nginx varnish
# Check listening ports
ss -tlnp | grep -E ':(80|443|82|8181)\s'
# Check for configuration errors
apachectl configtest && nginx -t
# Recent error logs
tail -20 /usr/local/apache/logs/error_log
tail -20 /var/log/nginx/error.log

Additional Resources

  • references/apache.md -- Apache configuration and module details
  • references/nginx.md -- Nginx configuration and reverse proxy setup
  • references/varnish.md -- Varnish cache configuration and VCL
  • references/litespeed.md -- LiteSpeed Enterprise setup

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/fattain-naime/cwp-superpowers/cwp-webserver/badge)](https://verified-skill.com/skills/fattain-naime/cwp-superpowers/cwp-webserver)

Something wrong with this skill or its page? Tell us.