首先说明我用的是服务器上之前装的mysql数据库,只需要配置上就行了

准备工作

CentOS6.9

在/目录下创建一个目录src,把下载的东西都放到这个文件夹下

下载Apache Httpd,下载地址:

http://httpd.apache.org/download.cgi#apache24

wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.34.tar.gz

下载APR和APR-util

http://apr.apache.org/download.cgi

wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gz

wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz

下载php

http://www.php.net/downloads.php

这个只能先下载到本地,然后上传到服务器上

下载WordPress

https://wordpress.org/download/     英文版

wget https://wordpress.org/latest.tar.gz

https://cn.wordpress.org/download/   中文版

wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz

下载xcache

http://xcache.lighttpd.net/wiki/Release-3.2.0

wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz

开始安装

但是还是要看看自己的yum源是否配了epel源,没有赶快配,因为php里面有个依赖包需要epel源下载,用命令yum repolist

1.安装开发包组

首先我们先安装开发包组,运行命令

yum groupinstall "Development Tools" -y

安装完毕以后

2.安装httpd的依赖包

我们开始安装httpd的依赖包运行命令

yum install pcre-devel  openssl-devel -y

说明已经安装过

3.解压文件并转移,编译并安装httpd

首先先解压apr-1.6.3.tar.gz

tar -zxvf apr-1.6.3.tar.gz

再解压apr-util-1.6.1.tar.gz

tar -zxvf apr-util-1.6.1.tar.gz

最后解压httpd-2.4.34.tar.gz

tar -zxvf httpd-2.4.34.tar.gz

解压完毕后转移文件并重命名

mv apr-1.6.3 httpd-2.4.34/srclib/apr

mv apr-util-1.6.1 httpd-2.4.34/srclib/apr-util

操作完毕以后

cd httpd-2.4.34

开始编译

./configure --prefix=/app/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork

编译成功以后,接下来就是安装了运行make && make install开始安装

make && make install

有可能会出现以下问题

原因是是少了expat库,需要安装该库

yum install expat-devel

安装完expat库以后,需要重新编译

./configure --prefix=/app/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork

然后重新安装

make && make install

安装成功

4.配置环境变量

安装完成以后接下来我们,开始配置环境变量,运行命令:

vim /etc/profile

在最下面加上

#httpd

export PATH=/app/httpd24/bin:$PATH

然后运行

source /etc/profile

5.安装脚本 httpd

开始安装脚本 httpd

yum install httpd -y

切换文件夹

cd /etc/rc.d/init.d/

复制一个httpd,以后用这个24做脚本

cp httpd httpd24

我们还需要修改几项,运行vim httpd24

# Path to the apachectl script, server binary, and short-form for messages.

apachectl=/app/httpd24/bin/apachectl

httpd=${HTTPD-/app/httpd24/bin/apachectl}

prog=httpd

pidfile=${PIDFILE-/app/httpd24/logs/httpd.pid}

lockfile=${LOCKFILE-/var/lock/subsys/httpd}

RETVAL=0

STOP_TIMEOUT=${STOP_TIMEOUT-10}

完成以后我们就可以启动下看看了,运行命令

service httpd24 start

在浏览器访问

如果不成功,则用ss -nutl命令来查看下端口,80端口有没有打开

如果连接不上可能是你的CentOS系统防火墙的问题,必须要关闭掉防火墙

查询防火墙状态:

[root@localhost ~]# service iptables status

停止防火墙:

[root@localhost ~]# service iptables stop

启动防火墙:

[root@localhost ~]# service iptables start

重启防火墙:

[root@localhost ~]# service iptables restart

永久关闭防火墙:

[root@localhost ~]# chkconfig iptables off

永久关闭后启用:

[root@localhost ~]# chkconfig iptables on

6.编译并安装PHP

回到我们的上传目录src

tar -zxvf php-5.6.37.tar.gz

安装依赖包

yum -y install bzip2-devel  libxml2-devel libmcrypt-devel

切换到php下

cd php-5.6.37

注:关于mysql相关的路径根据安装情况填写,可以用find / -name 查找相关mysql的路径

运行命令

./configure --prefix=/app/php --with-mysql=/usr --with-openssl --with-mysqli=/usr/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/app/httpd24/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2

cp -rp /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/libmysqlclient.so

再次编译

./configure --prefix=/app/php --with-mysql=/usr --with-openssl --with-mysqli=/usr/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/app/httpd24/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2

出现上面画面表示编译成功

然后开始安装

make && make install

安装完毕后运行

cp php.ini-production /etc/php.ini

7.修改httpd的配置文件以支持PHP

然后我们开始修改httpd的配置文件,让他支持PHP

vim /app/httpd24/conf/httpd.conf

添加

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

index.php

修改完以后以后重启下httpd24

service httpd24 restart

接下下来我们测试下,用以下命令来创建下

vim /app/httpd24/htdocs/index.php

把下面粘贴进去

<?php
$conn=mysql_connect('localhost','数据库账户','数据库密码');
if($conn)
echo "OK";
else
echo "Not OK";
mysql_close();
phpinfo();
?>

然后我们再次访问

成功!!!

8.安装Wordpress

转移到src下-C代表解压到哪个目录下

tar -zxvf wordpress-4.9.4-zh_CN.tar.gz -C /app/httpd24/htdocs/

然后

cd /app/httpd24/htdocs/

然后转移文件

mv wordpress/  blog

然后

cd blog/

改名

cp wp-config-sample.php wp-config.php

然后修改配置文件

vim  wp-config.php

8.1访问wordpress

修改完以后,我们访问http://10.170.1.16/blog

设置自己的网站标题,用户名和密码

然后点击安装WordPress

成功后会自动转到登陆页面

CentOS6.9安装WordPress搭建自己的博客网站的更多相关文章

  1. github+hexo搭建自己的博客网站(六)进阶配置(搜索引擎收录,优化你的url)

    详细的可以查看hexo博客的演示:https://saucxs.github.io/ 绑定了域名: http://www.chengxinsong.cn hexo+github博客网站源码(可以clo ...

  2. github+hexo搭建自己的博客网站(七)注意事项(避免read.me,CNAME文件的覆盖,手动改github page的域名)

    详细的可以查看hexo博客的演示:https://saucxs.github.io/ 绑定域名可以查看:http://www.chengxinsong.cn 可以查看在github上生成的静态文件(如 ...

  3. Hexo搭建个人静态博客网站

    前言 前段时间博客园整改,许多博客无法查看,偶然的机会接触到了许多博客框架,可用来快速搭建一个静态博客网站:最后选择使用hexo,看了不少大佬的教程,觉得挺有意思的,于是也总结了一下自己的搭建步骤,可 ...

  4. 使用WordPress搭建自己的博客

    突然间发现自己在阿里上有一个免费的虚拟云空间,好像是什么时候阿里云搞活动赠送的.看了看还有不少时间,就决定自己搭建一个博客系统.说到搭建自己的博客,第一时间就想到WordPress,这个用起来应该是最 ...

  5. wordpress搭建自己的博客~

    去官方网站下载wordpress,并解压缩.下载链接:https://cn.wordpress.org/ wordpress是一款开源的PHP框架,搭建个人博客网站最实用的选择之一,甚至你都不需要懂P ...

  6. github+hexo搭建自己的博客网站(一)基础入门

    github提供的page,hexo提供的静态博客文档,这样可以搭建一个自己的一个博客网站. 使用github pages服务搭建博客的好处有: 全是静态文件,访问速度快: 免费方便,不用花一分钱就可 ...

  7. 在Github和oschina上搭建自己的博客网站

    在Github上搭建 - 参考链接 搭建一个免费的,无限流量的Blog----github Pages和Jekyll入门 GitHub + Jekyll 搭建并美化个人网站 用Jekyll搭建的Git ...

  8. 使用hexo搭建github个人博客网站

    搭建步骤: 1>Mac或win电脑一台,本文以mac为例. 2>下载安装Git和Node 3>安装hexo 4>注册登录GitHub,创建一个仓库,库名格式为:GitHub用户 ...

  9. hexo搭建简易的博客网站

    0.环境检测 1.系统升级(图形更新) #update-manager 检测状态 2.检测升级(命令更新) #sudo apt update #sudo apt -y dist-upgrade 一.安 ...

随机推荐

  1. 接触新的项目,构建时候报错:Failure to find io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.7.Final in

    详细信息如下: Failure to find io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.7.Final in http:// ...

  2. WinForm 工作流设计 1

    从事软件行业那么多年,一直很少写博.很多技术,长时间不用都慢慢淡忘. 把自己学到的用笔记下来,可以巩固和发现不足,也可以把自己对技术的一些 理解,分享出来供大家批评指正. 废话不多说,进入正题.工作流 ...

  3. 判断JS数据类型的四种方法

    在 ECMAScript 规范中,共定义了 7 种数据类型,分为 基本类型 和 引用类型 两大类,如下所示: 基本类型:String.Number.Boolean.Symbol.Undefined.N ...

  4. js取数组最大值的四种方式

    var arr = [7,2,0,-3,5];1.apply()应用某一对象的一个方法,用另一个对象替换当前对象 var max = Math.max.apply(null,arr);console. ...

  5. Scala设计模式

    尽管Scala还有一些基于语言特性的设计模式,单本文还是着重于介绍大家所周知的经典设计模式,因为这些设计模式被认为是开发者之间交流的工具. 创建型设计模式 1.工厂方法模式 2.延迟加载模式 3.单例 ...

  6. shell编写小技巧整理

    1. if和else语句可以进行嵌套.if的条件判断部分可能会变得很长,可以使用逻辑运算符将它变得简洁一些. [ condition ] && action :如果condition为 ...

  7. MySQL配置参数说明

    MYSQL服务器my.cnf配置参数详解: 硬件:内存16G [client] port = 3306 socket = /data/mysql.sock [mysql] no-auto-rehash ...

  8. springcloud~Eureka实例搭建

    服务端 build.gradle配置 dependencies { compile('org.springframework.cloud:spring-cloud-starter-netflix-eu ...

  9. java~api返回值的标准化

    api返回值的标准化 例如 {"status":200,"message":"操作成功","data":"{\ ...

  10. jsom快速入门

    JSON JSON: JavaScript Object Notation(JavaScript 对象表示法) JSON 是存储和交换文本信息的语法,具有自我描述性.类似 XML, 但比 XML 更小 ...