I’ve heard of October CMS a while back and have been wanting to play around with it and see how easily it can be deployed via Cleaver.
Here is my experience in a nutshell -
- Install October CMS on my local
There are several options to install. I just chose the vanilla method
- created new empty directory on my machine
- Ran
curl -s https://octobercms.com/api/installer | php
in the new directory via terminal
- Setup my local database
October lets you connect to a MySQL, Postgress, SQLite, or SQL Server database. Of those options, Cleaver helps facilitate MySQL installations, so I setup a MySQL db. We do plan on supporting Postgress in the near future for Cleaver.
- Create database named ‘october’
- Back in the terminal, go through the October CMS setup process by running the
php artisan october:install
command
This will take you through a setup wizard. Just remember to select the MySQL option and enter the database name you created. Once complete, October will let you know with -
-
Setup your GitHub repo and push master to remote
-
Poke around October a bit on your local
October was created using Laravel and you can obviously see that. I saw on their documentation that you can change from their default file config setup to using standard DotEnv by running thephp artisan october:env
command. Which I did and the .env file was added to my root directory.
Also, you’ll want to find composer.json
file and move it to the root directory. This will be necessary as Cleaver looks for it in the root on deploy.
- In Cleaver, I provisioned a new server with PHP 7.4 and MySQL8.
If you’re curious, here are the server requirements for October
PHP version 7.0.8 or higher
PDO PHP Extension
cURL PHP Extension
OpenSSL PHP Extension
Mbstring PHP Library
ZipArchive PHP Library
GD PHP Library
- While the new server is provisioning, I quickly setup an A record to use
-
Once the server is finished provisioning, I add the database ‘october’
-
And then, create a PHP site assigning the domain I previously created
-
Next, setup a webapp
-
Add the .env variables
-
Add a db migration deployment hook. You’ll want to use Octobers command, which is
php artisan october:up
and then make sure to move the webhook before ‘Activate New Deployment’. Also, enable the deployment hooks for installing composer dependencies and yarn packages for the first deployment. -
Deploy and voila!
You may run into some issues; here are what I’ve experienced:
- For some reason, after I deploy I usually see a key error when I go to the url. There is nothing wrong with the key, I’ve found that just going to the environments tab for the webapp in cleaver, fetching the variables, and then saving usually clears that up. Seems like something funky going on with October CMS.
- For the database migration, if it doesn’t work the first time, try deploying again. i had to deploy twice at one point to clear some things up. If that doesn’t work, you may need to SSH into the server and work through some terminal errors that display
- There was another odd issue when attempting to log in - which was a ‘invalid token’ kept popping up. This is typically a CSRF issue - in which case, there is an environment variable you can set to false -
ENABLE_CSRF=false
. This isn’t the most secure work-around obviously, but from what I saw, this issue has been brought up with October quite a bit and doesn’t “seem” corrected. - Which brings me to another issue, I was expecting to see a login link on the default splash page, but was no where to be seen. But, via Google, if you add
/backend
to your URL, this is the default login. You can change this in