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

用户登录

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

网卡在/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;

}

}

nginx -t

nginx -s stop

systemctl start nginx.service

nginx -s reload

 

yum -y install epel-release

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

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum search php7

yum -y install php72w-bcmath.x86_64 php72w-cli.x86_64 php72w-common.x86_64 php72w-dba.x86_64 php72w-devel.x86_64 php72w-embedded.x86_64 php72w-enchant.x86_64 php72w-fpm.x86_64 php72w-gd.x86_64 php72w-imap.x86_64 php72w-interbase.x86_64 php72w-intl.x86_64 php72w-ldap.x86_64 php72w-mbstring.x86_64 php72w-mysql.x86_64 php72w-odbc.x86_64 php72w-opcache.x86_64 php72w-pdo.x86_64 php72w-pdo_dblib.x86_64 php72w-pear.noarch php72w-pecl-apcu.x86_64 php72w-pecl-apcu-devel.x86_64 php72w-pecl-geoip.x86_64 php72w-pecl-igbinary.x86_64 php72w-pecl-igbinary-devel.x86_64 php72w-pecl-imagick.x86_64 php72w-pecl-imagick-devel.x86_64 php72w-pecl-libsodium.x86_64 php72w-pecl-memcached.x86_64 php72w-pecl-mongodb.x86_64 php72w-pecl-redis.x86_64 php72w-pecl-xdebug.x86_64 php72w-pgsql.x86_64 php72w-phpdbg.x86_64 php72w-process.x86_64 php72w-pspell.x86_64 php72w-recode.x86_64 php72w-snmp.x86_64 php72w-soap.x86_64 php72w-sodium.x86_64 php72w-tidy.x86_64 php72w-xml.x86_64 php72w-xmlrpc.x86_64 mod_php71w

遇到imagick的问题,直接把两个包删除不安装了。

 

 

启动php

/usr/sbin/php-fpm

nginx.conf的server中加入

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;

}

重启php-fpm

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

 

yum -y install epel-release

yum install redis

service redis start

rpm -ql redis

redis-cli --version

设置为开机自动启动:

chkconfig redis on

或者

systemctl enable redis.service

 

主redis配置/etc/redis.conf

logfile /home/logs/redis/redis.log

daemonize yes

bind 10.1.3.43

databases 16

/usr/bin/redis-server /etc/redis.conf &

 

从redis配置/etc/redis.conf

logfile /home/logs/redis/redis.log

daemonize no

bind 127.0.0.1

databases 16

 

xunsearch

cd /home

wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2

tar -xjf xunsearch-full-latest.tar.bz2

cd xunsearch-full-1.3.0/

sh setup.sh

mkdir xunsearch

cd xunsearch-full-1.3.0

sh setup.sh

/home/xunsearch

vi /etc/rc.local

/home/xunsearch/bin/xs-ctl.sh restart

 

星期二, 08/06/2019 - 12:28 — 杨超