CentOS 5.4 pptp + freeradius2 +mysql +daloradius完美整合(图文并茂)(一)

2014-11-24 16:45:32 · 作者: · 浏览: 3
CentOS 5.4 pptp + freeradius2 +mysql +daloradius完美整合(图文并茂)
一、安装相关配置包
1、安装httpd、mysql及php相关包
[plain] 
1. [root@localhost ~]# yum -y install httpd httpd-devel mysql mysql-server mysql-devel  
2. [root@localhost ~]# yum -y install php php-devel php-mysql php-common php-gd php-mbstring php-mcry  
2、配置httpd服务:
[plain] 
1. [root@localhost ~]# netstat -ant |grep 80  
2. [root@localhost ~]# /etc/init.d/httpd start  
3. Starting httpd:                                            [  OK  ]  
4. [root@localhost ~]# vi /etc/sysconfig/iptables  
5. [root@localhost ~]# grep 80 /etc/sysconfig/iptables  
6. -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT  #增加此行  
7. [root@localhost ~]# /etc/init.d/iptables restart  
8. Flushing firewall rules:                                   [  OK  ]  
9. Setting chains to policy ACCEPT: filter nat                [  OK  ]  
10. Unloading iptables modules:                                [  OK  ]  
11. Applying iptables firewall rules:                          [  OK  ]  
12. Loading additional iptables modules: ip_conntrack_netbios_n[  OK  ]  
13. [root@localhost ~]# chkconfig httpd --list  
14. httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off  
15. [root@localhost ~]# chkconfig httpd on  #设置httpd自动启动  
16. [root@localhost ~]# chkconfig httpd --list  
17. httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off  
18. [root@localhost ~]# netstat -ant |grep 80  
19. tcp        0      0 :::80                       :::*                        LISTEN  
3、启动mysql数据库:
[plain] 
1. [root@localhost ~]# /etc/init.d/mysqld start  
2. Initializing MySQL database:  Installing MySQL system tables...  
3. OK  
4. Filling help tables...  
5. OK  
6. 
7. To start mysqld at boot time you have to copy  
8. support-files/mysql.server to the right place for your system  
9. 
10. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !  
11. To do so, start the server, then issue the following commands:  
12. /usr/bin/mysqladmin -u root password 'new-password'  
13. /usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'  
14. 
15. Alternatively you can run:  
16. /usr/bin/mysql_secure_installation  
17. 
18. See the manual for more instructions.  
19. 
20. You can start the MySQL daemon with:  
21. cd /usr ; /usr/bin/mysqld_safe &  
22. 
23. You can test the MySQL daemon with mysql-test-run.pl  
24. cd mysql-test ; perl mysql-test-run.pl  
25. 
26. Please report any problems with the /usr/bin/mysqlbug script!  
27. 
28. The latest information about MySQL is available on the web at  
29. http://www.mysql.com  
30. Support MySQL by buying support/licenses at http://shop.mysql.com  
31.                                                            [  OK  ]  
32. Starting mysqld:                                           [  OK  ]  
4、设置
数据库
密码; [plain] 1. [root@localhost ~]# mysqladmin -u root password 'leekwen' 5、安装Freeradius2相关包 [plain] 1. [root@localhost ~]# yum install -y freeradius2 freeradius2-mysql freeradius2-utils 6、启动radius进程,调试模式: [plain] 1. [root@localhost ~]# radiusd -X 2. FreeRADIUS Version 2.1.12, for host i386-redhat-linux-gnu, built on Jan 9 2013 at 05:02:57 3. Copyright (C) 1999-2009 The FreeRADIUS server project and contributors. 4. ... adding new socket proxy address * port 51738 5. Listening on authentication address * port 1812 6. Listening on accounting address * port 1813 7. Listening on command file /var/run/radiusd/radiusd.sock 8. Listening on authentication address 127.0.0.1 port 18120 as server inner-tunnel 9. Listening on proxy address * port 1814 10. Ready to process requests.

7、开启另外一个终端进行测试,如图:
8、如果结果与上图不同,请临时关闭防火墙后,临时关闭防火墙命令如下:
[plain] 
1. [root@localhost ~]# iptables -F  

重新运行测试命令:
[plain]