Postfix邮件服务器_+_Web界面安装全过程
CentOS上安装配置Postfix + Extmail 邮件服务系统

RHEL/CentOS上安装配置Postfix + Extmail 邮件服务系统一、文档简介:本文以最简单方便的方法在centos 5.2 上安装全功能邮件系统,此文适合REDHAT所有系列,在文中,能用RPM 安装的,我们将采用rpm 安装,如果rpm没有的,我们将创建自己的rpm。
部分软件简介:1、AMP ---apache(web服务) 、mysql(数据库)、php(非必需) 的简称2、postfix --mta 邮件系统核心3、courier-authlib--一个为courier-imap,maildrop,sasl2 提供用户信息的后台进程序4、courier-imap --提供pop3,pop3s,imap,imaps 服务的程序5、amavisd-new --提供内容过滤6、clamav -- 著名的杀毒软件7、extmail --一个著名的webmail程序8、extman --与extmail集成的后台管理程序9、slockd --一个基于smtp阶段的反垃圾邮件程序10、vhmgr --由本文作者编写,用于管理apache,ftp,mysql 的虚拟主机管理程序。
安装环境:centos 5.2域名机器名:域名:二、安装系统安装系统时,选择“customize software selection”(自定义安装),在package group selection 对话框里选择:[*]base[*]devlopment libraries[*]development tools[*]editors[*]text-base internet其它不选择。
在setup agnet(或进入系统后运行setup) 里选择firewall configuration 将security level 与SELinux 改为disabled,目的是为了避免在安装调试时产生不必要的麻烦,在系统安装完成后,可以自己去调试安全部分,在这里将不作详细介绍。
postfix安装手册

基于 Postfix 邮件系统安装手册y sy2011年七月目 录一. 基础知识介绍和基本软件安装与配置 (5)1.1 E-Mail系统基础知识 (5)1.2 软件介绍 (6)1.3 postfix与其他组件之间的关系 (7)1.4 安装基本系统 (7)1.5 安装方法小结 (9)二. 安装postfix (10)2.1 编译postfix的RPM包方并安装 (10)2.2 查看postfix支持的特性 (11)2.3 简单postfix配置 (12)2.4 启动与停止postfix (13)2.5 常用postfix命令 (14)2.6 SASL身份验证 (16)三. 安装 dovecot (21)3.1 编译Dovecot的RPM包方并安装 (21)3.2 配置文件dovecot (22)3.3 启动与停止 dovecot (23)3.4 Dovecot 日志设置 (24)3.5 使用本地用户测试收发邮件 (25)3.6 安装 dovecot-sieve 和 dovecot-managesieve (28)3.7 小结 (29)四. 虚拟域和虚拟用户配置 (30)4.1 安装PostfixAdmin (30)4.2 配置dovecot支持虚拟域 (35)4.3 配置postfix支持虚拟域 (37)4.4 使用虚拟用户进行收发邮件测试 (40)4.5 使用虚拟用户邮箱配额限制 (42)4.6 小结 (44)五. 安装反病毒和反垃圾邮件模块 (45)5.1 安装Clamav (45)5.2 安装 SpamAssassin模块 (46)5.3 安装 MailScanner 模块 (47)5.4 配置反垃圾邮件和反病毒模块 (47)5.5 安装MailWatch (52)5.6 小结 (58)六. 安装Web Mail (59)6.1 准备工作 (59)6.2 安装 Roundcubemail (59)6.3 配置 apache (60)6.4 配置 Roundcubemail配置插件 (61)七. 配置 SMTP/POP3/HTTP 的TLS功能 (64)7.1 配置 OpenSSL (64)7.2 配置 Postfix 支持TLS (67)7.3 配置 Dovecot 支持TLS (68)7.4 配置 Apache 支持TLS (68)7.5 收发邮件TLS (69)八. 日志管理 (72)8.1 安装mailgraph (72)8.2 安装awstats (74)九. 备份系统 (79)9.1 备份系统文件 (79)9.2 邮件系统配置 (79)9.3 数据备份 (79)参考文献 (81)序言从事了多年的网络和Linux系统的管理工作,把自己的经验拿出来和大家一起分享。
POSTFIX系列之安装部署文档

POSTFIX系列之安装部署/QQ:598199305Darrenpan2012/11/16POSTFIX系列之安装部署一、系统运行环境1.1系统版本:Description: Red Hat Enterprise Linux Server release 5.4 (Tikanga)Release: 5.4 x86_641.2 软件版本:二、准备工作1、关闭selinuxiptables(过程略)2、关闭iptables(过程略)3、卸载或禁用sendmail(过程略)4、网络设置# vim /etc/sysconfig/network修改-->HOSTNAME=# vim /etc/resolv.conf修改-->search 三、Postfix邮件系统各个组件的安装与配置3.1 安装http、php# yum -y install httpd php php-mysql php-gd php-imap php-mbstring php-ldap# /etc/init.d/httpd start# chkconfig httpd on3.2 安装所依赖的perl软件包# yum -y install perl-Digest-SHA1 perl-Digest-HMAC perl-Net-IP perl-Net-DNS perl-HTML-Tagset perl-HTML-Parser perl-libwww-perl perl-IO-stringy perl-IO-Multiplex perl-Net-SSLeay-1.30 perl-IO-Socket-SSL perl-Net-Server perl-TimeDate perl-MailTools perl-MIME-Base64 perl-Convert-BinHex perl-MIME-tools perl-Convert-TNEF perl-Convert-UUlib perl-Compress-Zlib perl-Archive-Zip perl-IO-Zlib perl-Archive-Tar3.3 安装openldap及配置、初始化# yum install openldap* -y3.3.1 openldap初始设置Openldap的配置文件位于/etc/openldap目录下,主要的配置文件有slapd.conf和ldap.conf。
postfixadmin安装手册

postfixadmin安装手册postfixadmin安装postfix安装非常简单6-1:前提postfix2.0以上apache1.3.27以上php5.1.2以上mysql3.23以上6-2:下载postfixadmin$tar-zxvfpostfixadmin-2.2.0.tgz6-4、布局postfixadmin的数据库布局viconfig.inc.php将如下$conf['configured']=false;$conf['default_language']='en';换成:$conf['configured']=true;$conf['default_language']='cn';//采用中文ui修正数据库布局将如下$conf['database_type']='mysql';$conf['database_host']='localhost';$conf['datab ase_user']='postfix';$conf['database_password']='postfixpassword';$conf['database_name']='postfix';换成$conf['database_type']='mysql';$conf['database_host']='localhost';$conf['database_user']='postfix';//需用的数据库帐号$conf['database_password']='system';//可用的数据库密码$conf['database_name']='vmail';//采用尚无的通过iredmail建立出的库修正管理员邮箱地址$conf['admin_email']='********************';//当前域管理员邮箱地址开启邮箱大小配额功能将如下$conf['quota']='no';$conf['quota_multiplier']='1024000';$conf['used_quotas']='no';$conf['new_quota _table']='no';改成$conf['quota']='yes';$conf['quota_multiplier']='1';//iredmail配置的postfix邮箱配额单位mb,所以在此使用1$conf['used_quotas']='yes';$conf['new_quota_table']='yes';修正每页表明数量将如下$conf['page_size']='10';换成$conf['page_size']='20';6-9:由于postfixadmin与iredmail就是单一制加装后再资源整合,因此可以存有一些问题,须要另外手动展开调整,主要发生以下2个问题如下:if($conf['quota']=='yes'){print\\if($tmailbox[$i]['quota']==0){print$palang['poverview_unlimited'];}elseif($tmailbox[$i]['quota']<0){print$palang['poverview_disabled'];}else{if(boolconf('used_quotas'))printdivide_quota($tmailbox[$i]['current']).'/';printdivide_quota($tmailbox[$i ]['quota']);}print\}改成if($conf['quota']=='yes'){print\\if(boolconf('used_quotas'))printdivide_quota($tmailbox[$i]['current']).'/';if($tmailbox[$i]['quota']==0){print$palang['poverview_unlimited'];}elseif($tmailbox[$i]['quota']<0){print$palang['poverview_disabled'];}else{printdivide_quota($tmailbox[$i]['quota']);}print\}if(boolconf('used_quotas')&&boolconf('new_quota_table')){$sql_select.=\$sql_jo in.=\leftjoin$table_ername=$table_ername\}改成if(boolconf('used_quotas')&&boolconf('new_quota_table')){$sql_select.=\#$sql_s elect.=\#$sql_join.=\leftjoin$table_ername=$table_ername\}$table_quota2$table_quota2onon。
Linux网络服务配置-Postfix邮件系统(二)

查询、收取新邮件
17/28
其他扩展设置2-1
通过别名设置邮件组
一般使用 /etc/aliases 文件 aliases文件的记录格式
• 别名: 地址1, 地址2, 地址3, ……
执行newaliases命令,以更新别名设置 1.指定查询表存放位置
[root@mail ~]# vi /etc/postfix/main.cf …… alias_maps = hash:/etc/aliases [root@mail ~] # postfix reload 2.配置别名查询表 [root@mail ~]# vi /etc/aliases postfix/postfix-script: refreshing the Postfix mail system …… student:zhangsan, lisi, mike, john teacher:vicky, tsengyia 3.更新别名数据库 [root@mail ~]# newaliases
8/28
测试SMTP发信认证2-2
测试SMTP发信认证——Outlook2007
通过”工具”“账户设置” “发送服务器”,勾选“我 的发送服务器(SMTP)要求验证”
使用SMTP认证
未使用SMTP认证
9/28
小结
请思考:
如何启用Postfix的SMTP认证功能? 配置参数smtpd_recipient_restrictions的功能是什么?
22/28
实验案例:配置Postfix扩展功能3-2
学员练习1
创建SASL配置文件,并启动saslauthd服务 添加Postfix对SMTP认证的支持,并测试
linux下安装postfix邮件系统(二)

linux下安装postfix邮件系统(二)5.安装postfix 2.2.3如果你的系统上原来有sendmail,先将其停止并将其文件改名:# /etc/init.d/sendmail stop# chkconfig --level 0123456 sendmail off# mv /usr/bin/newaliases /usr/bin/newaliases.orig# mv /usr/bin/mailq /usr/bin/mailq.orig# mv /usr/sbin/sendmail /usr/sbin/sendmail.orig开始安装# groupadd -g 12345 postfix# useradd -u 12345 -g 12345 -c postfix -d/dev/null -s/bin/false postfix# groupadd -g 54321 postdrop# wget ftp:///postfix/official/postfix-2.2.3.tar.gz# tar -zxvf postfix-2.2.3.tar.gz# cd postfix-2.2.3(Building Postfix with SASL authentication and mysql support) # make -f Makefile.init makefiles \'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -I/usr/local/include/sasl' \'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm -L/usr/local/lib -lsasl2'# make install如果/etc/aliases文件不存在,请用如下命令创建:# echo postfix: root >> /etc/aliases# /usr/bin/newaliases注意:本例中Mysql安装在/usr/lcoal/mysql,sasl2安装在/usr/lib/sasl2。
postfix架构Webmail
一:修改主机名:[rootlyt ~]# vim /etc/sysconfig/network[rootlyt ~]# vim /etc/hosts[rootlyt ~]# service sendmail stop[rootlyt ~]# chkconfig sendmail off #关闭sendmail[rootlyt ~]# init 6 #重启计算机二:搭建dns服务器:[rootmail ~]# mkdir /mnt/cdrom #新建挂载点[rootmail ~]# mount /dev/cdrom /mnt/cdrom/ #挂载光盘[rootmail ~]# cd /mnt/cdrom/Server/[rootmail Server]# rpm -ivh bind-9.3.6-4.P1.el5.i386.rpm #安装dns主程序[rootmail Server]# rpm -ivh bind-chroot-9.3.6-4.P1.el5.i386.rpm #安装与dns安全相关的软件包[rootmail Server]# rpm -ivh caching-nameserver-9.3.6-4.P1.el5.i386.rpm #安装与缓存相关的软件包[rootmail Server]# cd /var/named/chroot/etc/[rootmail etc]# cp -p named.caching-nameserver.conf named.conf [rootmail etc]# vim named.conf #编辑dns的主配置文件[rootmail etc]# vim named.rfc1912.zones #编辑dns区域声明文件[rootmail etc]# cd ../var/named/[rootmail named]# cp -p localhost.zone 163..db[rootmail named]# vim 163..db #编辑数据库文件[rootmail named]# vim /etc/resolv.conf[rootmail named]# service named start #启动dns[rootmail named]# chkconfig named on #设置开机自动启动三:搭建postfix:[rootmail named]# cd /mnt/cdrom/Server/[rootmail Server]# rpm -ivh postfix-2.3.3-2.1.el5_2.i386.rpm #安装postfix软件包[rootmail Server]# vim /etc/postfix/main.cf #编辑postfix主配置文件除了以上截图外,还需要添加以下容:broken_sasl_auth_clients = yes #客户端需要经过身份验证smtpd_sasl_auth_enable = yes #客户端需要经过身份验证smtpd_sasl_security_options = noanonymous #不允许匿名发送smtpd_sasl_application_name = smtpdsmtpd_client_restrictions = permit_sasl_authenticated,reject #发送方需要经过认证,没经过认证的拒绝#smtpd_client_restrictions = permit_sasl_authenticatedsmtpd_recipient_restrictions =permit_mynetworks,permit_sasl_authenticated,reject_unauth_destinatio n #接收本地network的,经过认证的,非认证的拒绝[rootmail Server]# service saslauthd start #启动sasl验证功能[rootmail Server]# chkconfig saslauthd on #设置为开机自动启动[rootmail Server]# service postfix start[rootmail Server]# chkconfig postfix on四:安装squirrelmail:[rootmail Server]# vim /etc/yum.repos.d/rhel-debuginfo.repo #编辑yum[rootmail Server]# yum install squirrelmail –y #安装squirrel [rootmail Server]# service httpd start #启动httpd[rootmail Server]# chkconfig httpd on #设置开机自动启动[rootmail Server]# cd /var//html/[rootmail html]# ln -s /usr/share/squirrelmail/ mail #创建符号连接mail[rootmail html]# cd[rootmail ~]# cd /var//html/mail/[rootmail mail]# cd config/[rootmail config]# ./conf.pl #对web页面进行设置[rootmail config]# vim /etc/httpd/conf/httpd.conf #修改apache的配置文件[rootmail config]# service httpd restart五:安装dovecot:[rootmail config]# cd /mnt/cdrom/Server/[rootmail Server]# yum install dovecot –y #使用yum安装dovecot [rootmail Server]# service dovecot start[rootmail Server]# chkconfig dovecot on六:创建用户:[rootmail Server]# useradd user1 [rootmail Server]# passwd user1 [rootmail Server]# useradd user2 [rootmail Server]# passwd user2七:禁用此行:[rootmail Server]# vim /etc/postfix/main.cf[rootmail Server]# service postfix restart。
邮件服务器安装和配置
邮件服务器安装和配置概述邮件服务器是一种用于发送、接收和存储电子邮件的软件系统。
在企业和个人日常沟通中,邮件服务器发挥着重要的作用。
本文将介绍如何安装和配置邮件服务器。
步骤一:选择邮件服务器软件在安装和配置邮件服务器之前,需要选择合适的邮件服务器软件。
常见的邮件服务器软件有以下几种:1.Postfix:一个流行的开源邮件服务器软件,易于安装和配置,具有良好的安全性和性能。
2.Sendmail:一种经典的邮件传输代理(MTA),可靠且功能强大,但配置复杂。
3.Exim:一个易于配置的邮件服务器软件,支持多种邮件协议和扩展。
4.Microsoft Exchange Server:适用于Windows环境的商业邮件服务器软件,具有广泛的功能和集成性。
在选择邮件服务器软件时,需要考虑操作系统兼容性、安全性、功能需求和配置复杂性等因素。
步骤二:安装邮件服务器软件在选择了合适的邮件服务器软件后,接下来需要安装它。
以下是一般的安装步骤:1.下载邮件服务器软件的安装包。
可以从官方网站或开源软件社区下载最新版的安装包。
2.解压安装包并进入解压后的目录。
3.执行安装命令,根据提示完成安装过程。
安装命令可能因不同的软件而有所不同,一般需要使用管理员权限来执行。
4.检查安装是否成功。
可以使用命令行工具或图形界面来验证安装是否成功。
步骤三:配置邮件服务器在成功安装邮件服务器软件后,需要进行相应的配置,以确保其正常运行。
以下是一般的配置步骤:1.打开配置文件。
不同的邮件服务器软件使用不同的配置文件,一般位于安装目录下的/etc或conf子目录中。
2.根据需求修改配置文件。
配置文件包含了各种配置选项,例如网络设置、域名配置、认证方式、存储路径等。
根据具体需求进行修改。
3.保存并关闭配置文件。
在修改完配置文件后,保存并关闭文件。
4.重启邮件服务器。
根据具体的邮件服务器软件,执行相应的命令来重启邮件服务器。
5.检查邮件服务器的运行状态。
Linux下的Postfix邮件服务器
Linux下的邮件服务器Postfix(一)在Linux下1、挂载光驱建立DNS服务器的MX记录:正向:反向:2、创建用户和密码:看一下邮箱邮件默认保存在这里:3、安装Postfix包,开启Postfix服务:4、关闭sendmail服务:5、编辑/etc/postfix/main.cf文件找到这几项修改其余不改:myhostname = 邮件主机的完整名称mydomain = 邮件主机域名myorigin = $mydomain(表示所有)设置发件人邮件地址的网域名inet_interfaces = all (表示监听所有端口)监听端口【把下面的inet_interfaces=localhost注释掉】mydestination = $myhostname, $mydomain(表示所有)指定接收邮件时收件人的域名mynetworks = 192.168.1.0/24, 127.0.0.0/8(192.168.1.0/24表示这个网段,127.0.0.0/8表示本地)设置可以为其转发邮件的网络relay_domains = $mydestination(表示所有)设置可以为其转发邮件的域名6、重新启动服务:7、验证:发信:#telnet 25 telnet到邮件服务器的25号端口helo 用helo或ehlo介绍自己(可以不写)mail from:li@ 发信人地址rcpt to:gen@ 收件人地址data 表示开始输入邮件正文Hello! 邮件正文.新起一行以“.”表示正文结束quit 退出telnet收信:Linux下的邮件服务器Postfix(二)windows下第三方软件在(一)的基础上作:1、安装软件包dovecot、perl-DBI和mysql:2、修改主配置文件/etc/dovecot.conf3、开启服务重启服务器:4、将windows的首选DNS指向写成DNS服务器IP:5、验证:安装一个收发邮件的软件,然后在用windows自带的邮件收发软件(开始---程序---Outlook Express)互相测试:Windows自带的:工具-----账户-----添加-----邮件------软件安装完后:开始----程序-----找到刚安装的收发邮件的软件Windows Live Mail点开发一封邮件试一下(抄送是同时发给谁):这里有可能被认为是垃圾邮件:再用另一种软件(pine)测试一下:在windows中安装这个软件(这个软件可以在Linux里用但要依赖很多包所以这里只在windows里试一下):再选几个OK或是就进入:点回车:选择S项:选中前四一项一项调(选中后双击可调,回车确定):到li中查看一下:设置Postfix服务器邮件转发和用户的别名在(一)(二)的基础上(这个大致写一下):1、编辑配置文件/etc/aliases文件的记录格式(在最下面添加)用户的别名(假名):用户的真名admin: root 邮件的别名(发给admin也就是发给root)group: user1,user2邮件的群发(发给group也就是发给user1、user2….. user1:root@邮件转发(将发给user1的邮件发给root用户)2、修改aliases文件后更新aliases.db文件postalias hash:/etc/aliases3、刷新服务器。
postfix电子邮件服务器配置
postfix电子邮件服务器配置postfix+dovecot+openwebmail安装设置Postfix实验名称:postfix电子邮件服务器配置实验目的:实现postfix电子邮件服务器的差不多环境配置,在些基础上提高postfix防垃圾邮件能力、防电子邮件包含病毒及爱护postfix 的安全措施〔拒绝服务攻击〕;如何定期地去清理日志及利用工具查看日志,即是:postfix+dovecot+cyrus-sasl+openwebmail/squirrelmail+mailScanner+An tiviru s+spamAssassin(说明:dovecot提供imap、pop3服务(在新版本的redhat linux 中dovecot代替了imap软件包);cyrus-sasl提供认证功能的;openwebmail/squirrelmail差不多上提供webmail 服务,其中squirrelmail是redhat自带的,在第三张光盘;而openwebmail那么是第三方软件;mailScanner看起来是邮件扫描用的,要紧与Antivirus〔防病毒〕结合;spamAssassin是用来处理垃圾邮件的,判定邮件是否为垃圾邮件)实验内容:1.设置服务器的IP地址为10.2.46.129/24,第一DNS为10.2.46.129,关闭防火墙〔便于测试〕2.安装dns服务器所需要的软件包:bind-utils〔第一张光盘〕、bind、bind-libs〔第一张光盘〕、bind-chroot〔第二张光盘〕、caching-nameserver 〔第四张光盘〕3.配置dns服务器的主机记录、邮件记录及测试4.安装postfix〔第三张光盘〕和postfix-pflogsumm(依靠于perl-Date-Cal c→perl-Bit-Vecto r→perl-Carp-Clan)软件包---------所有包都在第二张光盘5. dovecot及cyrus-sasl(Cyrus-sasl的功能确实是实现密码验证机制)一样在系统安装时,都安装上去了6.配置postfix的主配置文件main,cf及其它文件的配置,如:virtual、access〔访问文件〕、master.cf〔操纵文件〕7.安装openwebmail/squirrelmail、mailScanner、Antivirus、spamAssassin及它们相关的配置8.在实验中遇到的问题时,如何解决,记录解决的方法,做好实验的总结实验过程:一、设置服务器的IP地址,关闭iptables及SE linux#service network restart #service iptables restart #ifconfig eth0二、DNS配置#vi named.conf #vi named.zones #vi 123.zone#vi 123.local▼DNS测试:先关闭防火墙、selinux,开启dns服务#chkconfig --level 345 named on三、postfix的差不多配置及启用SMTP认证机制1、设置服务器的主机名为mail.123#vi /etc/sysconfig/network#reboot ------重启后主机名确实是mail.123 ,能够用#hostname 来查看2、由于之前用过sendmail,因此在安装启动postfix时,停止sendmail 服务,最好确实是卸载sendmail。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Postfix邮件服务器+ W eb界面安装全过程环境是centos5.4最小化安装,只选择了开发工具与开发库# uname -aLinux 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux关闭SELINUX# system-config-securitylevel-tui或# vi /etc/selinux/config把SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:SELINUX=disabled保存,关闭。
注:只提供参考,实际配置请根据系统环境做修改,本文为手动编写,如有命令或文本编辑错误请谅解,相关配置文件可从以下地址下载;如有问题可发邮件到kswu1983@# wget /postfix/conf.tar.gz垃圾邮件过滤Clamav; amavisd-new; Spamassassin 后续1.安装mysql 5.0.70# groupadd mysql# useradd -g mysql mysql#wget /distfiles/mysql-5.0.70.tar.gz# tar -zxvf mysql-5.0.70.tar.gz# cd mysql-5.0.70# ./configure--prefix=/usr/local/mysql--with-charset=gb2312--enable-thread-safe-client# make# make install# cp support-files/f /etc/f设置自启动# cp support-files/mysql.server /etc/rc.d/init.d/mysqld# chmod 700 /etc/rc.d/init.d/mysqld# chkconfig --add mysqld安装完以后要初始化数据库,要是升级安装的请跳过# cd /usr/local/mysql# /usr/local/mysql/bin/mysql_install_db --user=mysql# chown -R root .# chown -R mysql var# chgrp -R mysql .# /usr/local/mysql/bin/mysqld_safe --user=mysql &好了,至此mysql安装完毕,你可以这样起动你的mysql服务# /etc/rc.d/init.d/mysqld start# ln -s /usr/local/mysql/bin/mysql /sbin/mysql# ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin为了能让系统找到mysql,请运行如下命令# PA TH=$PATH:/usr/local/mysql/bin# export PATH# echo "/usr/local/mysql/lib/mysql" >;>; /etc/ld.so.conf# ldconfig日志管理开启错误日志(在[safe_mysqld]项下添加)# vi /etc/f[safe_mysqld]err-log=/var/log/mysqld/err.log开启常规日志和更新日志(在[mysqld]项下添加)# vi /etc/f[mysqld]log=/var/log/mysqld/log.loglog-update=/var/log/mysqld/update.log创建日志文件并设置权限# mkdir /var/log/mysqld# touch /var/log/mysqld/err.log /var/log/mysqld/log.log /var/log/mysqld/update.log# chown -R mysql.mysql /var/log/mysqld# service mysqld restart说明:错误日志包含了服务器写入标准错误输出设备的所有消息,同时还包括了mysql服务的启动和关闭事件常规日志用来记录有关mysql服务器运行的常规信息,包括用户的连接、查询及其他各种时间更新日志用来记录修改数据库的查询信息,包括所有涉及数据库修改的SQl语句的查询记录建议调试结束后关闭日志2.安装apache 2.2.12# wget /httpd/httpd-2.0.54.tar.bz2# tar jxvf httpd-2.2.12.tar.bz2# cd httpd-2.2.12# ./configure --prefix=/usr/local/apache# make# make install设置自启动# cp support/apachectl /etc/init.d/httpd修改/etc/init.d/httpd# vi /etc/init.d/httpd(在第两行之后添加如下内容)#!/bin/sh## Startup script for the Apache Web Server# chkconfig: - 85 15# description: Apache is a World Wide Web server. It is used to serve \# HTML files and CGI.# processname: httpd# pidfile: /usr/local/apache/log/httpd.pid# config: /usr/local/apache/conf/httpd.conf# chkconfig --add httpd# chmod 755 /etc/init.d/httpd# chkconfig httpd on创建网页根目录# mkdir /web/www# vi /usr/local/apache/conf/httpd.conf//存放网页的目录,原来为DocumentRoot "",改成:DocumentRoot "/web/www"//这句应该和DocumentRoot 的目录保持一致,原来为<Directory "">;,改成:<Directory "/web/www">;//Indexes:当在目录中找不到DirectoryIndex列表中指定的文件就生成当前目录的文件列表//FollowSymlinks:允许符号链接跟随,访问不在本目录下的文件Options Indexes FollowSymLinks//禁止读取.htaccess配置文件的内容AllowOverride None//指定先执行Allow(允许)访问规则,再执行Deny(拒绝)访问规则Order allow,deny//设置Allow(允许)访问规则,允许所有连接Allow from all</Directory>;启动服务:# /usr/local/apache/bin/apachectl start或# service httpd start3.安装php 5.2.10A先安装支持包(注意安装顺序)建立初始目录:#mkdir /usr/local/modules建立jpeg目录#mkdir /usr/local/modules/jpeg7#mkdir /usr/local/modules/jpeg7/bin#mkdir /usr/local/modules/jpeg7/lib#mkdir /usr/local/modules/jpeg7/include#mkdir /usr/local/modules/jpeg7/man#mkdir /usr/local/modules/jpeg7/man/man1A1、安装zlib#tar xzvf zlib-1.2.3.tar.gz#cd zlib-1.2.3#不要用--prefix自定义安装目录,影响gd的安装#./configure --prefix=/usr/local/modules/zlib#make#make installA2、安装freetype#tar jxvf freetype- 2.3.8.tar.bz2#cd freetype- 2.3.8#./configure --prefix=/usr/local/modules/freetype#make#make installA3、安装libpng#tar xzvf libpng-1.2.10.tar.gz#不要用--prefix自定义安装目录,影响gd的安装#cd libpng-1.2.10#cp scripts/makefile.std makefile#make test#make installA4、安装jpeg#tar xzvf jpegsrc.v7.tar.gz#cd jpeg-7#./configure --prefix=/usr/local/modules/jpeg7 --enable-shared --enable-static #make#make installA5 安装libxml2#tar xzvf libxml2-2.7.4.tar.gz#./configure --prefix=/usr/local/modules/libxml2#cd libxml2-2.7.2#make#make install#cp xml2-config /usr/binA6 安装libmcrypt#tar zxvf libmcrypt-2.5.7.tar.gz#cd libmcrypt-2.5.7#./configure#make#make installA7、安装GD#tar xzvf gd-2.0.35.tar.gz#cd gd-2.0.35#./configure --prefix=/usr/local/modules/gd --with-jpeg=/usr/local/modules/jpeg7 --with-png --with-zlib --with-freetype=/usr/local/modules/freetype#make#make installB、安装PHP# tar -jxvf php-5.2.10.tar.bz2# cd php-5.2.10# ./configure \--prefix=/usr/local/php \--with-apxs2=/usr/local/apache/bin/apxs \--with-mysql=/usr/local/mysql \--with-libxml-dir=/usr/local/modules/libxml2 \--with-gd=/usr/local/modules/gd \--with-jpeg-dir=/usr/local/modules/jpeg7 \--with-zlib \--with-png-dir=/usr/local/lib/ --with-freetype-dir=/usr/local/modules/freetype# make# make install# cp php.ini-dist /usr/local/php/lib/php.ini# vi /usr/local/php/lib/php.ini;default_charset = "iso-8859-1"在这行下面加一行default_charset = "gb2312"# vi /usr/local/apache/conf/httpd.conf找到#AddType application/x-tar .tgz 这行,在下面加两行。