linux之LAMP简单应用程序搭建Wordpress
第一步我们去Wordpress的首页去下载
~]# yum install httpd php php-mysql mysql-server 安装需要的服务
~]#service httpd start 启动httpd服务
~]#service mysqld start 启动mysql服务
~]#service iptables stop 关闭防火墙
~]# chkconfig iptables off 永久关闭防火墙
~]# setenforce 0 暂时关闭selinux
~]# sed -i "s/^SELINUX\=enforcing/SELINUX\=disabled/g" /etc/selinux/config 永久关闭selinux
找到压缩包并且下载。
使用Xftp把本地文件上传到虚拟机里然后查看
使用命令 tar -zxvf wordpress-5.0.3.tar.gz解压到当前目录,查看可发现多了一个wordpress 目录
查看目录下的文件
把目录下的文件都移动到我们http的指定目录下(一般默认指定目录的话在/var/www/html/目录下)我的指定 目录在/mnt/web1/html/
[[email protected] wordpress]# cp -a /mnt/wordpress /mnt/web1/html
然后进入wordpress目录下复制wp-config-sample.php 并修改名为wp-config.php
[[email protected] wordpress]# cp wp-config-sample.php wp-config.php
我们修改文件里的数据库信息(数据库名为wpdb,数据库用户为:wpuser,数据库密码:wppasswd)
然后我们去在数据库中创建刚才在文件中所修改的数据库内容
授权给wpdb.*数据库,指明数据库用户wpuser,只能通过本机@localhost ,指明数据库密码
mysql> grant all on wpdb.* to 'wpuser'@'localhost' identified by 'wppasswd';
授权给数据库
mysql> grant all on wpdb.* to 'wpuser'@'127.0.0.1' identified by 'wppasswd';
创建数据库wpdb
mysql> create database wpdb;
刷新授权信息
mysql> flush privileges;
我们使用去测试链接
使用命令mysql -uwpuser -pwppasswd 然后去查看数据库wpdb是否存在
然后去网站查看使用http://192.168.10.5/wordpress/的命令在网址中输入
输入以下内容
然后点击安装install wordpress以下为安装成功