With Envoyer you can easily deploy your PHP projects without any downtime. You can connect your Github, BitBucket or any other git source and let Envoyer deploy your application to one or more servers. Although Envoyer is made by Taylor Otwell, the developer who created Laravel, it’s not restricted to Laravel. You can deploy any PHP project and is pretty affordable too.
When Envoyer deploys your project, it works with symlinks. The symlink `current` points to the latest release. It deploys your project in different time-based release folders. After a successful deployment it changes the current public folder. To use Envoyer with cPanel (or any other panel) you need to change to public folder to point to the `current` symlink. Envoyer needs regular SSH access, this can be easily achieved in cPanel itself.
For changing the main/primary domain you will need to have root SSH access.
1. Locate and edit the following file (replacing your user & domain info):
/var/cpanel/userdata/USERNAME/DOMAIN.COM
2. Once you have opened the file, look for the following line:
documentroot: /home/USERNAME/public_html
3. Modify the location according to your needs. Save it and exit.
4. Rebuild the Apache conf and restart Apache:
/scripts/rebuildhttpdconf
service httpd restart
The change will be immediate. Simply clear your browser cache and force refresh the page!