zabbix,php,nginx,mysql源码安装 神仙操作

→软件包

mkdir /soft/

cd /soft

♦下载以下软件包

nginx-1.14.2.tar.gz

wget http://nginx.org/download/nginx-1.14.2.tar.gz 

mysql-boost-5.7.25.tar.gz

wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.25.tar.gz

boost_1_59_0.tar.gz

wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz

php-7.1.27.tar.gz

wget http://cn2.php.net/get/php-7.1.27.tar.gz/from/this/mirror

zabbix-4.0.5.tar.gz

wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/4.0.5/zabbix-4.0.5.tar.gz/download 

mv download zabbix-4.0.5.tar.gz

→解压

tar zxvf nginx-1.14.2.tar.gz
tar zxvf mysql-boost-5.7.25.tar.gz
tar zxvf boost_1_59_0.tar.gz
tar zxvf php-7.1.27.tar.gz
tar zxvf zabbix-4.0.5.tar.gz 

→安装nginx

♦安装依赖

yum install -y  pcre* openssl*

♦预编译

[root@localhost nginx-1.14.2]# ./configure --prefix=/usr/local/nginx > --with-http_ssl_module > --with-http_stub_status_module > --with-pcre 

♦编译安装

[root@localhost nginx-1.14.2]# make && make install

♦创建网站目录

[root@localhost nginx-1.14.2]# mkdir /var/www/html -p

→安装PHP

♦安装依赖

[root@localhost nginx-1.14.2]# yum install -y gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel php-mysql php-bcmath

♦ 预编译

[root@localhost php-7.1.27]# ./configure --prefix=/usr/local/php > --with-config-file-path=/usr/local/php/etc > --with-bz2 > --with-curl > --enable-ftp > --enable-sockets > --disable-ipv6 > --with-gd > --with-jpeg-dir=/usr/local > --with-png-dir=/usr/local > --with-freetype-dir=/usr/local > --enable-gd-native-ttf > --with-iconv-dir=/usr/local > --enable-mbstring > --enable-calendar > --with-gettext > --with-libxml-dir=/usr/local > --with-zlib > --with-pdo-mysql=mysqlnd > --enable-dom > --enable-xml > --enable-fpm > --with-libdir=lib64 

♦编译安装

[root@localhost php-7.1.27]# make && make install

♦配置PHP

cp php.ini-production /usr/local/php/etc/php.ini
[root@localhost php-7.1.27]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

♦参数配置PHP(zabbix硬性要求)

vim /usr/local/php/etc/php.ini

max_execution_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time = 300
date.timezone = Asia/Shanghai

♦启动php-fpm

[root@localhost php-7.1.27]# mv /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
[root@localhost php-7.1.27]# /usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini

♦确定php启动

[root@localhost php-7.1.27]# ss -lnt | grep 9000
LISTEN     0      128    127.0.0.1:9000                     *:*

♦配置nginx配置文件,供测试php,以及zabbix页面配置

[root@localhost php-7.1.27]# cat /usr/local/nginx/conf/nginx.conf

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
                      ‘$status $body_bytes_sent "$http_referer" ‘
                      ‘"$http_user_agent" "$http_x_forwarded_for"‘;

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        access_log  /usr/local/nginx/logs/host.access.log  main;
	root   /var/www/html;
        index  index.htm index.html index.php;
        location / {
		try_files $uri $uri/ /index.php?$args;
        }

	location ~ .*\.(php)?$ {
		expires -1s;
		try_files $uri =404;
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		include fastcgi_params;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		fastcgi_pass 127.0.0.1:9000;
	}

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache‘s document root
        # concurs with nginx‘s one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

♦检测一下,并启动

[root@localhost php-7.1.27]# /usr/local/nginx/sbin/nginx -t
[root@localhost php-7.1.27]# /usr/local/nginx/sbin/nginx

♦测试php页面

[root@localhost php-7.1.27]# cat /var/www/html/info.php
<?php
phpinfo();
?>

♦测试php

[root@localhost php-7.1.27]# curl 127.0.0.1/info.php

→安装mysql数据库

♦安装前准备

[root@localhost soft]# rpm -qa | grep mariadb

[root@localhost soft]# rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64

[root@localhost soft]# rpm -e --nodeps mariadb-5.5.60-1.el7_5.x86_64

[root@localhost soft]# rpm -e --nodeps mariadb-server-5.5.60-1.el7_5.x86_64

♦安装依赖

yum -y install gcc gcc-c++ ncurses ncurses-devel cmake bison

♦将解压的boost_1_59_0移动

mv boost_1_59_0 /usr/local/boost

♦新建MySQL用户和用户组,创建/data/mysql 目录存放mysql数据

[root@localhost soft]# groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
[root@localhost soft]# mkdir -pv /data/mysql

♦预编译

[root@node03 mysql-5.7.17]#
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock-DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_BOOST=/usr/local/boost -DMYSQL_USER=mysql -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci 

♦编译安装

[root@localhost mysql-5.7.25]# make && make install

原文地址:https://www.cnblogs.com/charon2/p/10545088.html

时间: 2024-10-12 03:13:07

zabbix,php,nginx,mysql源码安装 神仙操作的相关文章

MySQL系列 - MySQL源码安装配置

二.MySQL系列 - MySQL源码安装配置(附5.7等最新版本)1.依赖环境准备2.开始安装2.1.下载MySQL2.2.解压2.3.赋权限2.4.修改配置文件2.5.启动MySQL3.MySQL 5.7源码安装不同之处 二.MySQL系列 - MySQL源码安装配置(附5.7等最新版本) 1.依赖环境准备 make安装 make编译器下载地址:http://www.gnu.org/software/make/ # tar zxvf make-3.82.tar.gz # cd make-3.

mysql源码安装

一.准备工作 1.下载源码安装包,http://dev.mysql.com/downloads/mysql/ (我用的是mysql-5.6.16) 2.本人是ubuntu上安装的,需要几个依赖的程序:cmake.g++.libncurses5-dev 二.开始安装 1.创建好用户和目录 groupadd mysql # 添加用户组 useradd -r -g mysql mysql mkdir -p /usr/local/mysql # 创建安装目录 chown -R root:mysql /u

(二)企业部分之mysql源码安装

所需软件包:mysql-boost-5.7.11.tar.gz,cmake-2.8.12.2-4.el6.x86_64.rpm tar zxf mysql-boost-5.7.11.tar.gz yum install cmake -y yum update cmake-2.8.12.2-4.el6.x86_64.rpm yum install gcc gcc-c++ ncurses-devel bison -y    ##解决依赖性 cmake -DCMAKE_INSTALL_PREFIX=/

maridb\mysql 源码安装,以10.1.26版本为例

mysql 源码安装(mariadb 10.1.26) 1.环境部署 1 安装cmake 源码安装三部曲或者yum install cmake 2安装依赖包yum install -y ncurses-devel openssl-devel openssl gcc gcc-c++ readline-devel zlib-devel libaio-devel libxml2-devel libcurl-devel libarchive-devel boost boost-develyum grou

Mysql源码安装、配置、初始化及启动

[在此处输入文章标题] 主机环境redhat6.5 实验环境服务端 ip 172.25.29.1  mysql 安装包  mysql-boost-5.7.11.tar.gz   cmake-2.8.12.2-4.el6.x86_64.rpm 1.mysql的源码安装 1.解压压缩包 [[email protected] mnt]# tar zxfmysql-boost-5.7.11.tar.gz  #解压gz包 [[email protected] mnt]# yum installcmake-

mysql源码安装(5.1)

下载mysql源码包并解压.wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.73.tar.gztar -zxvf mysql-5.1.73cd mysql-5.1.73 创建用户.basedir datadiruseradd -s /sbin/nologin  mysqlmkdir -p /usr/local/mysqlmkdir -p /data/mysqlchown mysql /data/mysql 编译前的参数配置.

CentOS 7运维管理笔记(10)----MySQL源码安装

MySQL可以支持多种平台,如Windows,UNIX,FreeBSD或其他Linux系统.本篇随笔记录在CentOS 7 上使用源码安装MySQL的过程. 1.下载源码 选择使用北理工的镜像文件: 在CentOS 7 中输入如下命令: [[email protected]:~/Downloads] # wget http://mirror.bit.edu.cn/mysql/Downloads/MySQL-5.6/mysql-5.6.31.tar.gz 2.解压mysql源码压缩文件,并更新软件

关于mysql源码安装后备份没有mysqldump命令的错误解决

源码安装的mysql在经历了创建库,选定库,创建表,插入数据后,备份时出现了 -bash:mysqldump  command not found 的错误,这是环境变量配置的问题, 命令解决入下: vim  /etc/profile 在最后一行添加:export  PATH=/usr/local/mysql/bin :$PATH 执行命令:source /etc/profile 问题解决.

Linux MySQL源码安装缺少ncurses-devel包

在Red Hat Enterprise Linux Server release 5.7 上用源码安装MySQL-5.6.23时,遇到了" remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel."错误,如下所示 [[email protected] mysql-5.6.23]#