
LINUX 系统安装规范
|
LINUX系统安装规范 5.配置时间同步:a. 每天5:10 AM跟时间服务器172.16.0.60作一次同步 b. 该配置在“配置cron”部分完成 6.配置/etc/hosts 文件: a. 配置:#install config/hosts /etc/hosts b. 验证:#cat /etc/hosts 127.0.0.1 localhost.localdomain localhost x.x.x.x loghost.xx.com loghost x.x.x.x software.xx.com software x.x.x.x 7.配置内核参数:a. 配置:#install config/sysctl.conf /etc/sysctl.conf; sysctl -p #cat /etc/logrotate.d/syslog postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true endscript } 9. 脚本:1). 目录结构:/opt/script/prod: 存放经过严格测试的(在使用中的)脚本 /opt/script/test: 编写,测试脚本的地方 f. 编译选项: --prefix=$MYSQL_HOME --sysconfdir=/etc --localstatedir=$MYSQL_HOME/data --with-mysqld-user=mysql --enable-largefile --with-charset=gb2312 --with-extra-charsets=gbk,utf8 g. 启动选项:skip-innodb=1log-bin=$MYSQL_HOME/log/mysql-bin log-bin-index=$MYSQL_HOME/log/mysql-bin.index log=$MYSQL_HOME/log/access.log log-error=$MYSQL_HOME/log/error.log pid-file=$MYSQL_HOMElog/mysql.pid h. 自动启动脚本:使用MySQL自带的脚本mysql.server,将其拷贝 为/etc/init.d/mysql i. 运行脚本 script/install_mysql.sh完成MySQL的安装配置4). Apache::a. APACHE_HOME=/opt/apache-<version> b. 数据, 日志和配置文件目录:默认位置 c. 模块:authn-basic authn-default authn-file authz-default authz-host authz-groupfile authz-user access dir env http log-config mime setenvif status cache disk-cache expires file-cache headers logio mem-cache mime-magic rewrite so worker (httpd –l 可以验证安装了那些模块) d. MPM模式:workere. 配置文件:将定制的配置文件config/httpd.conf拷贝到$APACHE_HOME/conf/ 下, 如果需要作修改,在该文件的相应位置修改。 f. 自动启动脚本:将定制的脚本script/apache.sh 拷贝为/etc/init.d/apache g. 运行脚本 script/install_apache.sh完成Apache的安装配置 5). resin: a. RESIN_HOME= /opt/resin-<version> b. 数据, 日志和配置文件目录:默认位置 c. 编译选项:--enable-jni --enable-linux-smp --enable-64bit –with-apxs=$APACHE_HOME/bin/apxs e. 启动选项: f. 配置文件:将定制的配置文件config/resin.conf 拷贝到$RESIN_HOME/conf/下, 如果需要作修改,在该文件的相应位置修改。 g. 自动启动脚本:将定制脚本script/resin.sh 拷贝为/etc/init.d/resin h. 运行脚本 script/install_resin.sh完成Resin的安装配置 6). JAVA 应用程序:a. 安装点:/opt/java_app b. 将每个应用程序放到/opt/java_app目录下的以该应用程序名称命名的目录下 7). 配置环境变量:a. 将JAVA_HOME, MYSQL_HOME, RESIN_HOME, APACHE_HOME 加入/etc/profile b. 将$JAVA_HOME/bin, $MYSQL_HOME/bin, $RESIN_HOME/bin, $APACHE_HOME/bin 加入/etc/profile c. 运行定制的脚本script/config_env.sh完成配置 8. 备份:a. 工具:rsync b. 方法:incremental c. 备份源:/opt目录下除backup目录和不需要备份的java 应用程序日志目录外的所有目录 d. 目的地:backcenter.xx.com上的目录 /backup/<本机的外部IP>; 本地的/opt/backup/下 e. 时间:每天的凌晨5点10分(需要根据备份中心的设定作相应调整) f. 运行脚本script/config_backup.sh完成备份配置; 9. 配置cron:a. 内容:备份; 时间同步; 进程, DISK, CPU, MEM监控; 应用程序日志处理 b. 运行脚本 script/config_cron.sh 完成cron 配置 10. 配置安全:1). 关闭除以下服务外的所有服务: syslog, network, sshd, crond, mysql, resin, apache 2). 修改sshd默认的端口(65522) 3). 防火墙:使用定制的脚本script/my_iptables.sh, 将其拷贝为/etc/init.d/my_iptables, 拷贝config/my_iptables.conf 拷贝到/etc/rc.d/下,并根据应用的需要作相应 修改,然后执行chkconfig my_iptables on 4). 运行脚本script/config_security.sh 完成安全配置; 建议:用kickstart 方式安装 |
一共有 0 条评论