标签:wordpress xsl for 开机 bmc 3.5 pts 2.4 上传
到目前为止还未发现操作系统ISO镜像自带,或者默认情况下yum可以直接通过rpm包方法安装Nginx的情况。如果要使用yum安装Nginx,则需要配置epel yum源或去官网寻找。
yum install pcre pcre-devel -y
注意:
安装pcre库是为了使Nginx支持具备URI重写功能rewrite模块;rewrite模块功能在企业中最常用的;
[root@web01 ~]# rpm -qa pcre pcre-devel ###查看安装结果 prce prce-devel
pcre-7.8-7.el6.x86_64
pcre-devel-7.8-7.el6.x86_64
[root@web01 ~]# rpm -qa openssl openssl-devel ##查看安装结果openssl openssl-devel
openssl-1.0.1e-48.el6_8.4.x86_64
openssl-devel-1.0.1e-48.el6_8.4.x86_64
###如果这两个软件包都没有安装,yum安装
#yum install pcre pcre-devel -y
#yum install optenssl openssl-devel -y
#1.安装依赖包
yum install -y pcre-devel openssl-devel
注意:
Nginx在使用HTTPS服务的时候需要用到此模块,如果不安装optenssl相关包,安装Nginx的过程会报错。
mkdir -p /home/oldboy/tools ##创建文件目录
cd /home/oldboy/tools
wget http://nginx.org/download/nginx-1.10.2.tar.gz
#注意:
在选择下载安装包时,要选定稳定的版本 ##为偶数
[root@web01 tools]# tar xf nginx-1.10.2.tar.gz
[root@web01 tools]# ll
total 896
drwxr-xr-x 8 1001 1001 4096 Oct 18 23:03 nginx-1.10.2
-rw-r--r-- 1 root root 910812 Mar 22 18:10 nginx-1.10.2.tar.gz
useradd -s /sbin/nologin -M www
cd /home/oldboy/tools/nginx-1.10.2 #进入这个目录下面来配置
./configure --user=www --group=www --prefix=/application/nginx-1.10.2 --with-http_stub_status_module --with-http_ssl_module
注意: ./configure--help帮助信息
--user=USER ##进程用户权限
--group=www ##进程用户组权限
-prefix=/application/nginx-1.10.2 ##设置安装路径
--with-http_stub_status_module ##激活状态信息
--with-http_ssl_module ##激活ssl功能
make
make install
ln -s /application/nginx-1.10.2 /application/nginx
/application/nginx/sbin/nginx -t
nginx: the configuration file /application/nginx-1.10.2/conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.10.2/conf/nginx.conf test is successful
命令说明:
-t 是检查配置文件的语法
-s 【reload】 是让配置文件平滑重启,不会影响其它用户
/application/nginx/sbin/nginx -s reload
/application/nginx/sbin/nginx
1、查看端口服务是否开启
lsof -i:80
[root@web01 nginx]# netstat -lnt|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:46580 0.0.0.0:* LISTEN
2、浏览器访问 10.0.0.8
打开浏览器输入http://10.0.0.8(为安装nginx服务器的IP地址),然后回车
解压MySQL二进制包
cd /home/oldboy/tools
tar xf mysql-5.6.34-*-x86_64.tar.gz
把MySQL 移动到 /application/
mkdir -p /application/
mv mysql-5.6.34-linux-glibc2.5-x86_64 /application/mysql-5.6.34
创建软连接
ln -s /application/mysql-5.6.34/ /application/mysql
ll /application/mysql
chown -R mysql.mysql /application/mysql/
groupadd mysql
useradd mysql -g mysql -M -s /sbin/nologin
useradd mysql -M -s /sbin/nologin
cd /application/mysql
##在数据库MySQL目录下执行
./scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/application/mysql/data/
cp /application/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
/application/mysql/bin/mysqld_safe &
\cp support-files/mysql.server /etc/init.d/mysqld
ll /etc/init.d/mysqld
mysql启动脚本 默认放在support-files/mysql.server
sed -i ‘s#/usr/local/mysql#/application/mysql#g‘ /application/mysql/bin/mysqld_safe /etc/init.d/mysqld
启动:
/etc/init.d/mysqld start
启动不成功:
修改配置文件,复制过来,复制之前先备份,以免出现错误。
cp /etc/my.cnf{,.ori}
\cp /application/mysql/my.cnf /etc/my.cnf
nestat -lntup|grep mysql
ps -ef|grep mysql
##3306 为mysql专用端口
初始化脚本文件 /scripts/mysql_install_db
服务启动脚本文件 /application/mysql/bin/mysqld_safe support-files/mysql.server(/etc/init.d/ +x)
/application/mysql/bin/mysql
/application/mysql/bin/mysqladmin -u root password ‘oldboy123‘
看见warning不要害怕,只是一个警告。
命令行输入密码
/application/mysql/bin/mysqladmin -u root password ‘oldboy123‘
交互式输入密码
/application/mysql/bin/mysql -uroot -p
chkconfig --add mysqld
chkconfig mysqld on
show databases
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
| wordpress |
+--------------------+
5 rows in set (0.05 sec)
mysql>
flush privileges;
create database 名字;
mysql> create database oldgirl;
Query OK, 1 row affected (0.04 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| oldgirl |
| performance_schema |
| test |
| wordpress |
+--------------------+
select user,host from mysql.user;
mysql> select user,host from mysql.user;
+-----------+------------+
| user | host |
+-----------+------------+
| root | 127.0.0.1 |
| wordpress | 172.16.1.% |
| root | ::1 |
| | db01 |
| root | db01 |
| | localhost |
| root | localhost |
+-----------+------------+
7 rows in set (0.06 sec)
drop database 数据库名字;
select database()
grant all on wordpress.* to ‘用户名‘@ ‘在哪‘ identfied by ‘密码‘
###db01添加新的用户 那个%的不好使添加这个
grant all on wordpress.* to ‘wordpress@‘172.16.1.0/255.255.255.0‘ identified by ‘123456‘;
flush privileges;
show databases; ---查看数据库信息
create database oldboy; ---创建新的数据库
drop database oldboy; ---删除存在的数据库
show tables; ---查看数据库中表信息
use mysql; ---切换数据库
select database(); ---查看所在数据库,相当于pwd
select * from user\G; ---查看user表中所有信息,并且纵行显示
select user,host from user; ---查看user表中指定信息,并且横行显示
select user,host from mysql.user;
grant all on *.* to user@‘host‘ identified by ‘oldboy123‘; ---创建用户
grant all on *.* to Old_Boy@‘localhost‘ identified by ‘oldboy123‘; ---创建用户(大写用户)
drop user ‘user‘@‘host‘;
flush privileges; --- 刷新权限
解压PHP软件,进行编译安装,将程序安装到/application目录中,并且创建软连接
yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel -y
yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel -y
mkdir -p /home/oldboy/tools
cd /home/oldboy/tools
#wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
编译:
make
make install
在/home/oldboy/tools下载工具的目录
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
yum -y install libmcrypt-devel mhash mcrypt
rpm -qa libmcrypt-devel mhash mcrypt
创建软连接
ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/
touch ext/phar/phar.phar
如果是nginx用户则需要修改php-fpm.conf.default 这个配置文件user = www:group = www改变一下
改变方法:
#sed -i ‘s#user = www#user = nginx#g;s#group = www#group = nginx#g‘ /application/php-5.5.32/etc/php-fpm.conf.default
ln -s /application/php-5.5.32/ /application/php
cd /home/oldboy/tools/php-5.5.32
cp php.ini-production /application/php/lib/php.ini
cd /application/php/etc/
cp php-fpm.conf.default php-fpm.conf
/application/php/sbin/php-fpm
#查看端口,是否启动。
lsof -i :9000
ps -ef|grep php-fpm
编辑
/application/nginx/html/blog
vim test_mysql.php
?php
//$link_id=mysql_connect(‘主机名‘,‘用户‘,‘密码‘);
//mysql -u用户 -p密码 -h 主机
$link_id=mysql_connect(‘localhost‘,‘wordpress‘,‘123456‘) or mysql_error();
if($link_id){
echo "mysql successful by oldboy !\n";
}else{
echo mysql_error();
}
?>
进入tools目录
cd /home/oldboy/tools/
tar xf wordpress-4.7.3-zh_CN.tar.gz
mv wordpress/* /application/nginx/html/blog/
chown -R www.www /application/nginx/html/blog/
将本地的数据库迁移到mysql服务器
推过去web01==>db01
scp /home/oldboy/tools/mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz 172.16.1.51:/home/oldboy/tools/
将压缩包推倒MySQL服务器
解压创建数据库,创建用户。
在本地/application/nginx/html/blog路径下,修改vim wp-config.php文件。
......................省略
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define(‘DB_NAME‘, ‘wordpress‘);
/** MySQL数据库用户名 */
define(‘DB_USER‘, ‘wordpress‘);
/** MySQL数据库密码 */
define(‘DB_PASSWORD‘, ‘oldboy123‘);
/** MySQL主机 */
define(‘DB_HOST‘, ‘172.16.1.51‘); ##将IP地址改成mysqlIP地址
/** 创建数据表时默认的文字编码 */
define(‘DB_CHARSET‘, ‘utf8mb4‘);
/** 数据库整理类型。如不确定请勿更改 */
define(‘DB_COLLATE‘, ‘‘);
..........................省略
标签:wordpress xsl for 开机 bmc 3.5 pts 2.4 上传
原文地址:http://www.cnblogs.com/xinlibao/p/6731115.html