A powerful CLI tool to manage Apache virtual hosts with SSL support for PHP projects, perfect for local development environments.
- 🔒 Automatic SSL certificate generation using mkcert
- 🌐 Easy virtual host configuration
- 🔄 Interactive project management
- 🔍 Fuzzy search project selection
- ⚡ Quick domain setup with .test TLD
- 🛡️ Secure by default with HTTPS
- 📝 Easy hosts file management
- 🎨 Beautiful TUI interface
- Python 3.6+
- Apache HTTP Server
- Root/sudo privileges
- Linux system
-
Clone the repository:
git clone https://github.com/shakilahmed0369/phpvhost cd phpvhost
-
Make the install script executable:
chmod +x install.sh
-
Run the installation script:
sudo ./install.sh
The installer will:
- Install required Python packages
- Install mkcert if not present
- Set up SSL certificates
- Configure the system for virtual host management
- Make the tool globally accessible
Run the tool by typing:
phpvhost
-
Register New Project 📝
- Select a project folder
- Configure entry point (defaults to project's public directory)
- Auto-generates SSL certificates
- Sets up Apache virtual host
- Updates hosts file
-
Manage Projects 📋
- List all configured projects
- View project status
- Remove projects and their configurations
-
System Status ⚙️
- Check Apache service status
- Verify mkcert installation
- Count SSL certificates
- Monitor virtual host configurations
You can also use command line arguments:
phpvhost register # Register a new project
phpvhost remove # Remove an existing project
The tool stores its configuration in ~/.phpvhost_config.json
. The main configurable option is:
base_path
: The base directory where your PHP projects are located
To remove PHP VHost Manager:
sudo ./install.sh uninstall
-
Apache Not Running
- Check Apache status:
sudo systemctl status httpd
- Start Apache:
sudo systemctl start httpd
- Check Apache status:
-
SSL Certificate Issues
- Run
mkcert -install
manually - Check certificate directory:
~/.localhost-ssl
- Run
-
Permission Errors
- Ensure you're running with sudo
- Check Apache logs:
/var/log/httpd/error_log
This project is open-source and available under the MIT License.
Contributions are welcome! Please feel free to submit pull requests.