Jason CMS
2026-11-09 00:00:00 UTC
Jason CMS
A small, self-hosted CMS for people who want a real site without a real circus.
Jason CMS is a lightweight PHP CMS that stores content in plain JSON. Posts and pages, search, pagination, plugins, and a simple admin—no database to babysit, no framework to fight. Open your data in a text editor. Back it up by copying a folder. Built for single-owner sites that should stay fast, clear, and under your control.
Jason CMS is intentionally small. It doesn't try to be WordPress, and it doesn't need a database, a build pipeline, a collection of external services, or a subscription. It's designed to do a handful of things well and leave the rest to you.
Requirements: PHP 8.5+ with the extensions required by the enabled features. Apache or LiteSpeed recommended for .htaccess rules. Optional: APCu for in-memory caching of the JSON store.
Who it's for
- Developers and tinkerers who prefer files over dashboards
- Writers and makers who want a personal site, documentation site, or small blog
- Self-hosters on ordinary LAMP / LiteSpeed hosting who want something they can understand
Not aimed at: multi-author editorial workflows, complex roles and permissions, or sites that have outgrown "edit, publish, done."
Design philosophy
- No database server — content lives in ordinary JSON files.
- No framework dependencies — straightforward PHP, without an elaborate application stack.
- No build process — upload the files and run.
- No external services required — your site and content remain under your control.
- Human-readable storage — inspect, edit, and back up your content with ordinary tools.
- Minimal overhead — features should justify their complexity.
- Ownership and portability — your files, your hosting, your decisions.
Features
- Posts and pages — pages stay out of the Latest posts list.
- JSON storage — human-readable files you can edit, diff, and back up.
- Stable URLs — public links use post ID (
?p=<id>); renaming a title doesn't break links; old slug URLs redirect with HTTP 301 to the ID URL. - Search — searches titles, excerpts, and stripped content (
?q=term). - Pagination — Latest posts, search results, and pages list.
- Plugins — drop-in folders with actions and filters.
- Optional APCu caching — keeps decoded posts in shared memory; refreshed on save.
- Templates — customizable head, header, and footer templates in
jason-cms/templates/.
Layout
/
├── public_html/ # web root: the only public directory
│ ├── index.php # public site
│ ├── init.php # locates and loads jason-cms/
│ ├── admin/ # admin.php, uploads.php (optional Basic Auth: htaccess.txt)
│ ├── assets/ # public CSS and JS
│ ├── uploads/ # uploaded images/videos (script execution disabled)
│ └── vendor/ # PHPMailer
└── jason-cms/ # private, outside the web root
├── config.php
├── data/ # posts.json, links.txt (writable by PHP)
├── logs/ # error.log (writable by PHP)
├── templates/
├── plugins/ # server-side only
└── *.php # functions, hooks, uploads, Parsedown
Everything except public_html/ is outside the web root, so no deny rules are needed for the private application files. data/ and logs/ must be writable by PHP.
Installation
- Upload the contents of
public_html/to your hosting account's document root. - Upload
jason-cms/alongside the document root directory, outside the web root. - Edit
jason-cms/config.php:- Set
SITE_TITLE. - Set a new
ADMIN_PASSWORD_HASH(see below). - Optionally configure
ENABLED_PLUGINSand APCu options.
- Set
- Ensure the web server can write to
jason-cms/data/andjason-cms/logs/. Appropriate permissions depend on your hosting configuration;750or770may be suitable. - Visit
admin/admin.phpand log in. - Use HTTPS in production.
The public init.php locates and loads the private jason-cms/ directory. Keep the private directory outside the web root.
Generate an admin password hash
Generate a password hash from the command line:
php -r "echo password_hash('YOUR-NEW-PASSWORD', PASSWORD_DEFAULT), PHP_EOL;"
Put the resulting hash in ADMIN_PASSWORD_HASH in jason-cms/config.php.
Change the starter password before putting your site online.
Configuration
Configuration is stored in jason-cms/config.php.
| Constant | Purpose |
|---|---|
SITE_TITLE |
Site name in UI and titles |
POSTS_PER_PAGE |
Page size for lists and search |
DATA_FILE |
Path to posts.json |
ADMIN_PASSWORD_HASH |
Password hash for admin login |
APCU_CACHE_ENABLED |
Use APCu when available |
APCU_CACHE_TTL |
Cache lifetime in seconds (0 = until replaced on save) |
ENABLED_PLUGINS |
List of plugin folder names under plugins/ |
Content model
Each entry in data/posts.json includes roughly:
id, type (post | page), slug, title, excerpt, content, published, date, updated
- Posts appear under Latest posts.
- Pages are published and reachable by URL but omitted from that list. Use
index.php?pages=1to list them.
Post body
The editor stores the body as a string. It may include HTML, CSS, JavaScript, and PHP.
For example:
<h2>A heading</h2>
<p>Today is <?= date('l, F j, Y') ?>.</p>
HTML, CSS, and JavaScript are rendered as page content. PHP is executed server-side when a published entry is viewed.
Only trusted admin content should contain executable PHP. A compromised post can execute arbitrary PHP as the web server user, potentially compromising the entire site.
Public URLs
| URL | Meaning |
|---|---|
index.php |
Latest posts |
index.php?page=2 |
Pagination |
index.php?p=<id> |
Single post or page |
index.php?pages=1 |
All pages |
index.php?q=term |
Search |
Legacy slug URLs still resolve and redirect to the ID form.
Storage and performance
Writes to posts.json use a lock file, a temporary file, and an atomic rename so concurrent admin saves don't clobber each other.
This is designed for a small, single-owner site, not concurrent multi-author editing.
With APCu enabled, decoded post data is served from shared memory when possible and updated after a successful save. If APCu is missing or disabled, Jason CMS falls back to reading the file directly.
Why JSON?
For a lightweight CMS, content you can open in a text editor, back up as files, and move between hosts without a database server is a feature.
JSON storage stays comfortable for personal and small sites. If you later need heavy querying or many concurrent editors, a database becomes the better engine—not before.
Backups
Back up the following regularly:
jason-cms/data/posts.jsonjason-cms/config.phpjason-cms/plugins/jason-cms/templates/public_html/uploads/
These contain the content, configuration, customizations, and uploaded media needed to restore your site, apart from the PHP runtime and any separately installed dependencies.
Plugins
Plugins extend Jason CMS through actions and filters without modifying the core files.
- Create
plugins/<name>/plugin.php. - Add
'<name>'toENABLED_PLUGINSinjason-cms/config.php. - Register hooks only—no output on load.
Actions
| Hook | When |
|---|---|
plugins_loaded |
After enabled plugins load |
init |
Request bootstrap (public and admin) |
header_nav |
Extra markup in the public nav |
footer |
Extra markup in the public footer |
admin_menu |
Extra controls on the admin list screen |
admin_save_post |
After save (array $post, bool $isNew) |
admin_delete_post |
After delete (string $id) |
Filters
| Hook | Role |
|---|---|
posts_loaded |
Full posts array after load |
post_content |
Body before render (string $html, array $post) |
See plugins/README.md and the sample plugins/hello-world/ plugin for examples.
Security
Jason CMS is designed to keep application files and content outside the public web root wherever possible.
- Change the admin password hash before production use.
- Use HTTPS for the admin and public site.
- Keep
jason-cms/outside the web root. Do not expose configuration, data, logs, or server-side plugins through the web server. - Protect writable directories. Only the directories that need write access should be writable by PHP.
- Disable script execution in
uploads/. Uploaded files should be served as media, not executed as PHP or other server-side scripts. Web server configuration varies, so verify that this protection is effective on your host. - Don't deny access to public assets. Do not put
Require all deniedonassets/—browsers must be able to load CSS, JavaScript, and images. - Treat PHP in posts as executable code. Only trusted administrators should be able to create or edit published content containing PHP.
If you enable additional plugins, review their code and permissions. Plugins execute server-side and should be treated as trusted application code.
Templates
Public site chrome lives in:
jason-cms/templates/head.phpjason-cms/templates/header.phpjason-cms/templates/footer.php
index.php sets $pageTitle / $query and includes these through render_header() / render_footer().
Modify these templates to customize the public site's appearance without changing the core application logic.
License
Jason CMS is released under the MIT License.
You are free to use, modify, distribute, and adapt it, subject to the terms of the license. See the included LICENSE file for the full license text.