yum install readline* -y
wget
tar -zxvf postgresql-7.4.28.tar.gz
cd postgresql-7.4.28
./configure --prefix=/opt/postgresql --with-perl --with-maxbackends=1024
make all install
cd ..
#添加postgresql用户
groupadd postgres
useradd -g postgres -s /bash/bash postgres
#创建数据目录并创建PGDATA变量
mkdir -p /opt/postgresql/var/data
chown postgres:postgres /opt/postgresql/var/data
export PGDATA="/opt/postgresql/var/data"
#初使化数据库
su - postgres
vi .bash_profile
export PGDATA="/opt/postgresql/var/data"
export PATH="$PATH:/opt/postgresql/bin"
source .bash_profile
/opt/postgresql/bin/initdb
#启动数据库
/opt/postgresql/bin/pg_ctl -D /opt/postgresql/var/data/ -l '/opt/postgresql/var/data/postgresql.log' start
#加入环境变量和lib路径
export PATH="$PATH:/opt/postgresql/bin"
echo "/opt/postgresql/lib" >>/etc/ld.so.conf
ldconfig
#打开tcp/ip连接
cd $PGDATA
vi pg_hba.conf
host all all 192.168.1.1 255.255.255.255 password
#192.168.1.1是radius的地址
#配置数据库
su - postgres
#新建用户
createuser -P -D -A cake
createdb -O cake -E WIN cake
createlang plpgsql cake
wget
#导入数据库
psql -Ucake -W -d cake -f cake.sql
#查看
psql -Ucake cake -c "select * from cake.users;"
安装freeradius
wget
tar -zxvf freeradius-server-2.1.8.tar.gz
cd freeradius-server-2.1.8
./configure --prefix=/opt/freeradius --with-rlm-sql-postgresql-lib-dir=/opt/postgresql/lib --with-rlm-sql-postgresql-include-dir=/opt/postgresql/include
make all install
cd ..
groupadd radiusd
useradd -g radiusd -s /bin/bash radiusd
chown -R radiusd:radiusd /opt/freeradius
安装ppp
wget
tar -zxf ppp-2.4.3.tar.gz
cd ppp-2.4.3
./configure
make
make install
make install-etcppp
mkdir /etc/radiusclient
cd pppd/plugins/radius/etc
cp * /etc/radiusclient
安装pptp
wget
tar -zxvf pptpd-1.1.4-b4.tar.gz
cd poptop-1.1.4
./configure --prefix=/opt/pptpd --with-libwrap --with-bcrelay
make all install
cd ..
#配置文件安装
cd /
wget
tar jxvf etc.tar.bz2
etc中有所有的配置,可以直接解压就OK了!
JAVA_HOME=/opt/jdk
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME$/jre/lib
export JAVA_HOME CLASSPATH
export PGDATA="/opt/postgresql/var/data"
export PATH="$PATH:/opt/postgresql/bin:$JAVA_HOME/bin"
阅读(943) | 评论(1) | 转发(0) |