Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6110334
  • 博文数量: 1659
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 15407
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
文章分类

全部博文(1659)

文章存档

2021年(34)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2009-12-08 14:57:14

yum install -y gcc gcc-c++ gcc4-c++ autoconf gd gd-devel libxml2 libxml2-devel zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel expat expat-devel sqlite sqlite-devel png-devel jpeg-devel libtool libjpeg* libpng* freetype-devel pam-devel
wget
tar -zxvf myget-0.1.2.tar.gz
cd myget-0.1.2
./configure
make;make install
cd ..
/usr/local/bin/mytget -n 10 -f mysql-5.1.31.tar.gz
tar -zxvf mysql-5.1.31.tar.gz
cd mysql-5.1.31
./configure --prefix=/usr/local/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase
make;make install
cd ..
groupadd mysql
useradd -g mysql mysql
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
sed -i 's/skip-federated/#skip-federated/g' /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql
chmod +w /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql/.
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --level 345 mysql on
service mysql start
/usr/local/mysql/bin/mysqladmin -u root password root
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
ldconfig
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
service mysql stop
service mysql start
wget
tar -zxvf pam_mysql-0.7RC1.tar.gz
cd pam_mysql-0.7RC1
./configure --with-openssl --with-mysql=/usr/local/mysql
make;make install
echo "/lib/security" >> /etc/ld.so.conf
ldconfig

/usr/local/mysql/bin/mysql -u root -proot
create database if not exists `pam`;
USE `pam`;
SET FOREIGN_KEY_CHECKS=0;
/*数据表 `admin` 的表结构*/
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `password` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*数据表 `admin` 的数据*/
LOCK TABLES `admin` WRITE;
insert into `admin` values
(1,'admin','admin');
UNLOCK TABLES;
/*数据表 `user` 的表结构*/
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `password` varchar(50) NOT NULL,
  `active` int(10) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*数据表 `user` 的数据*/
LOCK TABLES `user` WRITE;
insert into `user` values
(1,'test','test',1);
 
vi /etc/pam.d/pam
auth required /lib/security/pam_mysql.so user=root passwd=root host=localhost db=pam table=user usercolumn=name passwdcolumn=password where=active=1 sqllog=0 crypt=0
account required /lib/security/pam_mysql.so user=root passwd=root host=localhost db=pam table=user usercolumn=name passwdcolumn=password where=active=1 sqllog=0 crypt=0
 
testsaslauthd -u test -p test -s pam
 

 
阅读(1518) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~