nginx-apache-site
v1.0.1
Published
Create Apache or Nginx website configs and optional Certbot SSL certificates on Ubuntu.
Maintainers
Readme
nginx-apache-site
nginx-apache-site is a merged replacement for create-apache-site and
create-nginx-site.
It creates:
- Website directory and starter static files in
/var/www/<domain>/public_html - Apache or Nginx virtual host config
- Optional Certbot SSL certificate
The package also ships compatibility wrappers:
create-apache-sitecreate-nginx-site
Install
npm install -g nginx-apache-siteUsage
Unified command:
nginx-apache-site --domain example.com --server nginx
nginx-apache-site --domain example.com --server apache
nginx-apache-site --domain example.com --server auto
nginx-apache-site --domain example.comIf --server is omitted, the CLI prompts on interactive terminals with default
auto. In non-interactive runs, it defaults to auto directly.
Compatibility wrappers:
create-apache-site --domain example.com
create-nginx-site --domain example.comSSL options
--sslalways run Certbot--no-sslskip Certbot- no SSL flag: interactive prompt when running in a terminal
Extra Certbot controls:
--certbot-email [email protected]--certbot-staging--yesauto-confirm SSL prompt
Common examples
# Nginx with SSL and Certbot email
nginx-apache-site -d example.com -s nginx --ssl --certbot-email [email protected]
# Apache without SSL
nginx-apache-site -d example.com -s apache --no-ssl
# Preview actions only
nginx-apache-site -d example.com -s nginx --ssl --dry-runRequirements
- Ubuntu/Debian-style Apache or Nginx layout
- Root privileges (
sudo) for non-dry-run mode - Certbot plugin for your server type if using SSL
Development tests
npm test
npm run test:linuxnpm test runs local shell tests with mocked system commands, so it does not
modify your host web server setup.
npm run test:linux adds Linux-specific smoke checks. CI runs both test suites
on ubuntu-latest for every push and pull request.
