LNMP方式部署ZABBIX服务器

一、zabbix部署架构

image


二、正文

2.1、部署环境

操作系统:RedHat 6.5 x86_64

Nginx:  1.15.7

PHP: 7.1.29

Mysql: 5.7.26

Zabbix: 4.2.1

openssl: 1.0.2r

测试系统配置: 1核1G20G

2.2、LNMP部署

2.2.1、Linux系统安装(略)

2.2.2、Nginx服务部署

[root@server1 nginx-1.15.7]# yum –y install pcre-devel

[root@server1 nginx-1.15.7]#  ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-pcre --with-openssl=/home/ipnet/Update_openssh_v8.0p1_rhel4567_20190425/openssl-1.0.2r --with-zlib=/home/ipnet/Update_openssh_v8.0p1_rhel4567_20190425/zlib-1.2.11

Configuration summary
   + using system PCRE library
   + using OpenSSL library: /home/ipnet/upload/Update_openssh_v7.9p1_rhel4567_20181228/openssl-1.0.2o
   + using zlib library: /home/ipnet/upload/Update_openssh_v7.9p1_rhel4567_20181228/zlib-1.2.11

  nginx path prefix: "/usr/local/nginx"
   nginx binary file: "/usr/local/nginx/sbin/nginx"
   nginx modules path: "/usr/local/nginx/modules"
   nginx configuration prefix: "/usr/local/nginx/conf"
   nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
   nginx pid file: "/usr/local/nginx/logs/nginx.pid"
   nginx error log file: "/usr/local/nginx/logs/error.log"
   nginx http access log file: "/usr/local/nginx/logs/access.log"
   nginx http client request body temporary files: "client_body_temp"
   nginx http proxy temporary files: "proxy_temp"
   nginx http fastcgi temporary files: "fastcgi_temp"
   nginx http uwsgi temporary files: "uwsgi_temp"
   nginx http scgi temporary files: "scgi_temp"

[root@server1 nginx-1.15.7]# make && make install

注:

--with-http_ssl_module 表示支持https方式

--with-http_v2_module 表示支持http2.0

--with-http_stub_module 表示支持nginx状态查询

--with-pcre 表示支持rewrite功能

--with-openssl 指向openssl安装目录

--with-zlib  指向 zlib安装目录


2.2.3、Mysql5.7服务部署

2.2.3.1、卸载系统自带的mysql服务

[root@server1 upload]# rpm -qa|grep mysql
mysql-devel-5.1.73-7.el6.x86_64
mysql-libs-5.1.73-7.el6.x86_64
mysql-server-5.1.73-7.el6.x86_64
mysql-5.1.73-7.el6.x86_64
[root@server1 upload]# rpm -e mysql-devel
[root@server1 upload]# rpm -e mysql-server
warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave
[root@server1 upload]# rpm -e mysql
[root@server1 MariaDB]# rpm  -e --nodeps mysql-libs
[root@server1 upload]# rpm -qa|grep mysql
[root@server1 upload]#

2.2.3.2、安装最新版Mysql

image

删除旧版本mysql

[root@server1 upload]# rpm -qa|grep mysql
mysql-devel-5.1.73-7.el6.x86_64
mysql-libs-5.1.73-7.el6.x86_64
php-mysql-5.3.3-47.el6.x86_64
mysql-server-5.1.73-7.el6.x86_64
mysql-5.1.73-7.el6.x86_64
[root@server1 upload]#
[root@server1 upload]#
[root@server1 upload]# rpm -e mysql-devel
[root@server1 upload]# rpm -e mysql-libs
error: Failed dependencies:
     libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
     libmysqlclient.so.16()(64bit) is needed by (installed) perl-DBD-MySQL-4.013-3.el6.x86_64
     libmysqlclient.so.16()(64bit) is needed by (installed) mysql-5.1.73-7.el6.x86_64
     libmysqlclient.so.16()(64bit) is needed by (installed) mysql-server-5.1.73-7.el6.x86_64
     libmysqlclient.so.16()(64bit) is needed by (installed) php-mysql-5.3.3-47.el6.x86_64
     libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
     libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) perl-DBD-MySQL-4.013-3.el6.x86_64
     libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-7.el6.x86_64
     libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-server-5.1.73-7.el6.x86_64
     libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) php-mysql-5.3.3-47.el6.x86_64
     libmysqlclient_r.so.16()(64bit) is needed by (installed) MySQL-python-1.2.3-0.3.c1.1.el6.x86_64
     libmysqlclient_r.so.16()(64bit) is needed by (installed) mysql-5.1.73-7.el6.x86_64
     libmysqlclient_r.so.16()(64bit) is needed by (installed) mysql-server-5.1.73-7.el6.x86_64
     libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) MySQL-python-1.2.3-0.3.c1.1.el6.x86_64
     libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-7.el6.x86_64
     libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-server-5.1.73-7.el6.x86_64
     mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
     mysql-libs = 5.1.73-7.el6 is needed by (installed) mysql-5.1.73-7.el6.x86_64
[root@server1 upload]# rpm -e php-mysql
[root@server1 upload]# rpm -e mysql-server
warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave
[root@server1 upload]# rpm -e mysql-5.1.73
[root@server1 upload]# rpm -qa|grep mysql
mysql-libs-5.1.73-7.el6.x86_64
[root@server1 upload]#

安装mysql5.7

[root@server1 upload]# rpm -Uvh mysql-community-libs-compat-5.7.26-1.el6.x86_64.rpm mysql-community-libs-5.7.26-1.el6.x86_64.rpm mysql-community-server-5.7.26-1.el6.x86_64.rpm mysql-community-client-5.7.26-1.el6.x86_64.rpm mysql-community-common-5.7.26-1.el6.x86_64.rpm mysql-community-devel-5.7.26-1.el6.x86_64.rpm
warning: mysql-community-libs-compat-5.7.26-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
    1:mysql-community-common ########################################### [ 20%]
    2:mysql-community-libs   ########################################### [ 40%]
    3:mysql-community-client ########################################### [ 60%]
    4:mysql-community-server ########################################### [ 80%]
    5:mysql-community-libs-co########################################### [100%]

    6:mysql-community-devel  ########################################### [100%]

修改my.cnf

[root@server1 upload]# cat /etc/my.cnf
[client]
default-character-set = utf8
socket=/var/lib/mysql/mysql.sock

[mysqld]
max_connections = 2000
open_files_limit = 30000
table_open_cache = 20000
explicit_defaults_for_timestamp = true
transaction-isolation = READ-COMMITTED
max_allowed_packet = 128M
innodb_buffer_pool_size = 20G  这个一般是主机内存的80%
innodb_log_file_size = 512M
innodb_file_per_table = 1
innodb_log_buffer_size=4M
innodb_thread_concurrency=64
innodb_flush_log_at_trx_commit=0
innodb_flush_method=O_DIRECT
lower_case_table_names = 1
#collation-server = gbk_bin       
# character-set-server = gbk
default-storage-engine = INNODB
join_buffer_size = 512M
sort_buffer_size = 20M
read_rnd_buffer_size = 20M
 
log_timestamps = system
collation-server = utf8_bin
character-set-server = utf8
#validate_password_policy = 0
#validate_password_number_count = 0
#validate_password_length = 4
#validate_password_special_char_count = 0
default_password_lifetime = 0
innodb_read_io_threads = 16
innodb_write_io_threads = 16

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
 
skip-host-cache
skip-name-resolve
 
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Recommended in standard MySQL setup
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
 
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[root@server1 upload]#


启动mysql服务

image

修改mysql初始密码,因为我是拿来测试的,不想密码设置太复杂,我这里将密码复杂度(默认需要有数字,大小写字母,特殊字符)和密码长度(默认是8位)都调低了。

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.00 sec)

mysql> alter user 'root'@'localhost' identified by 'redhat';
Query OK, 0 rows affected (0.00 sec)

mysql>

创建zabbix数据库并设置zabbix用户访问权限

mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on zabbix.* to zabbix@localhost identified by 'redhat';
Query OK, 0 rows affected, 2 warnings (0.00 sec)

mysql> grant all on *.* to root@'127.0.0.1' identified by 'redhat';
Query OK, 0 rows affected, 1 warning (0.44 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql>


导入zabbix基础数据到数据库中,注意按顺序导入

[root@server1 zabbix-4.2.1]# cd /home/ipnet/zabbix-4.2.1/zabbix-4.2.1
[root@server1 zabbix-4.2.1]# ls
aclocal.m4  build      conf          config.status  configure.ac  depcomp    INSTALL     Makefile     man      NEWS    src
AUTHORS     ChangeLog  config.guess  config.sub     COPYING       frontends  install-sh  Makefile.am  misc     README
bin         compile    config.log    configure      database      include    m4          Makefile.in  missing  sass
[root@server1 zabbix-4.2.1]# cd database/
[root@server1 database]# ls
elasticsearch  ibm_db2  Makefile  Makefile.am  Makefile.in  mysql  oracle  postgresql  sqlite3
[root@server1 database]# cd mysql/
[root@server1 mysql]# ls
data.sql  images.sql  Makefile  Makefile.am  Makefile.in  schema.sql
[root@server1 mysql]# mysql -uzabbix -predhat zabbix < schema.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@server1 mysql]# mysql -uzabbix -predhat zabbix < images.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@server1 mysql]# mysql -uzabbix -predhat zabbix < data.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@server1 mysql]#



2.2.4、PHP服务部署

依赖安装

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2  glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap  openldap-devel openldap.i686 openldap-devel.i686 nss_ldap openldap-clients openldap-servers net-snmp net-snmp-devel libxslt-devel

[root@server1 upload]# rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpm libmcrypt-2.5.8-9.el6.x86_64.rpm

Preparing...                ########################################### [100%]
    1:libmcrypt              ########################################### [ 50%]
    2:libmcrypt-devel        ########################################### [100%]

[root@server1 php-7.1.29]# './configure' '--prefix=/usr/local/php-7.1.29' '--with-config-file-path=/usr/local/php-7.1.29/etc' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-mbstring' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-iconv-dir' '--with-zlib' '--with-libxml-dir' '--enable-pdo' '--with-snmp' '--with-xsl' '--enable-xml' '--disable-rpath' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-fpm' '--with-mcrypt' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-sockets' '--with-bz2' '--enable-pcntl' '--with-xmlrpc' '--enable-zip' '--enable-soap' '--disable-debug' '--disable-ipv6' '--enable-opcache' '--without-pear'

[root@server1 upload]# make && make install

生成php-fpm.conf 和 php.ini文件

image

PHP配置文件修改

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引擎的配置文件

image

[root@server1 php-fpm.d]# egrep -v '^$|^;' www.conf
[www]
user = nobody
group = nobody
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 30
pm.max_requests = 500
slowlog = /var/log/php-fpm/$pool.log.slow
request_slowlog_timeout = 10s
[root@server1 php-fpm.d]#

[root@server1 php-fpm.d]# mkdir –p /var/log/php-fpm

[root@server1 php-fpm.d]# /usr/local/php-7.1.29/sbin/php-fpm

[root@server1 php-fpm.d]# netstat -tnlp|grep 9000
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      91358/php-fpm      
[root@server1 php-fpm.d]#


2.2.5 PHP和Nginx关联

[root@server1 php-fpm.d]# vim /usr/local/nginx/conf/nginx.conf

[root@server1 php-fpm.d]# egrep -v '^\s+#.*|^$|^#' /usr/local/nginx/conf/nginx.conf
user  nobody;
worker_processes  1;
error_log  logs/error.log;
pid        logs/nginx.pid;
events {
     worker_connections  1024;
}
http {
     include       mime.types;
     default_type  application/octet-stream;
     sendfile        on;
     keepalive_timeout  65;
     server {
         listen       80;
         server_name  localhost;
         location / {
             root   html;
             index  index.html index.htm;
         }
         error_page   500 502 503 504  /50x.html;
         location = /50x.html {
             root   html;
         }
         location ~ \.php$ {
             root           html;
             fastcgi_pass   127.0.0.1:9000;
             fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
             include        fastcgi_params;
         }
     }
}
[root@server1 php-fpm.d]#

[root@server1 php-fpm.d]# /usr/local/nginx/sbin/nginx
[root@server1 php-fpm.d]# netstat -tnlp|grep 80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      91399/nginx        
[root@server1 php-fpm.d]#

重点

   nginx配置文件 fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name; 这一行需要改成fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

否则界面访问php文件会报File not Found的错误,nginx后台日志也会报Primary script unknown" while reading response header from upstream的报错,$document_root 代表当前请求在root指令中指定的值,更改后重启Nginx服务即可恢复正常访问。

测试Nginx打开PHP页面是否正常

直接在/usr/local/nginx/html 目录中新建index.php和mysql_connect.php

[root@server1 html]# cat index.php
<?php
phpinfo();
?>
[root@server1 html]#

[root@server1 html]# cat test.php
<?php
$link = new mysqli("127.0.0.1","root","redhat");
if(!$link) {
     echo "数据库连接失败";
}
else {
      echo "连接成功";
}
$link->close();
?>
[root@server1 html]#

image

image

2.3、zabbix部署

必要依赖环境安装

[root@server1 zabbix-4.2.1]# rpm -ivh /home/ipnet/zabbix-4.2.1/libevent-devel-1.4.13-4.el6.x86_64.rpm /home/ipnet/zabbix-4.2.1/libevent-headers-1.4.13-4.el6.noarch.rpm /home/ipnet/zabbix-4.2.1/libevent-doc-1.4.13-4.el6.noarch.rpm
warning: /home/ipnet/zabbix-4.2.1/libevent-devel-1.4.13-4.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
    1:libevent-headers       ########################################### [ 33%]
    2:libevent-doc           ########################################### [ 67%]
    3:libevent-devel         ########################################### [100%]
[root@server1 zabbix-4.2.1]#

如果要zabbix服务器支持监控JAVA应用程序的性能需要事先在服务端安装java编译环境然后启用—enable-java 参数

[root@server1 zabbix-4.2.1]# rpm -ivh /home/ipnet/jdk-7u80-linux-x64.rpm

如果需要监控服务器硬件可以加上 –with-openipmi 参数,这个需要事先安装好OpenIPMI和OpenIPMI-devel RPM包,也可以用SNMP来监控服务器硬件,我因为是用的SNMP来获取服务器硬件信息,这里我没有将这个功能编译进去。

编译zabbix服务端应用

[root@server1 zabbix-4.2.1]# ./configure --prefix=/usr/local/zabbix-3.4.1 --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --with-openssl --enable-java --enable-ipv6

[root@server1 zabbix-4.2.1]# make && make install

[root@server1 conf]# egrep -v '^$|^#' /usr/local/zabbix-3.4.1/etc/zabbix_server.conf
ListenPort=10051
LogFile=/tmp/zabbix_server.log
Timeout=4
LogSlowQueries=3000
StatsAllowedIP=127.0.0.1
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=redhat
ListenIP=0.0.0.0
[root@server1 conf]

[root@server1 conf]# useradd -M zabbix -s /sbin/nologin

[root@server1 conf]# /usr/local/zabbix-3.4.1/sbin/zabbix_server

[root@server1 conf]# /usr/local/zabbix-3.4.1/sbin/zabbix_agentd
[root@server1 conf]# ps -ef|grep zabbix
zabbix     3973      1  0 16:27 ?        00:00:00 /usr/local/zabbix-3.4.1/sbin/zabbix_server
zabbix     3978      1  0 16:27 ?        00:00:00 /usr/local/zabbix-3.4.1/sbin/zabbix_agentd
zabbix     3979   3978  0 16:27 ?        00:00:00 /usr/local/zabbix-3.4.1/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix     3980   3978  0 16:27 ?        00:00:00 /usr/local/zabbix-3.4.1/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix     3981   3978  0 16:27 ?        00:00:00 /usr/local/zabbix-3.4.1/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix     3982   3978  0 16:27 ?        00:00:00 /usr/local/zabbix-3.4.1/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix     3983   3978  0 16:27 ?        00:00:00 /usr/local/zabbix-3.4.1/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root       3985   2470  0 16:27 pts/0    00:00:00 grep zabbix
[root@server1 conf]#

拷贝zabbix web 文件到html目录下并改名

[root@server1 zabbix-4.2.1]# cp -rf /home/ipnet/zabbix-4.2.1/zabbix-4.2.1/frontends/php /usr/local/nginx/html/
[root@server1 zabbix-4.2.1]# cd /usr/local/nginx/html/ && mv php zabbix
[root@server1 html]# ls -l /usr/local/nginx/html/
总用量 20
-rw-r--r--.  1 root root  494 5月  23 13:07 50x.html
-rw-r--r--.  1 root root  612 5月  23 13:07 index.html
-rw-r--r--.  1 root root   20 5月  23 14:01 index.php
-rw-r--r--.  1 root root  157 5月  23 14:48 test.php
drwxr-xr-x. 13 root root 4096 5月  23 16:07 zabbix

浏览器打开zabbix配置界面

image

下面的要求都需要是OK状态再继续。

image

配置数据库连接,当主机填写为localhost时MySQL会采用 unix domain socket连接,当主机填写为127.0.0.1时MySQL会采用TCP/IP的方式连接,如果页面报的错误是No such file or directory,也就是说PHP找不到这个socket文件,这个时候需要修改php.ini指定mysql的socket文件位置

具体可以看https://segmentfault.com/q/1010000000328531 这个博文

首先my.cnf看下socket文件的位置

[root@server1 no-debug-non-zts-20160303]# cat /etc/my.cnf|grep socket
socket=/var/lib/mysql/mysql.sock

[root@server1 no-debug-non-zts-20160303]# egrep 'mysqli.default_socket' /usr/local/php-7.1.29/etc/php.ini
mysqli.default_socket = /var/lib/mysql/mysql.sock
[root@server1 no-debug-non-zts-20160303]#

然后重启nginx和php-fpm即可

image


image

image

image

按照提示下载下来再传到对应服务器位置刷新界面即可

image

image

zabbix的默认账号和密码是 Admin/zabbix

最终打开的界面如下:

image


三、总结

原文地址:https://blog.51cto.com/kk876435928/2419570

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


本篇内容介绍了“LNMP服务器环境配置实例分析”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情...
本篇内容主要讲解“OneinStack如何一键安装LNMP”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“OneinStack如何...
小编给大家分享一下如何解决LNMP安装composer install时出现Warning: putenv()问题,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅...
1.源码安装mysql鉴于前边的文章已经详细说过mysql的源码安装可以点击基于LAMP的Discuz论坛的实现(源码安装)自行查看这里为了节省时间用一个shell脚本进行mysql的源码安装用到的mysql依然是5.6.46没有源码包的同学可以点击【mysql-5.6.46.tar.gz提取码:nli5】进行下载
Linux是非常热门的技术,也是当下非常受欢迎的操作系统,具有独特的优势所在,广受大家的喜欢和追捧,今天为大家分享一下几款常用的Linux系统面板,希望对你有所帮助。1、宝塔面板:是一款使用方便、功能强大而且终身免费的服务器管理软件,支持Linux以及Windows系统,一键配置LAMP/LNMP
██【電:131.乀.1418.乀.6667】【薇q:9788.乀.9181】██柬埔寨东方明珠开户目录LAMP1.安装Mariadb2.安装PHP3.测试php和apache的协同4.修改MariaDB数据库配置5.测试数据库连接LNMP(未完待续)LAMP1.安装Mariadb在RaspberryPi中,MySQL无法安装,会自动建议安装Maria
关闭防火墙安装依赖包上传源码包解压源码包,安装nginx启动nginx安装mysql和PHP相关服务修改nginx配置文件,nginx和PHP进行整合重新加载nginx服务启动php-fpm书写PHP测试页测试网页 
一.lnmp的搭建1.准备一台纯净版的虚拟机2.下载Lnmp一键安装包命令:wget http://soft.vpser.net/lnmp/lnmp1.5-full.tar.gz【安装完整版的-推荐1.5版本】也可以本地下载好,通过rz上传:http://soft.vpser.net/lnmp/lnmp1.5-full.tar.gz3.开始安装命令:cdlnmp1.5-full 
1.LNMP理论fastcgi的主要优点:把动态语言和http服务器分离开来,使nginx可以处理静态请求和向后转发动态请求,而php/php-fpm服务器转移解析PHP动态请求使用fastcgi的原因:Nginx不支持对外部动态程序的直接调用或者解析,所有的外部程序(包括PHP)必须通过FastCGI接口来调用。
keepalived高可用keepalived注意:任何软件都可以使用keepalived来做高可用keepalived如何实现高可用VRRP:虚拟路由冗余协议比如公司的网络是通过网关进行上网的,那么如果该路由器故障了,网关无法转发报文了,此时所有人都无法上网了,怎么办?通常做法是给路由器增加一台备节点,但是问
通过阿里云的服务器搭建lnmp架构以及部署wordpress个人博客,连接上域名所遇到的问题及解决办法注释:操作系统centos7.9第一步:购买阿里云ecs服务器,选择系统及其他硬件,下面是我自己购买的配置,可以参考(注意操作系统我购买的时候选错了,后来换成了centos7.9)然后在阿里云“云服
文章目录1.首先了解编译安装和yum安装的区别。2.yum安装准备工作---切换阿里云yum源3.编译安装lnmp**很不建议使用编译安装,麻烦且容易报错。**4.yum安装lnmp**可以先执行一下yumupdate**5.lnmp一键安装[参考网站](https://lnmp.org/)**不喜欢这种方式,所以没测试
电影院系统解压登录mysql创建电影院系统使用的数据库授权账户skyuc访问数据库讲系统部署到www.benet.com网站根目录下mv/usr/src/SKYUC.v3.4.2.SOURCE/wwwroot/*/var/www/benetcom/设置网站根目录所有者和权限客户机测试论坛系统部署解压复制文件到网站根目
下载:​ https://www.php.net/downloads​ https://www.php.net/distributions/php-8.0.6.tar.gz编译安装php:①安装依赖:yum-yinstalllibxml2-develsqlite-develbzip2-devellibcurl-devellibpng-devellibjpeg-develfreetype-devellibicu-develoniguruma-devellibxs
树莓派LNMP关键词:raspberrywebphpdnsmysq1LNMP、LAMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写,分别指Linux、Nginx/Apache、MySQL和PHP。这里演示如何在树莓派上搭建LNMP环境并配置多个站点。主要内容:树莓派安装nginx树莓派安装ph
官网:http://kodcloud.com/1、准备MySQL数据库 [root@cent8_yzl_20~]#yuminstall-ymysql-server[root@cent8_yzl_20~]#systemctlenable--nowmysqld[root@cent8_yzl_20~]#mysqlmysql>createdatabasekodbox;mysql>createuserkodbox@'10.0.0.
环境应用IP操作系统nginx192.168.122.131centos8mysql192.168.122.132centos8php192.168.122.133centos8准备工作//关闭防火墙#systemctldisable--nowfirewalld#setenforce0#vim/etc/selinux/configSELINUX=disabled安装nginx//安装依
1.购买vps或者外国云主机2.搭建ss服务端3.客户端配置服务端信息,即可。不废话,开始教程:ss-panel-v3简介ss-panel是一套功能齐全的shadowsocks用户管理面板,它可以实现用户注册、用户管理、流量控制、签到、添加多节点、充值购买、邀请返利等诸多功能,是目前网络上使用最广泛的一
LNMP架构数据迁移至NFS第一步:先将原有目录中数据移出数据存储到本地什么位置,获取方法1.通过网站页面右键点击,获取资源地址信息2.find命令利用-mmin53.利用inotify服务监控目录数据变化[root@web01wp-content]#cd/applicationginx/html/blog/wp-content/uploads[root@we
一 点睛业务上线之前最关键的一项任务便是环境部署,往往一个业务涉及多种应用环境,比如Web、DB、PROXY、CACHE等,本示例通过env.roledefs定义不同主机角色,再使用“@roles('webservers')”修饰符绑定到对应的任务函数,实现不同角色主机的部署差异。二 代码#coding=utf-8#!/usr