Simple PHP CLI for managing document root directories.
This utility allows you to quickly switch the directory being served by your web server. The script simply updates a symbolic link that you configure Apache/NGINX/IIS to serve from.
This is useful for users who do not want to use virtual hosts but wish to serve from multiple directories.
-
Bash shell
-
PHP 5+
-
Download the script
cd /usr/local/bin && curl -O https://raw.githubusercontent.com/kamprath/sites-cli/master/sites
-
Make the script executable
sudo chmod u+x /usr/local/bin/sites
-
Run
sites
from your terminal
The first time thatsites
is run, you will be prompted with configuration. -
Configure your web server to serve from the symlink
Configure your web server's settings to serve from the symbolic link file that was created and restart the web server.
Add a site
To add a site, use sites add <name> <absolute path>
.
Use a site
To switch the active sites being served, use sites use <name>
.
List sites
To list all sites that have been added, simply run sites
.
Show command help
To a list of available command options, run sites help
.