Postfix部署【2】传输代理

一、清理


  1. 卸载自带 postfix

    $ rpm -q postfix
    postfix-2.6.6-6.el6_5.x86_64
    $ rpm -ev postfix --nodeps
    

二、编译安装MySQL 5.1


  1. 安装编译环境

    $ yum -y groupinstall "Development Tools"
    
  2. 获取源码包

    $ cd /opt;wget https://cdn.mysql.com/archives/mysql-5.1/mysql-5.1.71.tar.gz
    
  3. 配置国内 yum 源

    $ wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
    $ yum clean all
    $ yum makecache
    
  4. 编译安装

    - 创建用户、组
    $ groupadd mysql
    $ useradd mysql -s /sbin/nologin -g mysql -M
    
    - 安装依赖包
    $ yum -y install ncurses-devel
    
    - 创建安装目录
    $ mkdir -p /usr/local/mysql
    
    - 编译安装
    $ tar zxvf mysql-5.1.71.tar.gz
    $ cd mysql-5.1.71
    $ ./configure \
    --prefix=/usr/local/mysql/  \
    --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
    --localstatedir=/usr/local/mysql/data \
    --enable-assembler \
    --enable-thread-safe-client \
    --with-mysqld-user=mysql \
    --with-big-tables \
    --without-debug \
    --with-pthread \
    --enable-assembler \
    --with-extra-charsets=complex \
    --with-readline \
    --with-ssl \
    --with-embedded-server \
    --enable-local-infile \
    --with-plugins=partition,innobase \
    --with-mysqld-ldflags=-all-static \
    --with-client-ldflags=-all-static
    $ make && make install	
    
  5. 配置

    - 创建mysql数据文件目录
    $ mkdir -p /application/mysql/data
    
    - 创建配置文件
    $ cp /opt/mysql-5.1.71/support-files/my-medium.cnf /etc/my.cnf
    - 创建启动脚本
    $ cp -r /opt/mysql-5.1.71/support-files/mysql.server /etc/init.d/mysqld
    
    - 权限配置
    $ chown -R mysql:mysql /usr/local/mysql
    $ /usr/local/mysql/bin/mysql_install_db --user=mysql
    
    - 环境变量
    $ echo "export PATH=/usr/local/mysql/bin:$PATH" >> /etc/profile
    $ source /etc/profile
    
  6. 启动 MySQL

    -设置开机自动启动
    $ chkconfig --add mysqld
    $ chmod a+wrx /etc/init.d/mysqld
    $ /etc/init.d/mysqld start
    
  7. MySQL 初始化配置

    $ /usr/local/mysql/bin/mysql_secure_installation
    
    Enter current password for root (enter for none):		
    	# 输入当前 root 在 mysql 中的密码,一般为空,所以直接回车;
    
    Set root password? [Y/n] y			
    	# 是否为 root 设置密码?
    
    Remove anonymous users? [Y/n] y		
    	# 是否移除匿名用户?
    
    Disallow root login remotely? [Y/n] n	
    	# 是否拒绝 root 远程登录?
    
    Remove test database and access to it? [Y/n] y		
    	# 是否移除test库和对test库的访问权限?
    
    Reload privilege tables now? [Y/n] y	
    	# 是否刷新授权表使修改生效?
    
    

至此,MySQL安装完成;

三、安装 cyrus-sasl 并启动 saslauthd 服务


$ yum -y install cyrus-sasl cyrus-sasl-devel
$ service saslauthd start
$ chkconfig saslauthd on

四、编译安装 Postfix-

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值