雅虎新闻|| BBC新闻|| CNN新闻|| 美元指数|| 中国期货指数|| 股票指数|| 黄金|| 外汇|| 英汉互译|| 昭放工具
163邮箱|| 126邮箱|| 新浪邮箱|| 企业邮箱|| 21cn邮箱|| tom邮箱|| 搜狐邮箱|| hotmail邮箱|| msn邮箱|| qq邮箱

用户登录

设为主页| 淘宝铺| 加入收藏|
您的IP:18.222.120.133您的操作系统:Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
个人便签
知识库
安装ngnix1.8、php7.4

网卡在/etc/sysconfig/network-scripts/底下。

添加:

BOOTPROTO=static

IPADDR=10.1.3.43

NETMASK=255.255.255.0

GATEWAY=10.1.1.254

DNS=114.114.114.114

NM_CONTROLLED=no

……

ONBOOT=yes

service network restart

 

vi /etc/selinux/config

将SELINUX=enforcing改为SELINUX=disabled

setenforce 0

systemctl stop firewalld.service

systemctl disable firewalld.service

 

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 nss_ldap openldap-clients openldap-servers

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum search nginx

yum install -y nginx

systemctl start nginx.service

systemctl enable nginx.service

mkdir /home/www

mkdir /home/www/gz_news

mkdir /home/logs/

vi /etc/nginx/nginx.conf

在http的花括弧内,include /etc/nginx/conf.d/*.conf;之后加入:

server {

listen 80 default;

server_name app.gzrb.com;

root /home/www/gz_news;

charset utf-8;

access_log /home/logs/host.access.log main;

location / {

root /home/www/gz_news;

index index.php index.html index.htm;

proxy_redirect off;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

}

location ~* /download/ {

root /home/www/gz_news;

}

location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {

root /home/www/gz_news;

expires 7d;

}

location /nginx_status {

stub_status on;

access_log off;

allow 192.168.10.0/24;

deny all;

}

location ~ ^/(WEB-INF)/ {

deny all;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

location ~ \.php$ {

root /home/www/gz_news;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

 

yum -y install epel-release

(yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm)

yum -y install libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel gd

yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

yum -y install yum-utils

yum-config-manager --enable remi-php74

yum -y update

yum -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-imagick php-redis php-embedded

mkdir /run/php-fpm/

vi /etc/rc.local

/usr/sbin/php-fpm

chmod 755 /etc/rc.d/rc.local

nginx -t

nginx -s stop

systemctl start nginx.service

nginx -s reload

/usr/sbin/php-fpm

重启php-fpm

kill -USR2 `cat /run/php-fpm/php-fpm.pid`

# 启动

service php-fpm start

# 关闭

service php-fpm stop

# 重启

service php-fpm restart

# 重载

service php-fpm reload

#检查配置文件

service php-fpm configtest

星期六, 06/20/2020 - 05:30 — 杨超