Installing and Configuring WordPress in a ServBay Environment
What is WordPress?
WordPress is an open-source content management system (CMS) built using PHP and MySQL. It is the world's most popular blogging and website-building platform, with a rich ecosystem of plugins and themes to meet various website development needs.
Steps to Install WordPress
In this article, we will explain how to install and configure WordPress in a ServBay environment.
Step 1: Download and Extract WordPress
Download WordPress
bashcd /Applications/ServBay/www curl https://wordpress.org/latest.tar.gz -o wordpress.tar.gz
1
2Extract WordPress
Extract the downloaded WordPress archive to the
www
directory of ServBay:bashmkdir servbay-wordpress-app tar zxf wordpress.tar.gz --strip-components 1 -C servbay-wordpress-app
1
2
Step 2: Create Database and User
Access ServBay's Built-in phpMyAdmin Database Management Tool
Open https://servbay.host/, click "phpMyAdmin" to enter the phpMyAdmin database management tool.
Create Database
Create a new database in phpMyAdmin by following these steps:
Log in to phpMyAdmin
Log in to phpMyAdmin with your database username and password.
Create Database
- On the main page of phpMyAdmin, click "New" in the left menu.
- Enter
servbay_wordpress_db
in the "Database name" field. - Select the character set as
utf8mb4
and collation asutf8mb4_unicode_ci
. - Click the "Create" button.
Create Database User
Go to User Accounts Page
- On the main page of phpMyAdmin, click "User accounts" in the top menu.
Add New User
- Click "Add user account".
- Fill in the following information:
- Username:
wordpress_user
- Host:
localhost
- Password: Enter a secure password, e.g.,
password123
- Re-type password: Re-enter the password
- Username:
- Make sure to check "Grant all privileges".
- Click the "Go" button.
Grant User Privileges
- On the main page of phpMyAdmin, click the "Database" tab and select
servbay_wordpress_db
. - Click the "Privileges" tab in the top menu.
- Click "Add user account".
- In the "User account" section, select the newly created
wordpress_user
. - In the "Database-specific privileges" section, check all privileges.
- Click the "Go" button.
- On the main page of phpMyAdmin, click the "Database" tab and select
Step 3: Configure Web Server
Add New Site
Open ServBay, click the "Host" tab, and add a new site:
- Name:
My WordPress Site
- Domain:
servbay-wordpress.local
- Site Type:
PHP
- PHP Version: Choose the corresponding PHP version
- Site Root Directory:
/Applications/ServBay/www/servbay-wordpress-app
- Name:
Save Configuration
Save the configuration.
Step 4: Complete Installation
Access Installation Page
Open your browser and navigate to
https://servbay-wordpress.local
, and you will see the WordPress installation page.Fill in Database Information
Follow the prompts to fill in the database connection information:
- Database Name:
servbay_wordpress_db
- Username:
wordpress_user
- Password:
password123
- Database Host:
localhost
- Table Prefix:
wp_
(can be modified if needed)
- Database Name:
Fill in Site Information
Follow the prompts to fill in the site information, including the site title, admin username, and password.
Complete Installation
Click the "Install WordPress" button to complete the installation process.
Step 5: Install Themes and Plugins
Install Themes
Log in to the WordPress admin dashboard, click "Appearance" -> "Themes", and choose and install a theme you like.
Install Plugins
Click "Plugins" -> "Add New", search for and install the plugins you need, such as SEO plugins and security plugins.
Using WordPress to Build a Website
Now that you've successfully installed and configured WordPress in the ServBay environment, you can start using it to build your website. Here are some common operations:
Create Pages and Posts
Create Page
In the WordPress admin dashboard, click "Pages" -> "Add New", fill in the page title and content, and then click "Publish".
Create Post
Click "Posts" -> "Add New", fill in the post title and content, choose categories and tags, and then click "Publish".
Configure Navigation Menu
Create Menu
Click "Appearance" -> "Menus", and create a new navigation menu.
Add Menu Items
Add pages, posts, categories, etc., to the navigation menu, and then click "Save Menu".
Customize Widgets
Add Widgets
Click "Appearance" -> "Widgets", and drag the widgets you need to the sidebar or other widget areas.
Configure Widgets
Configure the widget settings as needed, and then click "Save".
Following these steps, you have successfully installed and configured WordPress in a ServBay environment and started using it to build your website. WordPress's powerful features and rich ecosystem make it an ideal choice for building various types of websites.