• ubuntu16.04安装wordpress


    ubuntu16.04安装wordpress和centos7安装wordpress存在一定的差异。

    当然共性大于差异。

    共性是lamp环境。

    wordpress的必备环境。

    先共性再差异。

    一、搭建lamp环境(Linux+Apache+MySQL+PHP(含phpmyadmin))

    (1)安装apache

    安装命令

    apt-get install apache2

    apache常用命令:

    service apache2 restart 重启

    service apache2 status 状态

    service apache2 start 启动

    service apache2 stop 关闭

    (2)安装mysql

    apt-get install mysql-server mysql-client

    会显示让你输入密码

    输入密码后会再次显示确认密码

    你所做的是确保两次密码一致并回车即可。

    mysql命令:

    service mysql retart

    service mysql status

    service mysql start

    service mysql stop

    (3)安装php

    安装命令:

    apt-get install php7.0

    apt-get install libapache2-mod-php7.0 

    apt-get install php7.0-mysql

    重启apache和mysql

    service apache2 restart

    service mysql restart

    编辑文件

    vim /var/www/html/phpinfo.php

    <?php echo phpinfo();?>

    浏览器访问:

    http:// IP地址/phpinfo.php,出现PHP版本界面

    (4)安装phpmyadmin

    安装命令

    sudo apt-get install phpmyadmin

    安装时:空格选择apache2,enter确定,下一步配置数据库,输入密码。

    sudo ln -s /usr/share/phpmyadmin /var/www/html

    启用Apache mod_rewrite模块,后面修改wordpress链接会用到

    sudo a2enmod rewrite 

    重启服务

    service php7.0-fpm restart

    配置vim /etc/apache2/apache2.conf

    配置文件尾部添加如下内容:

    AddType application/x-httpd-php .php .htm .html 
    
    AddDefaultCharset UTF-8

    重启apache服务

    service apache2 restart

    通过phpmyadmin在后台建立数据库为wordpress

    并添加对应的用户并授权

    也可以通过如下的命令行形式:

    # 登录数据库
    mysql -u root -p
    # 创建数据库
    CREATE DATABASE wordpress;
    # 创建数据库用户和密码
    CREATE USER wordpressuser@localhost IDENTIFIED BY '123456';
    # 设置wordpressuser访问wordpress数据库权限
    GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY '123456';
    # 刷新数据库设置
    FLUSH PRIVILEGES;
    # 退出数据库
    exit

    (5)安装wordpress

    说明:中文版和英文版文件后缀名不同,因此解压方式不同存在差异,后面的步骤基本一样,没有变化,本人试验,绝对有效。

    centos7同样适用,关于centos7安装方式可以参考:centos7之安装wordpress

    下载

    wget http://wordpress.org/latest.tar.gz(英文版)

    wget https://cn.wordpress.org/wordpress-4.8-zh_CN.zip(中文版)

    注意:中文版为zip包,需要通过unzip命令进行解压 

    解压

    tar -xzvf latest.tar.gz

    远程批量传输

    sudo rsync -avP ~/wordpress/ /var/www/html/wordpress/

    切换到wordpress目录
    cd /var/www/html/wordpress

     复制wp-config.php文件
    cp wp-config-sample.php wp-config.php

    编辑wp-config.php文件
    sudo vim wp-config.php

    默认内容如下:
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'database_name_here');
    /** MySQL database username */
    define('DB_USER', 'username_here');
    /** MySQL database password */
    define('DB_PASSWORD', 'password_here');
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    
    将其修改为:
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'wordpress');
    /** MySQL database username */
    define('DB_USER', 'wordpress');
    /** MySQL database password */
    define('DB_PASSWORD', '123456');
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    完成后在浏览器输入地址:www.example.com/wordpress/wp-admin/install.php 
    按照步骤来,一步一步安装。

    Ubuntu16.04除了安装lamp环境与centos存在差异外很多步骤都是一样的。



  • 相关阅读:
    GNU make manual 翻译(九十九)
    GNU make manual 翻译( 九十五)
    Shell的 for 循环小例子
    makefile中对目录遍历的小例子
    GNU make manual 翻译(九十三)
    GNU make manual 翻译( 一百)
    GNU make manual 翻译( 九十七)
    GNU make manual 翻译( 九十八)
    mapserver4.8.3 的readme.win32的中文翻译文件
    遥控器编程
  • 原文地址:https://www.cnblogs.com/youcong/p/9309197.html
Copyright © 2020-2023  润新知