CentOS the detailed configuration FreeRADIUS + daloradius + OpenPortal and a method of flow control to achieve

1, install PHP 7

  • First delete the existing PHP:yum remove php*
  • Then yum update source:
 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
 rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
  • Yum statement is executed, install PHP:
 yum install php70w-common php70w-fpm php70w-opcache php70w-gd php70w-mysqlnd php70w-mbstring php70w-pecl-redis php70w-pecl-memcached php70w-devel
  • Adaptation Apache:
  vim /etc/httpd/conf/httpd.conf
  • In the Apache configuration file, httpd.conf <IfModule mime_module></IfModule>increase in a row of blocks
AddType application/x-httpd-php .php
  • Php file parsing effective method:
    download php extension
yum install mod_php

1, found:

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

Later adding:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php5

2. Find: <IfModule dir_module> DirectoryIndex index.html </IfModule>
add: <IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
3, Found: #ServerName www.example.com:80
amended as: ServerName 127.0.0.1:80 or ServerName localhost: 80 Remember to remove the preceding "#"

2, install apache

  1. View comes with linux apache:rpm -qa|grep httpd;
  2. Uninstall comes apache:yum remove httpd*
  3. Install apache:yum -y install httpd
  4. yum list|grep httpdHere Insert Picture Description
    There are normally four plug-in, if not please go to the official website to download the manual
  5. Turn off the firewall:service iptables stop
  6. open Directory:cd /var/www/html
  7. Create documents:vim hello.html
<html>
<head>
<title>
My first  apache
</title>
</head>
<body>
<h1>
Hellow world
</h1>
</body>
</html>
  1. View Host Interface ip: ifconfig
    figure 192.168.1.133 for the virtual machine ip interface.
    Here Insert Picture Description
  2. Start apache, web access
    service httpd start
    to open an external browser, http: //localhost/hello.html

3, and the installation into the database and mysql freeradius

  1. Type the installation freeradius-mysql
yum install -y freeradius freeradius-mysql freeradius-utils
  1. Open firewall ports:
iptables -A INPUT -p udp --dport 1812 -j ACCEPT
iptables -A INPUT -p udp --dport 1813 -j ACCEPT
  • Check whether the port is open: iptables -L -n | grep 181
  1. Test whether the installation is successful freeradius
  • Modify vim / etc / raddb / users

    The inside of steve Cleartext-Password := "testing"a few anti-annotation nearby

  • Enter radiusd -X (where -X refers start from the debug module, will print debug information related to), if the following error message appears to indicate ssl library version does not correspond, modify the corresponding configuration file:

vim radiusd.conf将allow_vulnerable_openssl = no修改为allow_vulnerable_openssl = yes

Open another terminal input radtest steve testing localhost 0 testing123
Upon receiving the Access-Accept request indicates successful

  1. Complete installation of mysql
yum -y install mysql
yum -y install mysql-server mysql-devel
  • Start mysql service
service mysqld start
mysql -uroot -p

Will be prompted for a password, the password is the password before installing time
4. Modify the mysql password

use mysql;
update user set password=password(“你的新密码”) where user=“root”;
flush privileges;
quit;
  1. Associate with the mysql freeradius
  • Enter mysql, create a database named radius storage freeradius
create database radius;
  • Import data table (freeradius comes after downloading)
cd /etc/raddb/sql/mysql
mysql -u root -p123456 radius < schema.sql;
mysql -u root -p123456 radius < nas.sql;
mysql -u root -p123456 radius < ippool.sql;
mysql -u root -p123456 radius < wimax.sql;
mysql -u root -p123456 radius < cui.sql;
  • New Group Information
insert into radgroupreply (groupname,attribute,op,value) values ('user','Auth-Type',':=','Local');
insert into radgroupreply (groupname,attribute,op,value) values ('user','Service-Type',':=','Framed-User');
insert into radgroupreply (groupname,attribute,op,value) values ('user','Framed-IP-Address',':=','255.255.255.255');
insert into radgroupreply (groupname,attribute,op,value) values ('user','Framed-IP-Netmask',':=','255.255.255.0');
  • New User Information
insert into radcheck (username,attribute,op,value) values ('test','User-Password',':=','test');
  • The user associated with the group
insert into radusergroup (username,groupname) values ('test','user');
  • Add User reply
insert  into radreply(username,attribute,op,value) values('test','Reply-Message','=','Yes,Good!');
  • After exiting mysql execute:
cp /usr/lib64/freeradius/rlm_sql_mysql-2.2.6.so /usr/lib64/freeradius/rlm_sql_mysql.so
  • Sql modification information database module is connected:
vim /usr/local/etc/raddb/mods-available/sql

Read line 31: Driver = "rlm_sql_mysql"
87 to line: dialect = "MySQL"
91 is replaced by the line: Server = "localhost"
92 lines read: 3306 Port =
93 lines read: Login = "RADIUS"
97 OK read: radius_db = "the RADIUS"
245 lines changed to: read_clients = yes

  • Check the directory module is enabled
 vim /usr/local/etc/raddb/radiusd.conf

Ensure the following is not a comment

$INCLUDE mods-enabled/
$INCLUDE sites-enabled/
$INCLUDE sql.conf

  • Open support sql module
vim /usr/local/etc/raddb/sites-available/default

Sql removed following line comments, which here is '-', to find can be removed
405 to row change: sql
640 to row change: sql
738 to row change: sql
843 to row change: sql

  • Configuring client information
vim /usr/local/etc/raddb/clients.conf

Add to

client alladdress {
        ipaddr =0.0.0.0/0
        secret = supperadmin
}
  • Change the configuration file so that it is connected to mysql
vim /usr/local/etc/raddb/sql.conf

= Server "localhost"
the Login = "root"
password = "root password of mysql 123456"
radius_db = "the RADIUS"
cancel readclients = yes comment before

  • Test whether the association was successful:
radiusd -X
radtest test test localhost 0 testing123

If the Access-Accept packet emerge from host 127.0.0.1 port 1812, id = 121, length = 4, the association was successful (if there might not start port is occupied, need to use the kill-9 [pid (Process ID) to kill the original] View process process ID netstat -apn | grep [port number])
now has support sql.conf, annotated file, so it can not be verified login Freeradius uesr file by user name. If a problem occurs, you can turn off debug mode, simply type radius, in run mode, and then troubleshoot the problem according to the error log, a search on a search engine.

4, installation Daloradius

  1. Enter Apache root of the site, download the source files
 cd /var/www/html/
 wget https://github.com/lirantal/daloradius/archive/master.zip

In case of -bash: wget: command not found, etc. to install the appropriate software, did not appear to ignore this step.

  yum -y install wget unzip zip
  1. Extracting archive, modify the folder name
 unzip master.zip
 mv daloradius-master/ daloradius
  1. Download daloradius-0.9-9.tar.gz, after extracting merged into daloradius folder
Wget http://downloads.sourceforge.net/project/daloradius/daloradius/daloradius0.9-9/daloradius-0.9-9.tar.gz
unzip master.zip
mv daloradius-master/ daloradius
  1. Enter daloradius directory, database import daloradius
cd /var/www/html/daloradius
mysql -u root -p123456< contrib/db/fr2-mysql-daloradius-and-freeradius.sql 
mysql -u root -p123456 < contrib/db/mysql-daloradius.sql

(If installed radius)

cd /var/www/daloradius/contrib/db
mysql -uradius -pradpass radius < ./mysql-daloradius.sql
  1. Set daloradius Directory user groups and users, set permissions daloradius.conf.php
chown -R apache:apache /var/www/daloradius/
chmod 664 /var/www/daloradius/library/daloradius.conf.php
  1. Open daloradius.conf.php file, modify CONFIG_DB_USER, CONFIG_DB_PASS, CONFIG_DB_NAME.
vim /var/www/html/daloradius/library/daloradius.conf.php
  1. Restart Service
service radiusd restart 
service mysqld restart
service httpd restart
  1. Install php-pear
yum install php-pear
pear install DB
  1. Login web
默认用户名: administrator
密码: radius
http://ip-address/daloradius/login.php

5, the installation OpenPortal

Filezilla mounted on the first window, for file transfer and on the linux window.
Here Insert Picture Description
The ip address of the virtual machine, output to the host, port 22.
Create a new directory on linux: mkdir / opt / soft
will spread to the next OpenPortalServer soft, compression bag on / opt / soft

  1. Install java development of related componentsyum -y install java-1.7.0-openjdk*

  2. service mysqld start

  3. unzip OpenPortalServer\ V3.10.0.0\ 2017-07-01.zip

  4. cd OpenPortalServer\ V3.10.0.0\ 2017-07-01

  5. mv OpenPortalServer/ /usr/openporttal

  6. cd /user/openportal

  7. vim webapps/ROOT/WEB-INF/classes/properties/jdbc.properties

  8. mysql -uroot -p+mysql密码 radius </usr/openporttal/OpenPortalServer.sql

  9. cd /usr/openporttal/

  10. 设置权限:chmod 777 *.*

  11. echo "/usr/openportalserver/bin/startup.sh" >> /etc/rc.d/rc.local

  12. echo “source /ect/profile”>>/ect/rc.d/rc.local

  13. 设置权限chmod 777 /usr/openporttal/bin/startup.sh

  14. 设置权限:chmod 777 /usr/openporttal/bin/*.sh

  15. 关闭防火墙:service iptables stop

  16. 在浏览器打开 ip网站
    Here Insert Picture Description

Summary: The configuration process will definitely have an unexpected error, the error Baidu can be the solution, if you want to unlock more features freeradius, you can go read the official document. Information on user control and traffic monitoring this part of the advanced features of the Internet because the VPN problem has not been achieved. About configure the switch, AP and firewall chicken dishes that I can not answer, I hope this blog so that we can step on some of the less pit, all the way forward!

Published 11 original articles · won praise 21 · views 650

Guess you like

Origin blog.csdn.net/weixin_43510080/article/details/104493199