实战!基于lamp安装wordpress详解-技术流ken

 

简介

 

LAMP 是Linux Apache MySQL PHP的简写,其实就是把Apache, MySQL以及PHP安装在Linux系统上,组成一个环境来运行动态的脚本文件。现在基于lamp搭建wordpress.

 

系统环境

 

centos6.7

服务器IP:10.220.5.166/24

 

关闭安全服务

 

[[email protected] ~]# service iptables stop
[[email protected] ~]# setenforce 0

 

下载有关服务程序

 

[[email protected] ~]# yum install httpd mysql-server php php-mysql lrzsz -y

 

配置mysql

 

1.启动数据库

[[email protected] ~]# service mysqld start

2.创建用户

[[email protected] ~]# mysql
...
mysql> create database ken; #创建数据库ken Query OK, 1 row affected (0.00 sec) mysql> grant all on ken.* to ken@"localhost" identified by "123"; #创建用户ken,密码为123 Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; #刷新授权表 Query OK, 0 rows affected (0.00 sec)

 

上传wordpress安装包到网站根目录下

 

[[email protected] ~]# cd /var/www/html
[[email protected] html]# rz z waiting to receive.**B0100000023be50 [[email protected] html]# ls wordpress-3.3.1-zh_CN.zip

 

解压wordpress安装包

 

1.下载用来解压zip包的unzip程序

[[email protected] html]# yum install unzip -y

2. 解压wordpress

[[email protected] html]# unzip wordpress-3.3.1-zh_CN.zip
[[email protected] html]# ls
wordpress  wordpress-3.3.1-zh_CN.zip

 

配置wordpress

 

1.进入刚才解压出来的wordpress目录里面

[[email protected] html]# cd wordpress

 2.生成链接数据库的文件

[[email protected] wordpress]# cp wp-config-sample.php wp-config.php 

 3.配置这个文件

[[email protected] wordpress]# vim wp-config.php
...
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** // /** WordPress 数据库的名称 */ define('DB_NAME', 'ken'); #填写数据库名 /** MySQL 数据库用户名 */ define('DB_USER', 'ken'); #填写数据库用户名 /** MySQL 数据库密码 */ define('DB_PASSWORD', '123'); #数据库密码 /** MySQL 主机 */ define('DB_HOST', 'localhost'); #主机名 ...

 

重启httpd服务

 

[[email protected] wordpress]# service httpd restart

 

浏览器测试

 

电脑浏览器输入10.220.5.166/wordpress/index.php

实战!基于lamp安装wordpress详解-技术流ken

输入用户名和密码

实战!基于lamp安装wordpress详解-技术流ken

登录成功

实战!基于lamp安装wordpress详解-技术流ken