Install and Configure OctoberCMS in the ServBay Environment
What is OctoberCMS?
OctoberCMS is an open-source content management system (CMS) based on the Laravel framework. It provides powerful features and flexible scalability, suitable for building various types of websites. OctoberCMS is renowned for its simple user interface and developer-friendly features.
Steps to Install OctoberCMS
In this article, we will introduce how to install and configure OctoberCMS in the ServBay environment.
Step 1: Create a Project Directory
First, create a new project directory in the www
directory of ServBay:
cd /Applications/ServBay/www
mkdir servbay-octobercms-app
cd servbay-octobercms-app
2
3
Step 2: Install OctoberCMS Using Composer
Since ServBay comes with Composer, we can use Composer to install OctoberCMS directly:
composer create-project october/october .
Step 3: Create Database and User
Access the phpMyAdmin Database Management Tool Provided by ServBay
Open https://servbay.host/, click "phpMyAdmin" to enter the phpMyAdmin database management tool.
Create a Database User
Enter the User Accounts Page
- On the main page of phpMyAdmin, click "User Accounts" in the top menu.
Add a New User
- Click "Add User Account".
- Fill in the following information:
- Username:
october_user
- Hostname:
localhost
- Password: Enter a secure password, e.g.,
password123
- Re-enter: Enter the password again
- Username:
- In the "Database for user" section, choose "Create database with same name and grant all privileges".
- Ensure "Grant all privileges" is checked.
- Click the "Go" button.
Step 4: Configure the Web Server
Add a New Website
Open ServBay, click on the "Host" tab, and add a new website:
- Name:
My OctoberCMS Site
- Domain:
servbay-octobercms.local
- Website Type:
PHP
- PHP Version: Choose the appropriate PHP version
- Root Directory:
/Applications/ServBay/www/servbay-octobercms-app
- Name:
Save Configuration
Save the configuration and restart ServBay.
Step 5: Configure OctoberCMS
Edit Environment Configuration File
In the project root directory, copy the
.env.example
file to.env
:bashcp .env.example .env
1Edit the
.env
FileOpen the
.env
file with a text editor and configure the database connection information and other necessary settings:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=october_user DB_USERNAME=october_user DB_PASSWORD=password123
1
2
3
4
5
6
Step 6: Run the OctoberCMS Installer
Access the Installation Page
Open your browser and visit
https://servbay-octobercms.local/install.php
, you will see the OctoberCMS installation page.Fill in Database Information
Follow the prompts on the page to fill in the database connection information:
- Database Type:
MySQL
- Database Host:
localhost
- Database Name:
october_user
(same as the username) - Database Username:
october_user
- Database Password:
password123
- Database Type:
Fill in Admin Information
Follow the prompts on the page to fill in the admin username and password information.
Complete Installation
Click the "Install" button to complete the installation process.
Step 7: Install Plugins and Themes
Install Plugins
Log into the OctoberCMS admin backend, click "Plugins", search for and install the plugins you need.
Install Themes
Click "Appearance" -> "Themes", select and install a theme you like.
Building a Website with OctoberCMS
Now that you have successfully installed and configured OctoberCMS in the ServBay environment, you can start using it to build your website. Here are some common operations:
Create Pages and Content
Create Pages
In the OctoberCMS admin backend, click "CMS" -> "Pages", create a new page, fill in the page title and content, then click "Save".
Create Content Blocks
Click "CMS" -> "Content", create a new content block, fill in the content title and content, then click "Save".
Configure Navigation Menu
Create Menu
In the OctoberCMS admin backend, click "CMS" -> "Partials", create a new partial for the navigation menu.
Add Menu Items
Add the pages and content blocks to the navigation menu, then click "Save".
Customize Widgets
Add Widgets
In the OctoberCMS admin backend, click "CMS" -> "Partials", create a new partial for widgets.
Configure Widgets
Configure the widget settings as needed, then click "Save".
By following the above steps, you have successfully installed and configured OctoberCMS in the ServBay environment and started using it to build your website. The powerful features and flexibility of OctoberCMS make it an ideal choice for building various types of websites.