在Centos7 64位系统中搭建服务器与博客

本文档详细介绍了如何在Linux系统上进行服务器配置,包括关闭防火墙和selinux,安装Apache、MySQL以及PHP,实现网页服务。接着,安装了FTP服务vsftpd并进行了相关设置。最后,升级了PHP版本从5.4到5.6,并成功搭建了一个WordPress博客,通过winscp连接虚拟机上传文件,完成了博客的初步建设。

****1、先将防火墙、selinux关闭
syetemctl stop firewalld ----关闭防火墙
systemctl status firewall -------查看防火墙的状态(此时应该是关闭状态)

sestatus-----查看selinux的状态
vi /etc/sysconfig/selinux -----对selinux文本进行编辑

在这里插入图片描述
sestatus

在这里插入图片描述
systemctl disable firewall -----将防火墙退出启动项,防止开机自启
reboot ----重启系统
此时可以在本地浏览器中访问虚拟机的IP进行访问
在这里插入图片描述

****2、进行apache 的安装
yum install httpd httpd-devel —进行安装
systemctl start httpd ---------------启动http服务
systemctl enable httpd -----------加入启动项
systemctl status httpd -----------查看http的状态

****3、进行Mysql的安装
yum install mariadb mariadb-server mariadb-libs mariadb-devel ----进行安装
systemctl start mariadb----启动服务
systemctl status mariadb----查看状态
systemctl enable mariadb—加入启动项
mysql_secure_installation-----数据库的安全性设置
(除了下图选择n,其余的是y)

在这里插入图片描述
****4、安装php
yum -y install php ----进行安装
yum install php-mysql—将php与mysql进行关联
yum install -y php-gd php-ldap php-odbc php-pear php-xmlrpc php-mbstring php-snmp curl curl-devel php-bcmath----安装php的常用的模块

在这里插入图片描述

在这里插入图片描述
进行php解析测试
systemctl restart httpd----重启服务
在本地IP进行查看
在这里插入图片描述
****5、进行ftp服务的安装
yum install -y vsftpd —进行安装
systemctl start vsftpd.service —开启服务
systemctl enable vsftpd.service —加入启动项
在这里插入图片描述
然后进行
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
完成上述操作后,进行
systemctl restart vsftpd.service -----重启服务

6、进行php版本的升级(升级php5.4 到php5.6)
yum provides php ----查看现有版本
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm -----进行源文件的安装
yum remove php-common -y ----删除旧的php
yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring----安装依赖包
php -v -----版本变为5.6
7、进行winscp433 的安装
在这里插入图片描述
进行连接虚拟机

在这里插入图片描述
在这里插入图片描述
将wordpress放入html目录下
8、进行博客的搭建
先进性数据库的撞创建
mysql -uroot -p -----进入数据库
create database + 数据库名;----创建数据库
show databases ; -----查看数据库
exit ------退出
然后在本地进行访问 : IP/wordpress
在这里插入图片描述
进行wp-config.php的创建
在这里插入图片描述
wp-config.php是属于wordpress下的目录,放在wordpress的根目录下*
再在本地进行访问,此时会进入博客的界面!
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值