服务器基础配置(Redhat/CentOS)

当给服务器安装好系统后,还需要做一些日常配置,才能保证其正常运行:

基础配置

  • 网络
    • /etc/sysconfig/network-scripts 路径下配置eth0,eth1,lo等
  • DNS
    • /etc/resolv.conf
      • nameserver 8.8.8.8
  • selinux关闭
    • /etc/selinux/config(SELINUX=disabled)
  • 系统参数配置
    • /etc/security/limits.conf
    • /etc/sysctl.conf(内核参数)
  • 用户和用户组
    • 添加必要的用户和组,如mysql,www,nagios等
    • 修改权限(chattr +i)
  • rsync/ssh 免密码登录
  • 计划任务
    • ntpdate设置同步时间,ntpdate 202.120.2.101 pool.ntp.org
    • 日志滚动/删除(nginx,php日志)
  • 防火墙开启
  • nfs挂载
  • 中文安装字体(/usr/share/fonts/chinese)

jdk

  • 安装顺序由低版本至高版本(/usr/java)
    • rpm 安装jdk-7u9和jdk-7u21
    • chmod +x jdk-7u9-linux-x64.rpm/jdk-7u21-linux-x64.rpm
    • rpm -ivh jdk-7u9-linux-x64.rpm/jdk-7u21-linux-x64.rpm

安装依赖库 (php和nginx等安装需要)

  • pcre,zlib,openssl,libunwind,curl,freetype,gettext,ImageMagick,jepg,libevent,libmcrypt,libmemcached,libpng,libxml,scws,tokyocabinet,tokyotyrant

openresty

  • 添加插件:google_perftools和http_stub_status_module
  • 编译参数:

    ./configure  --prefix=/web/openresty --user=www --group=www  --with-luajit  --without-http_redis2_module  --with-http_postgres_module --with-http_iconv_module   --with-google_perftools_module  --with-pcre=/root/web/nginx/pcre-8.36 --with-pcre-jit   --with-zlib=/root/web/nginx/zlib-1.2.8  --add-module=../ngx_cache_purge-2.3 --with-http_stub_status_module
  • 安装与配置

    • nginx/conf

php

  • php版本安装

    • 编译参数:
      ./configure  --prefix=/web/php --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-jpeg-dir=/web/jpeg6 --with-png-dir=/web/libpng2 --with-freetype-dir=/web/freetype2 --with-zlib-dir=/web/zlib --disable-ipv6 --enable-sockets --disable-debug --with-config-file-path=/web/php/lib --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-sysvmsg --enable-sysvshm --enable-mbregex --enable-mbstring --with-bz2=/usr --with-libxml-dir=/web/libxml2 --with-curl=/web/curl --enable-gd-native-ttf --with-openssl --with-mhash --with-xmlrpc --enable-zip --enable-soap --without-pear --enable-fpm --with-libdir=lib64
  • php扩展安装 (*.so文件)

    • 路径:/web/php/lib/php/extensions/no-debug-non-zts-20131226
    • apcu, blite, gd, igbinary, imagick, mcrypt, memcached, memcache, mongo, opcache, qqwry, redis, scws, tokyo_tyrant
  • 配置文件修改
    • /web/php/lib/php.ini
    • /web/php/etc/php-fpm.conf
    • /etc/init.d/php-fpm(用于启动相关项)

mysql

监控部署

  • nagios
    • 安装:xintd,nagios-plugins,nrpe
    • 配置:/etc/services和/etc/xinetd.d/nrpe
    • 监控项:/web/nagios/etc/nrpe.cfg
    • 添加插件:/web/nagios/libexec下添加监控脚本(mysql主从,nginx和php连接数等)
  • cacti
    • 安装:snmp
    • 配置:/etc/snmp/snmpd.conf

缓存

  • memcached
  • redis
  • twemproxy(代理)

队列

  • UCmq
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值