Table of Contents
前置条件
基本流程
程序和日志目录
下载并解压 WordPress
建立 WordPress 需要的 MySQL 数据库,数据库账户和口令
为 WordPress 配置 Apache 虚拟目录
通过 Web 进行安装
常见问题
Home Database Mysql Tutorial 如何在 Linode 的 CentOS 6 上部署 WordPress 应用?

如何在 Linode 的 CentOS 6 上部署 WordPress 应用?

Jun 07, 2016 pm 04:34 PM
centos wordpress deploy

前置条件 假设您已经安装好了 Apache Web Server,MySql 数据库和 PHP 环境;如果还没有安装好的话,请参见下面的文档:http://library.linode.com/lamp-guides/centos-6 基本流程 我们把 /srv/www 作为我们公共的 web 程序的目录,如果还不存在的话请先建立

前置条件

假设您已经安装好了 Apache Web Server,MySql 数据库和 PHP 环境;如果还没有安装好的话,请参见下面的文档:http://library.linode.com/lamp-guides/centos-6

基本流程

我们把 /srv/www 作为我们公共的 web 程序的目录,如果还不存在的话请先建立。
首先在 /srv/www 下面建立我们站点的目录,例如 chinese.guru001.com

cd /srv/www
mkdir chinese.guru001.com
Copy after login

程序和日志目录

然后在 chinese.guru001.com 下面建立两个目录:public_html 目录用于放置 web 程序,logs 目录用于存放日志文件(后面会在 apache 虚拟目录中进行配置)。

cd chinese.guru001.com
mkdir public_html
mkdir logs
Copy after login

修改 public_html 目录权限:

chmod 777 /srv/www/chinese.guru001.com/public_html
Copy after login

下载并解压 WordPress

cn.wordpress.org 下载最新的 WordPress 程序(这里是:http://cn.wordpress.org/wordpress-3.5-zh_CN.tar.gz),然后解压到 public_html 目录中。

wget http://cn.wordpress.org/wordpress-3.5-zh_CN.tar.gz
tar zxvf wordpress-3.5-zh_CN.tar.gz
Copy after login

现在 WordPress 已经被解压到 public_html 下面的 wordpress 目录了。
把刚才下载的文件删掉

rm wordpress-3.5-zh_CN.tar.gz
Copy after login

建立 WordPress 需要的 MySQL 数据库,数据库账户和口令

建立我们要用到的 MySql 数据库,建立 MySql 账户

mysql_secure_installation
create database guruchinese;
grant all on guruchinese.* to 'yourusername' identified by 'yourpassword';
Copy after login

为 WordPress 配置 Apache 虚拟目录

配置 Apache 虚拟目录:

cd /etc/httpd/conf.d
Copy after login

su 成 root 之后修改虚拟主机配置文件

vi vhost.conf
Copy after login
<virtualhost>
ServerAdmin princetoad@126.com
ServerName chinese.guru001.com
ServerAlias chinese.guru001.com
DocumentRoot /srv/www/chinese.guru001.com/public_html/wordpress
<directory>
AllowOverride All
</directory>
ErrorLog /srv/www/chinese.guru001.com/logs/error.log
CustomLog /srv/www/chinese.guru001.com/logs/access.log combined
</virtualhost>
Copy after login

注:AllowOverride All 是为了启用 WordPress 的 URL 重写的。

退出编辑,然后重启 apache

/etc/init.d/httpd restart
Copy after login

通过 Web 进行安装

在浏览器中输入你的域名,让 WordPress 自动创建一个配置文件,输入相应的数据库信息,进行安装即可。

常见问题

安装插件和主题需要 ftp 账户,在 wp-config.php 最后加入下面内容(如果还没有安装 ftp 服务器的话,请先安装)

define('FS_CHMOD_FILE', 0755);
define('FS_CHMOD_DIR', 0755);
define('FTP_METHOD', 'ftpext');
define('FTP_BASE', '/srv/www/chinese.guru001.com/public_html/wordpress/');
define('FTP_HOST', 'tomcentos01');
define('FTP_CONTENT_DIR', '/srv/www/chinese.guru001.com/public_html/wordpress/wp-content/');
define('FTP_USER', 'your_ftp_username');
define('FTP_PASS', 'your_ftp_password');
define('FTP_SSL', false);
Copy after login

如果碰到提示 upload 目录权限不够的话,chmod 777 相应的目录即可。

有什么问题欢迎讨论!

原文地址:http://www.tfan.org/wordpress-on-linode-centos-6/

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP vs. Flutter: The best choice for mobile development PHP vs. Flutter: The best choice for mobile development May 06, 2024 pm 10:45 PM

PHP and Flutter are popular technologies for mobile development. Flutter excels in cross-platform capabilities, performance and user interface, and is suitable for applications that require high performance, cross-platform and customized UI. PHP is suitable for server-side applications with lower performance and not cross-platform.

SCP usage tips-recursively exclude files SCP usage tips-recursively exclude files Apr 22, 2024 am 09:04 AM

One can use the scp command to securely copy files between network hosts. It uses ssh for data transfer and authentication. Typical syntax is: scpfile1user@host:/path/to/dest/scp -r/path/to/source/user@host:/path/to/dest/scp exclude files I don't think you can when using scp command Filter or exclude files. However, there is a good workaround to exclude the file and copy it securely using ssh. This page explains how to filter or exclude files when copying directories recursively using scp. How to use rsync command to exclude files The syntax is: rsyncav-essh-

In which folder are wordpress articles located? In which folder are wordpress articles located? Apr 16, 2024 am 10:29 AM

WordPress posts are stored in the /wp-content/uploads folder. This folder uses subfolders to categorize different types of uploads, including articles organized by year, month, and article ID. Article files are stored in plain text format (.txt), and the filename usually includes its ID and title.

Yolov10: Detailed explanation, deployment and application all in one place! Yolov10: Detailed explanation, deployment and application all in one place! Jun 07, 2024 pm 12:05 PM

1. Introduction Over the past few years, YOLOs have become the dominant paradigm in the field of real-time object detection due to its effective balance between computational cost and detection performance. Researchers have explored YOLO's architectural design, optimization goals, data expansion strategies, etc., and have made significant progress. At the same time, relying on non-maximum suppression (NMS) for post-processing hinders end-to-end deployment of YOLO and adversely affects inference latency. In YOLOs, the design of various components lacks comprehensive and thorough inspection, resulting in significant computational redundancy and limiting the capabilities of the model. It offers suboptimal efficiency, and relatively large potential for performance improvement. In this work, the goal is to further improve the performance efficiency boundary of YOLO from both post-processing and model architecture. to this end

Where is the wordpress template file? Where is the wordpress template file? Apr 16, 2024 am 11:00 AM

WordPress template files are located in the /wp-content/themes/[theme name]/ directory. They are used to determine the appearance and functionality of the website, including header (header.php), footer (footer.php), main template (index.php), single article (single.php), page (page.php), Archive (archive.php), category (category.php), tag (tag.php), search (search.php) and 404 error page (404.php). By editing and modifying these files, you can customize the appearance of your WordPress website

Which version of wordpress is stable? Which version of wordpress is stable? Apr 16, 2024 am 10:54 AM

The most stable WordPress version is the latest version because it contains the latest security patches, performance enhancements, and introduces new features and improvements. In order to update to the latest version, log into your WordPress dashboard, go to the Updates page and click Update Now.

Does wordpress need to be registered? Does wordpress need to be registered? Apr 16, 2024 pm 12:07 PM

WordPress requires registration. According to my country's "Internet Security Management Measures", websites that provide Internet information services within the country must register with the local provincial Internet Information Office, including WordPress. The registration process includes steps such as selecting a service provider, preparing information, submitting an application, reviewing and publishing, and obtaining a registration number. The benefits of filing include legal compliance, improving credibility, meeting access requirements, ensuring normal access, etc. The filing information must be true and valid, and must be updated regularly after filing.

How to delete theme template in wordpress How to delete theme template in wordpress Apr 16, 2024 am 02:36 AM

To delete a WordPress theme template, first log into your dashboard, then go to Appearance > Theme Editor, select the theme you want to delete, click Delete and confirm, and optionally activate the new theme.

See all articles