LeafCMS GitHub Install
Docs

The in-app guide

This is the same guide as Admin → Help: usage, each admin screen, themes, tags, Baota, environment, and install.

How to set up Baota

You do not need shell commands. The names on the left match the panel, and the red ring is what you click. A different skin is fine. Follow the words.

  1. Step 1 — Install PHP 8.4

    On the left, open App Store and search for PHP. Use the PHP-8.4 row. If the button still says Install, click it. Settings and Uninstall mean it is already installed. Then set the site PHP version to 8.4.

    Install PHP 8.4 from App Store

    The red ring is Install on the PHP-8.4 row. Do not use the grey row as the site PHP. After install, open Settings, then Disabled functions, and remove putenv, proc_open, shell_exec, exec, symlink, and popen. The install page lists any names that are still blocked.

  2. Step 2 — Set the run directory to /public

    On the left, open Website, click your domain, then Site directory under Settings. Leave Site directory at the project root, for example /www/wwwroot/your-domain. Change Run directory from / to /public and save. If there is no Run directory, change the site directory itself so it ends in /public. Otherwise the homepage is a blank 404, and the note in the project root says where to click.

    Site directory set to public

    Keep the site directory at the project root. The red row is the old run directory. Save the green /public.

  3. Step 3 — Paste the rewrite rule

    In the same settings window, click Rewrite in the red box. The white box is empty. Paste the whole block below and click the green Save. Leave Current as it is. Without this, every URL except the homepage fails.

    location / {
        try_files /html/site_1$uri/index.html /html/site_1$uri $uri $uri/ /index.php?$query_string;
    }

    Static pages are written under /html/site_1.

    Paste the rewrite rule into the white box and save

    The red boxes are Rewrite, the empty rule box, and the green Save. Paste into the white box only.

  4. Step 4 — Let two folders be written

    On the left, open Files and the site directory. You should see public and storage. Select the bootstrap and storage folders. At the top right, open More, then Permission. Keep the owner as www, check Apply to subdirectories, and click the green Confirm. Leave the three permission columns as they are. Otherwise the install page will not open.

    Select bootstrap and storage, then Permission under More Keep owner www, apply to subdirectories, then confirm

    Change only these two folders. Do not give www the whole disk.

  5. Step 5 — Open the install page in a browser

    In the address bar, open your domain and add /install. The page has three steps: environment, database, and administrator. For a trial, choose the file database. For a real site, choose MySQL and create an empty database under Database on the left first.

    Browser
    http://your-domain/install Type the address like this
    Step 1Environment check
    Step 2Database
    Step 3Administrator

    Once the site is on your domain, do not also run php artisan serve.

  6. Step 6 — Cron, once a minute

    At the bottom left, click Cron in the red box, then the green Add task. Keep the type as Shell script. Name the task Site cron. Do not leave the period on Daily. Change it to N minutes and set the number to 1. Paste only the line below into the script box. Do not add stars, and do not use php-fpm. Then click the green Confirm. Without this task, scheduled collect and cache cleanup never run on their own.

    /www/server/php/84/bin/php /www/wwwroot/leafcms.top/artisan schedule:run >> /dev/null 2>&1
    Click Cron on the left, then Add task Set the cron to every minute and paste the command

    The command must contain bin/php. If you see php-fpm, switch it to bin/php before adding the task.

Image preview

Group @sanpang