terminal-wizard-apache
v1.0.1
Published
Interactive wizard for configuring Apache2 in the terminal
Readme
Terminal Wizard Apache
terminal-wizard-apache is a simple, interactive command-line tool to manage Apache2 configurations. With a user-friendly menu, it helps you create virtual hosts, toggle modules, and control your Apache server—all from the terminal.
Features
- Create virtual hosts with custom domains and document roots.
- Enable or disable virtual hosts with a single selection.
- Edit or view virtual host files in your preferred editor.
- Toggle Apache modules (e.g.,
rewrite,ssl). - Reload, restart, or stop the Apache server.
- Check configuration syntax and list virtual hosts.
- Set your preferred text editor.
Prerequisites
- Apache2 installed on a Debian/Ubuntu-based system.
- Sudo privileges to manage Apache configurations.
Installation
Install globally with npm:
sudo npm install -g terminal-wizard-apacheNote: Requires Node.js and npm. If you don’t have them, download and install from nodejs.org/en/download for your operating system.
Usage
Run the tool:
sudo terminal-wizard-apacheImportant: Use
sudoto allow changes to Apache files and services. Without it, you'll see a reminder to rerun withsudo.
Menu Options
- Create new Virtual Host: Set up a new site.
- Enable/Disable Virtual Host: Toggle sites on/off (enabled sites marked with
*). - Edit Virtual Host: Edit a site’s config file.
- Show Virtual Host: View a site’s config.
- Manage Modules: Turn modules on/off (enabled ones marked with
*). - Restart/Reload/Stop Apache: Control the server.
- Check Configuration: Verify syntax and list sites.
- Configure Text Editor: Pick your editor (saved for future use).
- Exit: Close the tool.
Examples
Creating a Virtual Host
- Choose "Create new Virtual Host".
- Enter a domain (e.g.,
mysite.com). - Add an alias if needed (e.g.,
www.mysite.com). - Set the document root (e.g.,
/var/www/mysite). - The tool creates and enables it automatically.
Toggling a Virtual Host
- Select "Enable/Disable Virtual Host".
- Pick a site (e.g.,
* mysite.comfor enabled,othersite.comfor disabled). - Confirm to toggle its status.
Configuration
Your text editor preference (e.g., nano, vim) is saved to ~/.terminal-wizard-apache.json the first time you edit a file or via "Configure Text Editor".
Troubleshooting
- Command not found? Ensure it’s installed globally (
npm linkif testing locally). - Permission errors? Always run with
sudo.
Contributing
Found a bug or have an idea? Open an issue or submit a pull request at GitHub.
License
MIT License. Free to use and modify. See LICENSE for details.
Author
- Marcelo XP - GitHub
