当前位置: 首页>后端>正文

CentOS7部署FreeRadius centos7部署pwn题目

1.准备 LNMP 环境

LNMP 是 Linux、Nginx、MySQL 和 PHP 的缩写,是 WordPress 博客系统依赖的基础运行环境。我们先来准备 LNMP 环境

1.1.安装 Nginx

安装过程参考博客:使用nginx将阿里云服务器升级为https 安装成功后在浏览器中输入虚拟机ip地址,来确认是否已经安装成功。下面是成功过界面

CentOS7部署FreeRadius centos7部署pwn题目,CentOS7部署FreeRadius centos7部署pwn题目_centos,第1张

将 Nginx 设置为开机自动启动:

chkconfig nginx on
1.2.安装 MySQL

安装MySQL参考博客:Centos7安装和配置MySQL5.7

安装成功连接MySQL如下:

CentOS7部署FreeRadius centos7部署pwn题目,CentOS7部署FreeRadius centos7部署pwn题目_个人博客_02,第2张

1.3.安装 PHP

使用 yum 安装 PHP:

yum install php-fpm php-mysql -y

安装成功:

CentOS7部署FreeRadius centos7部署pwn题目,CentOS7部署FreeRadius centos7部署pwn题目_php_03,第3张

安装之后,启动 PHP-FPM 进程:

service php-fpm start

启动之后,可以使用下面的命令查看 PHP-FPM 进程监听哪个端口

netstat -nlpt | grep php-fpm

把 PHP-FPM 也设置成开机自动启动:

chkconfig php-fpm on

PHP-FPM 默认监听 9000 端口

2.安装 WordPress

2.1.下载配置 WordPress

配置好 LNMP 环境后,开始下载 WordPress:

wordpress各种版本安装包:wordpress官网

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

如果不能下载,请去资源界面软件部分下载压缩包:网站资源 ;解压:

tar -zxvf wordpress-4.8.3-zh_CN.tar.gz

文件目录

CentOS7部署FreeRadius centos7部署pwn题目,CentOS7部署FreeRadius centos7部署pwn题目_centos_04,第4张

安装完成后,就可以在 /usr/share/wordpress 看到 WordPress 的源代码了。
连接MySQL

mysql -u root -p

为 WordPress 创建一个数据库:

CREATE DATABASE wordpress;

CentOS7部署FreeRadius centos7部署pwn题目,CentOS7部署FreeRadius centos7部署pwn题目_centos_05,第5张

MySQL 部分设置完了,我们退出 MySQL 环境:

exit

然后将wordpress目录下的 wp-config-sample.php 重命名为 wp-config.php

mv wp-config-sample.php wp-config.php

然后把上述的 DB 配置同步到 WordPress 的配置文件(wp-config.php)中,可参考下面的配置:

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */

// ** 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', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'MySQLroot用户的密码');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

/**
 * See http://make.wordpress.org/core/2013/10/25/the-definitive-guide-to-disabling-auto-updates-in-wordpress-3-7
 */

/* Disable all file change, as RPM base installation are read-only */
define('DISALLOW_FILE_MODS', true);

/* Disable automatic updater, in case you want to allow
   above FILE_MODS for plugins, themes, ... */
define('AUTOMATIC_UPDATER_DISABLED', true);

/* Core update is always disabled, WP_AUTO_UPDATE_CORE value is ignore */

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', '/usr/share/wordpress');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

注意修改MySQL的密码

2.2.配置 Nginx

WordPress 已经安装完毕,我们配置 Nginx 把请求转发给 PHP-FPM 来处理
修改配置文件,

vim /usr/local/nginx/conf/nginx.conf

参考内容如下,其中root /usr/share/wordpress;是我的wordpress目录

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    # 设置nginx允许上传文件的大小
    client_max_body_size 10m;
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    gzip  on;
    server {
        listen       80;
        root /usr/share/wordpress;
        location / {
            index index.php index.html index.htm;
            try_files $uri $uri/ /index.php index.php;
        }
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ .php$ {
           fastcgi_pass   127.0.0.1:9000;
           fastcgi_index  index.php;
           fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
           include        fastcgi_params;
        }
    }
}

接着重启nginx。然后访问

http://ip/wp-admin/install.php

3.安装成功

下面是成功的界面:

CentOS7部署FreeRadius centos7部署pwn题目,CentOS7部署FreeRadius centos7部署pwn题目_CentOS7部署FreeRadius_06,第6张

填写完信息之后登录,登录成功界面

CentOS7部署FreeRadius centos7部署pwn题目,CentOS7部署FreeRadius centos7部署pwn题目_php_07,第7张

网站主页

CentOS7部署FreeRadius centos7部署pwn题目,CentOS7部署FreeRadius centos7部署pwn题目_centos_08,第8张

网站到这里就搭建成功了。可以自己研究研究…

注意当前版本比较低,大家可以安装最新版本(我安装最新版本的时候,说php版本过低emmm,果断放弃)

如果提示如下:·

Your server is running PHP version 5.4.16 but WordPress 5.3.2 requires at least 5.6.20.

说明PHP的版本太低,下面升级PHP;

注:升级PHP版本

使用yum list 命令查看可安装的包(Packege)

[root@localhost ~]# yum list installed |grep php 
php-common.x86_64                           5.4.16-46.1.el7_7          @updates 
php-fpm.x86_64                              5.4.16-46.1.el7_7          @updates 
php-mysql.x86_64                            5.4.16-46.1.el7_7          @updates 
php-pdo.x86_64                              5.4.16-46.1.el7_7          @updates

如果有安装的PHP包,先删除

yum remove php-common.x86_64 php-fpm.x86_64 php-pdo.x86_64 php-mysql.x86_64

在检查看看,卸载成功了没有

yum list installed |grep php         //返回结果为空,卸载完成

安装CentOS 7.0 的epel-release、安装扩展包

yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

安装php 7

yum install php73-php php73-php-gd php73-php-mysqld php73-php-pecl-mysql php73-php-pecl-mysql-xdevapi php73-php-odbc php73-php-opcache php73-php-pdo php73-php-pecl-mcrypt php73-php-devel php73-php-cli php73-php-pecl-http php73-php-pecl-http-devel -y

重启httpd

systemctl restart httpd


https://www.xamrdz.com/backend/3w21937742.html

相关文章: