阳光网驿-企业信息化交流平台【DTC零售连锁全渠道解决方案】

 找回密码
 注册

QQ登录

只需一步,快速开始

扫描二维码登录本站

手机号码,快捷登录

老司机
查看: 470|回复: 3

[原创] RockyLinux源码编译安装LNMP环境

[复制链接]
  • TA的每日心情
    奋斗
    昨天 07:53
  • 签到天数: 319 天

    [LV.8]以坛为家I

    发表于 2023-5-22 13:56:21 | 显示全部楼层 |阅读模式
    本帖最后由 himi04 于 2023-5-22 14:07 编辑

    1.系统环境
    系统: Rocky Linux 8
    NGINX: nginx 1.20
    MySQL: MySQL8.0 PHP
    PHP版本:5.3.x 5.5.x 5.6.x

    2 安装依赖

    yum install apr* autoconf automake bison bzip2 bzip2* cpp curl curl-devel fontconfig fontconfig-devel freetype-devel git gcc gcc-c++ gd gd-devel gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libxml* libXaw-devel libXmu-devel libtiff libtiff* make openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet wget zlib-devel ncurses-devel libtirpc-devel gtk* ntpstat bison* sqlite-devel oniguruma libzip-devel

    -- 数据库安装3 安装 rpcsvc-proto

    [root@localhost soft# tar xf rpcsvc-proto-1.4.2.tar.xz [root@localhost soft# cd rpcsvc-proto-1.4.2/[root@localhost soft# ./configure[root@localhost soft# make && make install

    4 安装 cmake
    [root@localhost soft# tar zxf cmake-3.21.3.tar.gz
    [root@localhost soft# cd cmake-3.21.3/
    [root@localhost cmake-3.21.3# ./configure[root@localhost cmake-3.21.3# make && make install


    5. 安装MySQL
    [root@localhost soft# groupadd mysql
    [root@localhost soft# useradd -g mysql -s /bin/false mysql
    [root@localhost soft# mkdir -p /usr/local/mysql/data/mysql
    [root@localhost soft# chown -R mysql.mysql /usr/local/mysql/data/
    [root@localhost soft# tar zxf mysql-boost-8.0.25.tar.gz
    [root@localhost soft# cd mysql-8.0.25/
    [root@localhost mysql-8.0.25# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DINSTALL_DATADIR=/usr/local/mysql/data/mysql -DMYSQL_USER=mysql -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_EMBEDDED_SERVER=1 -DFORCE_INSOURCE_BUILD=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/opt/soft/mysql-8.0.25/boost -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
    [root@localhost mysql-8.0.25# make && make install


    6 初始化MySQL数据库
    数据库初始化

    [root@localhost mysql# ./bin/mysqld --user=mysql --initialize --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/mysql

    2021-09-27T11:06:56.667253Z 6 [Note [MY-010454 [Server A temporary password is generated for root@localhost: xVGu-rCy5a.q  #password
    编辑my.cnf文件

    [client]
    port=3306
    socket=/tmp/mysql.sock
    password="my password"
    [mysqldport=3306
    user = mysql
    socket=/tmp/mysql.socktmp
    dir = /tmp
    key_buffer_size=16M
    max_allowed_packet=128M
    default_authentication_plugin=mysql_native_password
    open_files_limit = 60000
    explicit_defaults_for_timestampserver-id = 1
    character-set-server = utf8mb4
    federatedmax_connections = 1000
    max_connect_errors = 100000
    interactive_timeout = 86400
    wait_timeout = 86400
    sync_binlog=0back_log=100
    default-storage-engine = InnoD
    Blog_slave_updates = 1

    链接my.cnf到etc

    ln -s /usr/local/mysql/my.cnf /etc/my.cnf
    配置mysqld启动文件

    [root@localhost mysql# cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld[root@localhost mysql# chmod +x /etc/init.d/mysqld
    编辑 mysqld

    [root@localhost mysql# vim /etc/rc.d/init.d/mysqld
    输出
    basedir=/usr/local/mysql
    datadir=/usr/local/mysql/data

    添加环境变量

    [root@localhost ~# cat /etc/profile.d/mysql.sh
    export PATH=$PATH:/usr/local/mysql/bin

    添加软链接

    在编译PHP时可以不用指定mysql的库文件
    ln -s /usr/local/mysql/lib/mysql  /usr/lib/mysqlln -s /usr/local/mysql/include/mysql  /usr/include/mysqlmkdir /var/lib/mysql #创建目录ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock

    修改 MySQL密码

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;Query OK, 0 rows affected (0.10 sec)mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password' PASSWORD EXPIRE NEVER;Query OK, 0 rows affected (0.03 sec)mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec)


    --、安装Nginx
    7 安装 pcre

    [root@localhost soft# tar zxf pcre-8.44.tar.gz [root@localhost soft# cd pcre-8.44/[root@localhost pcre-8.44# mkdir /usr/local/pcre -p[root@localhost pcre-8.44# ./configure --prefix=/usr/local/pcre[root@localhost pcre-8.44# make && make install
    8 安装openssl

    [root@localhost soft# tar zxf openssl-1.1.1k.tar.gz [root@localhost soft# cd openssl-1.1.1k/[root@localhost openssl-1.1.1k# mkdir -p /usr/local/openssl[root@localhost openssl-1.1.1k# ./config -fPIC shared zlib --prefix=/usr/local/openssl[root@localhost openssl-1.1.1k# make && make install
    9 安装zlib

    [root@localhost soft# tar zxf zlib-1.2.11.tar.gz [root@localhost soft# cd zlib-1.2.11/[root@localhost zlib-1.2.11# mkdir -p /usr/local/zlib[root@localhost zlib-1.2.11# ./configure --prefix=/usr/local/zlib[root@localhost zlib-1.2.11#  make && make install

    10 安装 nginx

    [root@localhost nginx-1.20.0# groupadd www[root@localhost nginx-1.20.0# useradd -g www -s /bin/false www[root@localhost nginx-1.20.0# ./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/opt/soft/openssl-1.1.1k --with-zlib=/opt/soft/zlib-1.2.11 --with-pcre=/opt/soft/pcre-8.44[root@localhost nginx-1.20.0# make && make install

    11 Nginx启动脚本

    vim /lib/systemd/system/nginx.service



    [UnitDescription=nginx - high performance web serverDocumentation=http://nginx.org/en/docs/After=network.target[ServiceType=forkingPIDFile=/var/run/nginx.pidExecStartPost=/bin/sleep 0.1ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.confExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.confExecReload=/bin/kill -s HUP $MAINPIDExecStop=/bin/kill -s QUIT $MAINPIDTimeoutStartSec=120LimitNOFILE=1000000LimitNPROC=1000000LimitCORE=1000000[InstallWantedBy=multi-user.target

    12 设置开机启动

    systemctl enable nginx.service



    楼主热帖
    启用邀请码注册,提高发帖质量,建设交流社区
  • TA的每日心情
    奋斗
    昨天 07:53
  • 签到天数: 319 天

    [LV.8]以坛为家I

     楼主| 发表于 2023-5-22 13:57:02 | 显示全部楼层
    --安装PHP
    13安装yasm

    [root@localhost soft]# tar zxf yasm-1.3.0.tar.gz
    [root@localhost soft]# cd yasm-1.3.0/
    [root@localhost yasm-1.3.0]# ./configure
    [root@localhost yasm-1.3.0]# make && make install
    BashCopy
    14 安装libmcrypt

    [root@localhost soft]# tar zxf libmcrypt-2.5.8.tar.gz
    [root@localhost soft]# cd libmcrypt-2.5.8/
    [root@localhost libmcrypt-2.5.8]# ./configure
    [root@localhost libmcrypt-2.5.8]# make && make install
    BashCopy
    15 安装libvpx

    [root@localhost soft]# tar zxf libvpx-1.10.0.tar.gz
    [root@localhost soft]# cd libvpx-1.10.0/
    [root@localhost libvpx-1.10.0]# ./configure --prefix=/usr/local/libvpx --enable-shared --enable-vp9
    [root@localhost libvpx-1.10.0]# make && make install
    BashCopy
    16 安装tiff

    [root@localhost soft]# tar zxf tiff-4.0.7.tar.gz
    [root@localhost soft]# cd tiff-4.0.7/
    [root@localhost tiff-4.0.7]# ./configure --prefix=/usr/local/tiff --enable-shared
    [root@localhost tiff-4.0.7]# make && make install
    BashCopy
    17 安装libpng

    [root@localhost soft]# tar zxf libpng-1.6.37.tar.gz
    [root@localhost soft]# cd libpng-1.6.37/
    [root@localhost libpng-1.6.37]# ./configure --prefix=/usr/local/libpng --enable-shared
    [root@localhost libpng-1.6.37]# make && make install
    BashCopy
    18 安装freetype

    [root@localhost soft]# tar zxf freetype-2.10.4.tar.gz
    [root@localhost soft]# cd freetype-2.10.4/
    [root@localhost freetype-2.10.4]# ./configure --prefix=/usr/local/freetype --enable-shared
    [root@localhost freetype-2.10.4]# make && make install
    BashCopy
    19 安装jpeg

    [root@localhost soft]# tar zxf jpegsrc.v9d.tar.gz
    [root@localhost soft]# cd jpeg-9d/
    [root@localhost jpeg-9d]# ./configure --prefix=/usr/local/jpeg --enable-shared
    [root@localhost jpeg-9d]# make && make install
    BashCopy
    20 安装新版本GD库

     新版本GD库适用于PHP 5.4.x及以上
    [root@localhost soft]# tar zxf libgd-2.3.1.tar.gz
    [root@localhost soft]# cd libgd-2.3.1/
    [root@localhost libgd-2.3.1]# ./configure --prefix=/usr/local/libgd --enable-shared --with-jpeg=/usr/local/jpeg --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/freetype --with-xpm=/usr/lib64 --with-tiff=/usr/local/tiff
    [root@localhost libgd-2.3.1]# make && make install
    BashCopy
    21 安装旧版本GD库

    旧版本GD库知用于PHP 5.3.x以下
    [root@localhost soft]# tar zxf gd-2.0.35.tar.gz
    [root@localhost soft]# cd gd-2.0.35/
    [root@localhost gd-2.0.35]# ./configure --prefix=/usr/local/gd --enable-shared --with-jpeg=/usr/local/jpeg --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/freetype --with-xpm=/usr/lib64 --with-tiff=/usr/local/tiff --with-vpx=/usr/local/libvpx
    [root@localhost gd-2.0.35]# make && make install
    BashCopy
    22 安装t1lib

    [root@localhost soft]# tar zxf t1lib-5.1.2.tar.gz
    [root@localhost soft]# cd t1lib-5.1.2/
    [root@localhost t1lib-5.1.2]# ./configure --prefix=/usr/local/t1lib --enable-shared
    [root@localhost t1lib-5.1.2]# make without_doc && make install
    BashCopy
    23 安装libzip

    [root@localhost soft]# tar zxf libzip-1.7.3.tar.gz
    [root@localhost soft]# cd libzip-1.7.3/
    [root@localhost libzip-1.7.3]# mkdir build
    [root@localhost libzip-1.7.3]# cd build/
    [root@localhost build]# cmake ..
    [root@localhost build]# make
    [root@localhost build]# make install
    BashCopy
    24 安装低版本 openssl

    适用于PHP7.3.x以下编译安装
    [root@localhost soft]# tar zxf openssl-1.0.2k.tar.gz
    [root@localhost soft]# cd openssl-1.0.2k/
    [root@localhost openssl-1.0.2k]# ./config -fPIC shared zlib --prefix=/usr/local/ssl
    [root@localhost openssl-1.0.2k]# make && make install
    BashCopy
    [root@localhost soft]# mv /usr/bin/openssl /usr/bin/openssl._1.1.1g
    [root@localhost soft]# mv /usr/include/openssl/ /usr/include/openssl._1.1.1g
    [root@localhost soft]# mv /usr/lib64/libssl.so /usr/lib64/libssl.so._1.1.1g_bak
    [root@localhost soft]# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
    [root@localhost soft]# ln -s /usr/local/ssl/include/openssl /usr/include/openssl
    [root@localhost soft]# ln -s /usr/local/ssl/lib/libssl.so /usr/lib64/libssl.so
    [root@localhost soft]# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
    [root@localhost soft]# ldconfig -v
    [root@localhost soft]# openssl version
    OpenSSL 1.0.2k  26 Jan 2017
    BashCopy
    25 安装curl

    [root@localhost soft]# tar zxf curl-7.76.1.tar.gz
    [root@localhost soft]# cd curl-7.76.1/
    [root@localhost curl-7.76.1]# ./configure --without-nss --prefix=/usr/local/curl --with-ssl=/usr/local/ssl
    BashCopy
    26 安装 expat

    [root@localhost soft]# tar zxf expat-2.4.1.tar.gz
    [root@localhost soft]# cd expat-2.4.1/
    [root@localhost expat-2.4.1]# ./configure --prefix=/usr/local/expat --enable-shared
    [root@localhost expat-2.4.1]# make && make install
    BashCopy
    27 链接lib库

    [root@localhost]# cp -frp /usr/lib64/libltdl.so* /usr/lib/
    [root@localhost]# cp -frp /usr/lib64/libXpm.so* /usr/lib/
    BashCopy
    -- 编译安装 PHP 5.3.29
    yum install -y expat-devel
    [root@localhost php-5.3.29]# ./configure --prefix=/usr/local/php53 --with-config-file-path=/usr/local/php53/etc --with-pdo-mysql=mysqlnd --enable-mysqlnd-compression-support --with-gd=/usr/local/gd --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-freetype-dir=/usr/lib --with-iconv --with-zlib-dir=/usr/local/zlib --enable-xml --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl=/usr/local/ssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl=/usr/local/curl --enable-ctype --enable-mysqlnd
    BashCopy
    28 删除系统默认php.ini

    [root@localhost php-5.3.29]# rm -f /etc/php.ini
    [root@localhost php-5.3.29]# cp php.ini-production /usr/local/php53/etc/php.ini
    [root@localhost php-5.3.29]# ln -s /usr/local/php53/etc/php.ini /etc/php.ini
    [root@localhost php-5.3.29]# cp /usr/local/php53/etc/php-fpm.conf.default /usr/local/php53/etc/php-fpm.conf
    BashCopy
    29 配置php-fpm.conf

    [root@localhost etc]# grep -Ev "^#|^$|^;" php-fpm.conf
    [global]
    pid = run/php-fpm.pid

    [www]
    user = www
    group = www
    listen = 127.0.0.1:9053  

    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    BashCopy
    30 设置php-fpm开机启动

    [root@localhost soft]# cd php-5.3.29/
    [root@localhost php-5.3.29]# cp /opt/soft/php-5.3.29/sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php53-fpm
    [root@localhost php-5.3.29]# chmod +x /etc/rc.d/init.d/php53-fpm
    [root@localhost php-5.3.29]# chkconfig php53-fpm on
    BashCopy
    31 编辑php-fpm启动脚本

    [root@localhost php-5.3.29]# grep -Ev "^#|^$|^;" /etc/rc.d/init.d/php53-fpm
    prefix=/usr/local/php53
    exec_prefix=${prefix}
    php_fpm_BIN=${exec_prefix}/sbin/php53-fpm   #修改当前行
    php_fpm_CONF=${prefix}/etc/php-fpm.conf
    php_fpm_PID=${prefix}/var/run/php-fpm.pid
    php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID"
    BashCopy
    32 启动 php-fpm

    [root@localhost php-5.3.29]# mv /usr/local/php53/sbin/php-fpm /usr/local/php53/sbin/php53-fpm
    [root@localhost php-5.3.29]# service php53-fpm start
    [root@localhost php-5.3.29]# ss -tnlp |grep 9053
    LISTEN 0      128        127.0.0.1:9053       0.0.0.0:*    users("php53-fpm",pid=1434960,fd=0),("php53-fpm",pid=1434959,fd=0),("php53-fpm",pid=1434958,fd=9))
    BashCopy
    33 配置php.ini文件

    [PHP]
    engine = On
    short_open_tag = On  
    asp_tags = Off
    precision = 14
    y2k_compliance = On
    output_buffering = 4096
    zlib.output_compression = Off
    implicit_flush = Off
    unserialize_callback_func =
    serialize_precision = 17
    allow_call_time_pass_reference = Off
    safe_mode = Off
    safe_mode_gid = Off
    safe_mode_include_dir =
    safe_mode_exec_dir =
    safe_mode_allowed_env_vars = PHP_
    safe_mode_protected_env_vars = LD_LIBRARY_PATH
    disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname #禁用函数
    disable_classes =
    zend.enable_gc = On
    expose_php = Off
    max_execution_time = 30
    max_input_time = 60
    memory_limit = 128M
    error_reporting = E_ALL & ~E_DEPRECATED
    display_errors = Off
    display_startup_errors = Off
    log_errors = On
    log_errors_max_len = 1024
    ignore_repeated_errors = Off
    ignore_repeated_source = Off
    report_memleaks = On
    track_errors = Off
    html_errors = Off
    variables_order = "GPCS"
    request_order = "GP"
    register_globals = Off
    register_long_arrays = Off
    register_argc_argv = Off
    auto_globals_jit = On
    post_max_size = 8M
    magic_quotes_gpc = Off
    magic_quotes_runtime = Off
    magic_quotes_sybase = Off
    auto_prepend_file =
    auto_append_file =
    default_mimetype = "text/html"
    doc_root =
    user_dir =
    enable_dl = Off
    file_uploads = On
    upload_max_filesize = 2M
    max_file_uploads = 20
    allow_url_fopen = On
    allow_url_include = Off
    default_socket_timeout = 60
    [Date]
    date.timezone = PRC  
    [filter]
    [iconv]
    [intl]
    [sqlite]
    [sqlite3]
    [Pcre]
    [Pdo]
    [Pdo_mysql]
    pdo_mysql.cache_size = 2000
    pdo_mysql.default_socket=
    [Phar]
    [Syslog]
    define_syslog_variables  = Off
    [mail function]
    SMTP = localhost
    smtp_port = 25
    mail.add_x_header = On
    [SQL]
    sql.safe_mode = Off
    [ODBC]
    odbc.allow_persistent = On
    odbc.check_persistent = On
    odbc.max_persistent = -1
    odbc.max_links = -1
    odbc.defaultlrl = 4096
    odbc.defaultbinmode = 1
    [Interbase]
    ibase.allow_persistent = 1
    ibase.max_persistent = -1
    ibase.max_links = -1
    ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
    ibase.dateformat = "%Y-%m-%d"
    ibase.timeformat = "%H:%M:%S"
    [MySQL]
    mysql.allow_local_infile = On
    mysql.allow_persistent = On
    mysql.cache_size = 2000
    mysql.max_persistent = -1
    mysql.max_links = -1
    mysql.default_port =
    mysql.default_socket =
    mysql.default_host =
    mysql.default_user =
    mysql.default_password =
    mysql.connect_timeout = 60
    mysql.trace_mode = Off
    [MySQLi]
    mysqli.max_persistent = -1
    mysqli.allow_persistent = On
    mysqli.max_links = -1
    mysqli.cache_size = 2000
    mysqli.default_port = 3306
    mysqli.default_socket =
    mysqli.default_host =
    mysqli.default_user =
    mysqli.default_pw =
    mysqli.reconnect = Off
    [mysqlnd]
    mysqlnd.collect_statistics = On
    mysqlnd.collect_memory_statistics = Off
    [OCI8]
    [PostgreSQL]
    pgsql.allow_persistent = On
    pgsql.auto_reset_persistent = Off
    pgsql.max_persistent = -1
    pgsql.max_links = -1
    pgsql.ignore_notice = 0
    pgsql.log_notice = 0
    [Sybase-CT]
    sybct.allow_persistent = On
    sybct.max_persistent = -1
    sybct.max_links = -1
    sybct.min_server_severity = 10
    sybct.min_client_severity = 10
    [bcmath]
    bcmath.scale = 0
    [browscap]
    [Session]
    session.save_handler = files
    session.use_cookies = 1
    session.use_only_cookies = 1
    session.name = PHPSESSID
    session.auto_start = 0
    session.cookie_lifetime = 0
    session.cookie_path = /
    session.cookie_domain =
    session.cookie_httponly =
    session.serialize_handler = php
    session.gc_probability = 1
    session.gc_divisor = 1000
    session.gc_maxlifetime = 1440
    session.bug_compat_42 = Off
    session.bug_compat_warn = Off
    session.referer_check =
    session.entropy_length = 0
    session.cache_limiter = nocache
    session.cache_expire = 180
    session.use_trans_sid = 0
    session.hash_function = 0
    session.hash_bits_per_character = 5
    url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
    [MSSQL]
    mssql.allow_persistent = On
    mssql.max_persistent = -1
    mssql.max_links = -1
    mssql.min_error_severity = 10
    mssql.min_message_severity = 10
    mssql.compatability_mode = Off
    mssql.secure_connection = Off
    [Assertion]
    [COM]
    [mbstring]
    [gd]
    [exif]
    [Tidy]
    tidy.clean_output = Off
    [soap]
    soap.wsdl_cache_enabled=1
    soap.wsdl_cache_dir="/tmp"
    soap.wsdl_cache_ttl=86400
    soap.wsdl_cache_limit = 5
    [sysvshm]
    [ldap]
    ldap.max_links = -1
    [mcrypt]
    [dba]
    [xsl]
    BashCopyashCopy
    Nginx 配置文件
    user www www;
    worker_processes auto;
    error_log /data/wwwlogs/error_nginx.log crit;
    pid /var/run/nginx.pid;
    worker_rlimit_nofile 51200;
    events {
      use epoll;
      worker_connections 51200;
      multi_accept on;
    }
    http {
      include mime.types;
      default_type application/octet-stream;
      server_names_hash_bucket_size 128;
      client_header_buffer_size 32k;
      large_client_header_buffers 4 32k;
      client_max_body_size 1024m;
      client_body_buffer_size 10m;
      sendfile on;
      tcp_nopush on;
      keepalive_timeout 120;
      server_tokens off;
      tcp_nodelay on;
      fastcgi_connect_timeout 300;
      fastcgi_send_timeout 300;
      fastcgi_read_timeout 300;
      fastcgi_buffer_size 64k;
      fastcgi_buffers 4 64k;
      fastcgi_busy_buffers_size 128k;
      fastcgi_temp_file_write_size 128k;
      fastcgi_intercept_errors on;
      gzip on;
      gzip_buffers 16 8k;
      gzip_comp_level 6;
      gzip_http_version 1.1;
      gzip_min_length 256;
      gzip_proxied any;
      gzip_vary on;
      gzip_types
        text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
        text/javascript application/javascript application/x-javascript
        text/x-json application/json application/x-web-app-manifest+json
        text/css text/plain text/x-component
        font/opentype application/x-font-ttf application/vnd.ms-fontobject
        image/x-icon;
      gzip_disable "MSIE [1-6]\.(?!.*SV1)";
      server {
        listen 80;
        server_name _;
        access_log /data/wwwlogs/access_nginx.log combined;
        root /data/wwwroot/default;
        index index.html index.htm index.php;
        location /nginx_status {
          stub_status on;
          access_log off;
          allow 127.0.0.1;
          deny all;
        }
        location ~ [^/]\.php(/|$) {
          fastcgi_index index.php;
          include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
          expires 30d;
          access_log off;
        }
        location ~ .*\.(js|css)?$ {
          expires 7d;
          access_log off;
        }
        location ~ ^/(\.user.ini|\.ht|\.git|\.svn|\.project|LICENSE|README.md) {
          deny all;
        }
      }
      include vhost/*.conf;
    }
    BashCopy
    38 虚拟主机

    server {
    listen 80;
    listen [::]:80;
    server_name localhost;
    access_log /data/wwwlogs/localhost_nginx.log combined;
    index index.html index.htm index.php;
    root /data/wwwroot/default/;

    #include /usr/local/nginx/conf/rewrite/typecho.conf;
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    location ~ .*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv|mp4)$ {
      #valid_referers none blocked *.localhost localhost;
      if ($invalid_referer) {
          return 403;
      }
    }
    location ~ .*\.php(\/.*)*$ {
          root /data/wwwroot/default/;
          fastcgi_pass 127.0.0.1:9053;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
      expires 30d;
      access_log off;
    }
    location ~ .*\.(js|css)?$ {
      expires 7d;
      access_log off;
    }
    location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
      deny all;
    }
    }




    启用邀请码注册,提高发帖质量,建设交流社区
  • TA的每日心情
    开心
    2024-3-25 14:43
  • 签到天数: 3674 天

    [LV.Master]伴坛终老

    发表于 2023-5-24 14:14:16 | 显示全部楼层
    大神这个是做啥呢,这么复杂的的东西,看着就不会。
    启用邀请码注册,提高发帖质量,建设交流社区
  • TA的每日心情
    开心
    昨天 09:08
  • 签到天数: 247 天

    [LV.8]以坛为家I

    发表于 2023-6-1 09:27:59 | 显示全部楼层
    大神这个是做啥呢,这么复杂的的东西,看着就不会。
    启用邀请码注册,提高发帖质量,建设交流社区
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    快速回复 返回顶部 返回列表