Quickly get Octane running on Laravel Forge
- Spin up a new App server, choose PHP 8
- SSH into it and run
sudo -i
to become root - Run
pecl install swoole
and enable what you need. (I disabled curl as it did not work for me) - Add a new site to your server and use git to pull in your Laravel project that has Octane installed.
- Go to "Network" within the overall server settings
- Add new Firewall rule
- name: Swoole
- port: 9501
- IP: leave empty
- checkmark in Allow
- Point your DNS to your new site
- Enable SSL using Lets Encrypt
- Copy SSL path
- SSH into server and navigate to the public folder of the new site
- run
touch server.php
- insert the content of server.php into it
- update the SSL path and save the file
Now run the server
php server.php
You have Swoole HTTP Server running with SSL support.