您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 销售管理 > Linux服务器系统常用服务器配置手册
Linux服务器系统常用服务器配置手册1.目录.………………………………………………………………………………………………………………………………………12.综述.………………………………………………………………………………………………………………………………………13.系统约定.………………………………………………………………………………………………………………………………4.数据库服务.……………………………………………………………………………………………………………………4.1Mysql.…………………………………………………………………………………………………………………………4.2Oracle.………………………………………………………………………………………………………………………5.Web服务5.1Apache安装过程5.2PHP安装过程5.3PHP和apache的整合5.4eAccelerator安装过程5.5eAccelerator和PHP的整合5.6Resin安装过程5.7Resin和apache的整合5.8jdk安装配置过程6.FTP服务6.1Vsftp7.域名解析服务8.邮件服务9.CDN一、综述此手册主要通过大家日常实际维护过程中整理补充,为了规范配置要求,提高大家效率,手册主要内容为Linux系统中的各种服务安装以及常用配置,相关服务以及更多的配置说明可以以提供WEB连接或者附属文档的形式提现。二、系统约定为便于大家沟通协作,对日常维护中的系统操作进行规范要求:软件源码包放置位置:/opt/software源码包编译安装位置:/usr/local/software_name脚本以及维护程序存放位置:/usr/local/sbinMYSQL安装路径:/usr/local/mysqlApache虚拟主机根目录:/home/httpd/html/可根据实际情况三、系统环境部署及调整3.1.检查系统是否正常#more/var/log/messages(检查无系统级错误信息)#dmesg(检查硬件设备是否有错误信息)#ifconfig(检查内外网卡设置是否正常)#vi/etc/resolv.conf(检查DNS是否设置正确)3.2.关闭不需要服务atdcrondirqbalancenetworksshdsyslogsysstat3.3.配置sshd服务#vi/etc/ssh/sshd_config修改#Protocol2,1为Protocol2(禁用SSHV1协议)修改#UseDNSYES为UseDNSno3.4.修改主机名#hostname主机名#vi/etc/hosts#添加主机名127.0.0.1localhost.localdomainlocalhost主机名#vi/etc/sysconfig/network#修改主机名HOSTNAME=主机名重启服务器四、数据库服务4.1.MYSQL安装配置过程Mysql版本:mysql-5.1.22-rc-linux-x86_64-icc-glibc234.1.1.#解压源码包#tar-zxvfmysql-5.1.22-rc-linux-x86_64-icc-glibc23.tar.gz4.1.2.#拷贝mysql到/home下#mvmysql-5.1.22-rc-linux-x86_64-icc-glibc23/home/4.1.3.#创建/usr/local/mysql链接到/home下的mysql程序目录#ln-s/home/mysql-5.1.22-rc-linux-x86_64-icc-glibc23/usr/local/mysql4.1.4.#创建Mysql用户组和用户#groupaddmysql#useraddmysql-gmysql4.1.5.为mysql安装目录配置权限#cd/usr/local/mysql#chown-Rroot.#chown-Rmysqldata#chgrp-Rmysql.4.1.6.#初始化数据库#scripts/mysql_install_db--user=mysql#/usr/local/mysql/bin/mysqld_safe--user=mysqlcpsupport-files/mysql.server/etc/rc.d/init.d/mysqld4.1.7.#给与/etc/rc.d/init.d/mysqld执行权限(如果没有)#chownroot:root/etc/rc.d/init.d/mysqld#chmod755/etc/rc.d/init.d/mysqld4.1.8.#拷贝my.cnf文件#cp/etc/my.cnf/etc/my.cnf.bak(备份)#cp./support-files/my-huge.cnf/etc/my.cnf4.1.9.启动mysql测试#/etc/init.d/mysqldstart#设置MYSQL密码#/usr/local/mysql/bin/mysqladmin-urootpassword密码2.Oracle数据库安装配置五、Web服务以apache为中心,整理相关服务的安装与配置以及apache的整合说明。5.1.apache安装过程apache版本:httpd-2.2.6#解压#tar-xjvfhttpd-2.2.6.tar.bz2#cdhttpd-2.2.6#编译./configure--prefix=/usr/local/apache2--with-mpm=worker--enable-so--enable-rewrite--enable-expires--enable-headers--enable-deflate--disable-actions--disable-userdir--disable-imap--disable-cgi--disable-asis--disable-autoindex#make#makeinstall#加入自启动项#echo'/usr/local/apache2/bin/apachectlstart'/etc/rc.local5.2.php安装配置php版本:php-5.2.5#解压#tar-zvxfphp-5.2.5.tar.gz#cdphp-5.2.5#编译(apach)--with-apxs2=/usr/local/apache2/bin/apxs./configure--prefix=/usr/local/php5--with-mysql=/usr/local/mysql--with-png-dir--with-gd--with-iconv--with-jpeg-dir=/usr/lib64--with-zlib--with-mcrypt-enable-soap-enable-fastcgi-enable-force-cgi-redirect-enable-mbstring#make#makeinstall#chcon-ttexrel_shlib_t/usr/local/mysql/lib/libmysqlclient.so.16#cpphp.ini-dist/usr/local/php5/lib/php.ini5.3.1.PHP和apache的整合#cpphp.ini-dist/usr/local/php5/lib/php.ini#vi/usr/local/apache2/conf/httpd.conf找到:AddTypeapplication/x-gzip.gz.tgz在该行下面添加AddTypeapplication/x-httpd-php.phpAddTypeapplication/x-httpd-php-source.phps重启apache,编写测试文件:PHP?phpphpinfo();?加载mod_rewrite模块2个方法:1、重新编译apache,并在原来编译的内容中加--enable-rewrite=shared2.进入apache编码包路径,按以下顺序进行操作:编译mod_rewrite.so模块,执行后将在apache源码包以下目录生成./modules/mappers/.libs/mod_rewrite.so/usr/local/apache2/bin/apxs-cmodules/mappers/mod_rewrite.c-lgdbm让apache的apxs来自动向http.conf配置文件中加入LoadModule语句并将mod_rewrite.so文件拷贝到/usr/local/apache2/modules/目录/usr/local/apache2/bin/apxs-i-A-nrewritemodules/mappers/.libs/mod_rewrite.so编辑httpd.conf文件,开启mod_rewrite.so模块/usr/local/apache2/conf/httpd.conf进入后查找LoadModulerewrite_modulemodules/mod_rewrite.so将前面的注释符号#删除,并重启apache服务器5.3.2eAccelerator安装过程eaccelerator版本:eaccelerator-0.9.5.3.tar.bz2解压:#tar-xjvfeaccelerator-0.9.5.3.tar.bz2#exportPHP_PREFIX=/usr/local/php5(指定php所在路径)#$PHP_PREFIX/bin/phpize#编译#./configure--enable-eaccelerator=shared--with-php-config=$PHP_PREFIX/bin/php-config#make#makeinstall5.3.3eAccelerator和PHP的整合编译eAccelerator后会提示生成一个目录,如Installingsharedextensions:/usr/local/php5/lib/php/extensions/no-debug-zts-20060613/,将其下的eaccelerator.so拷贝到/usr/local/bin/#cp/usr/local/php5/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so/usr/local/bin/在php.ini中加入以下extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.soeaccelerator.shm_size=16eaccelerator.cache_dir=/tmp/eacceleratoreaccelerator.enable=1eaccelerator.optimizer=1eaccelerator.check_mtime=1eaccelerator.debug=0eaccelerator.filter=eaccelerator.shm_max=0eaccelerator.shm_ttl=0eaccelerator.shm_prune_period=0eaccelerator.shm_only=0eaccelerator.compress=1eaccelerator.compress_level=9修改extension_dir=./为extension_dir=/#mkdir/tmp/eaccelerator#chmod777/tmp/eaccelerator检查是否加载成功#/usr/local/php5/bin/php–m重启apache,即可5.4Resin安装过程Resin版本:resin-pro-3.0.17.tar.gz#解压#tzr-zvxfresin-pro-3.0.17.tar.gz#cdresin-pro-3.0.
本文标题:Linux服务器系统常用服务器配置手册
链接地址:https://www.777doc.com/doc-1579645 .html