好物优选点击查看详情 京东购买

暂无内容

谷歌云搭建wordpress centos7 + apache + mysql + php + wordpress

GCW设置ssh:
1: 登录服务器,切换到root用户,命令:sudo su – 或者 sudo -i
2: 修改ssh配置文件,命令: vim /etc/ssh/sshd_config
修改下面两个参数把no改为yes
PermitRootLogin no
PasswordAuthentication no
3: 重启ssh服务使修改生效,
debain命令:/etc/init.d/ssh restart
centos命令:service sshd restart
4: 给用户添加密码:passwd user(chaij10)
命令:passwd user
输入命令后会让你设置密码,输入两次要设置的密码
5: 用户登陆 >> su root
passwd -d root // root登陆不用密码, 之后secureCRT

1.升级centos版本
cat /etc/redhat-release 查看版本
yum update

4.环境:centos 7, apache, php, mysql, wordpress
//安装apache
yum install httpd
service httpd start
systemctl enable httpd.service
vim /etc/httpd/conf/httpd.conf
定位到< directory >修改 AllowOverride None 为 AllowOverride All
定位到<directory “/var/www/html”>修改 AllowOverride None 为 AllowOverride All
service httpd restart

//安装mysql
yum install wget
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
yum localinstall mysql80-community-release-el7-1.noarch.rpm

cd /etc/yum.repos.d/
ll
vim mysql-community.repo //修改mysql版本
mysql5.7 enabled =1
mysql8.0 enabled =0

rpm -qa|grep mysql
yum install mysql-server // 安装mysql5.7
service mysqld start

mysql -V // 大写V
systemctl status mysqld

grep ‘temporary password’ /var/log/mysqld.log //查初始密码
mysql -u root -p //初始密码登陆
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘a12345678A$’; //更改登陆密码
create database wordpress;
show databases;
\q

//安装php
yum list installed | grep php 查看已经安装
yum remove //新安装忽略
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum search php7
yum install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
php -v // 小写v

//下载wordpress
wget https://wordpress.org/latest.zip
yum install unzip //安装解压工具
unzip latest.zip //解压出wordpress文件夹
cp -rf wordpress/* /var/www/html/ //复制文件
cd /var/www/html
cp wp-config-sample.php wp-config.php //复制config文件
vim wp-config.php //数据库名称wordpress,用户名 root, 密码
chown -R apache:apache /var/www/html //回到根目录更改权属
chmod -R 755 /var/www/html

cd /var/www/html
ll -a // .htaccess 是隐藏文件
touch .htaccess // 创建.htaccess
vim .htaccess //拷入,settings – permalinks – Save Changes

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /ll RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> 

chown -R apache:apache .htaccess //更改权属
chmod -R 666 .htaccess //更改权限

sestatus //SElinux 关闭SELINUX 解决you should update your .htaccess now
vim /etc/selinux/config
SELINUX=disabled
reboot

原文链接:https://blog.csdn.net/chaij10/article/details/102965282

© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享