CENTOS7,RHEL7 installation Freeradius+daloradius Web Management +daloradius Chinese __web

Source: Internet
Author: User
Tags anonymous install php pear php download create database freeradius

Freeradius is a high-performance open source RADIUS server developed by the GNU General Public License. Freeradius is the most used RADIUS server in the world. Freeradius has a web-based user management tool that is modular, extensible, and rich in feature sets. The pro-test was successfully installed on the CentOS 7 Freeradius and Daloradius used.


Note: All commands in this article are executed under the root command.


Before starting the installation, it is recommended that you close selinux or set it to disabled, and it is a good idea to permanently close selinux:

# sed-i ' s/^selinux=.*/selinux=disabled/g '/etc/selinux/config

Reboot the system: reboot, check the selinux when the reboot is complete

Install Apache server

# yum-y Install httpd httpd-devel



-Set up boot up and start Apache service

# Systemctl Enable httpd
# Systemctl start httpd

You can see the Apache home page by entering the native IP in the browser after startup.


Install mariadb why not use MySQL.
A: MARIADB database management system is a branch of MySQL, mainly by the open source community in the maintenance, with the GPL license. One of the reasons for developing this branch is that Oracle has a potential risk of MySQL closed source after acquiring MySQL, so the community uses a branching approach to avoid the risk.



Installation

# yum Install-y mariadb-server mariadb
Set up mariadb boot and start mariadb service
# Systemctl start mariadb
# Systemctl Enable MARIADB



View MARIADB status, running already running

# SYSTEMCTL Status mariadb



Initial setup mariadb, set root password, consider removing anonymous users and disabling remote root logins for security reasons, see the example configuration below.

# mysql_secure_installation
Set root Password? [y/n]  Y
New password: 
re-enter new password: 
password updated successfully!
Reloading privilege tables.
 ... Success!

Remove anonymous users? [y/n] Y

Disallow root login remotely? [y/n] Y

Remove test database and access to it? [y/n] Y

Reload privilege tables now? [y/n] Y


Create RADIUS database and user name password

# mysql-u Root-p
mariadb [(none)]> CREATE DATABASE radius;
MARIADB [(None)]>  GRANT all on radius.* to Radius@localhost identified by "radius";
MARIADB [(None)]> FLUSH privileges;
MARIADB [(None)]> exit


Install PHP7 installation

# curl ' https://setup.ius.io/'-o setup-ius.sh

# bash setup-ius.sh

# yum Remove Php-cli mod_php ># yum-y Install mod_php70u php70u-cli php70u-mysqlnd php70u-devel php70u-gd php70u-mcrypt php70u-mbstring php70u-xml php 70u-pear



-View PHP Version

# php-v


Test Php,apache Web site and directory to create a new info.php page, press INS to enter content, press ESC,:WQ save exit.

# vim/var/www/html/info.php
    <?php
        phpinfo ();
    ? >


Restart the Apache server, open info.php Web page, display PHP information is normal.

# systemctl Restart Httpd.service



Install Freeradius installation

# yum-y Install Freeradius freeradius-utils freeradius-mysql


Wait until the download is complete: Complete, complete.


Start radius and set boot up

# Systemctl start Radiusd.service
# Systemctl Enable Radiusd.service



View the ports used by radius, and then add the RADIUS service to the firewall;

# Cat/usr/lib/firewalld/services/radius.xml


View firewall status, start state to add rules, Centos7 the default firewall is FIREWALLD, generally do not need additional settings.

# Firewall-cmd--state




Add RADIUS service to FIREWALLD.

# Firewall-cmd--add-service=radius--permanent
Success
# firewall-cmd--reload
Success
# Firewall-cmd--list-services



Configure Freeradius to import the RADIUS database into the MAIADB database

# mysql-u Root-p Radius </etc/raddb/mods-config/sql/main/mysql/schema.sql


To create a soft connection for/etc/raddb/mods-enabled

# ln-s/etc/raddb/mods-available/sql/etc/raddb/mods-enabled/


Configure SQL module/raddb/mods-available/sql and change database connection parameters to suit your environment:

# Vim/etc/raddb/mods-available/sql
SQL {
        # the Sub-module to execute queries. This is should match
        # The database you ' re attempting to connect to
        . # # * Rlm_sql_mysql # * Rlm_sql_mssql # * rlm_sql_oracle # *    rlm_sql_postgresql
        #    * Rlm_sql_sqlite
        # *    rlm_sql_null (log queries to disk)
        #
        Driver = ' rlm_sql_mysql '
        DIALECTT = "MySQL"
        # Connection Info:
        #
        Server = "localhost"
        port = 3306
        Login = "radius"
        Password = "radius"
        # Database table configuration for everything except Oracle
        radius_db = "radius" 
  
   ......

        # Set to ' yes ' to read RADIUS clients from the database (' Nas ' table)
        # Clients'll only is read on server startup.< C29/>read_clients = yes


  


Other configurations do not need to be changed by default.


Then, change the/etc/raddb/mods-enabled/sql-owning group to RADIUSD:

# chgrp-h Radiusd/etc/raddb/mods-enabled/sql


Add the start service, adjust the Freeradius and mariadb boot sequence, Freeradius must start after mariadb startup, and in the [Unit] section, add After=mariadb.service, as shown in the following illustration:

# Systemctl Enable Radiusd.service
# Vim/etc/systemd/system/multi-user.target.wants/radiusd.service

    After= Mariadb.service


Add Client connection settings, add allow all users to access, for specific IP access, IP can be freely changed.

# vim/etc/raddb/clients.conf 


client all_client {
    ipaddr = 0.0.0.0/0
    secret = testing123
    require_ Message_authenticator = no
}


Install Freeradius Admin Interface Daloradius into the Apache website root directory, download source files

# cd/var/www/html/
# wget Https://github.com/lirantal/daloradius/archive/master.zip

If appears-bash:wget:command not found and so on installs the corresponding software, did not appear ignores this step.

# yum-y Install wget unzip zip


Unzip the compressed package and modify the folder name

# unzip Master.zip
# mv Daloradius-master/daloradius


Download daloradius-0.9-9.tar.gz, unpack and merge into the Daloradius folder

# wget http://liquidtelecom.dl.sourceforge.net/project/daloradius/daloradius/daloradius0.9-9/ daloradius-0.9-9.tar.gz

# Unzip Master.zip

# mv Daloradius-master/daloradius


Enter the Daloradius directory and import the Daloradius database

# CD Daloradius
# mysql-u root-p radius < contrib/db/fr2-mysql-daloradius-and-freeradius.sql 
# mysql-u Root -P RADIUS < Contrib/db/mysql-daloradius.sql


Set up Daloradius directory user groups and users, set daloradius.conf.php permissions

# chown-r apache:apache/var/www/html/daloradius/
# chmod 664/var/www/html/daloradius/library/ daloradius.conf.php


Set up Daloradius database connection information, open daloradius.conf.php file, modify Config_db_user,config_db_pass,config_db_name.

# vim/var/www/html/daloradius/library/daloradius.conf.php


Restart Service

# systemctl Restart Radiusd.service 
# systemctl Restart Mariadb.service 
# systemctl Restart httpd

If prompted: Warning:radiusd.service changed on disk. Run ' Systemctl daemon-reload ' to reload units.

Ignore this step without the above hint

# systemctl Daemon-reload
# systemctl Restart Radiusd.service



-Install Php-pear

# yum Install php-pear
# Pear Install DB


Login Web Interface
Default User name: Administrator
Password: Radius

http://ip-address/daloradius/login.php



Now that the Freeradius+daloradius+web management interface has been successfully installed, the following is the Web interface localization tutorial. There is no need to look. Daloradius Chinese version set into Daloradius file directory, modify config-lang.php, add Chinese options:

# Cd/var/www/html/daloradius
vim config-lang.php 

    <option value= ' en ' > Simplified Chinese </option >




-Enter the lang directory, modify main.php, add Simplified Chinese files:

# CD lang/
# vim main.php case 

    "en":
            include (DirName (__file__). " /zh.php ");
            Break




Download address: zh.php;



-Returns the Lang directory, puts the downloaded zh.php file into the lang directory, and restarts the RADIUS service;

# Cd/var/www/html/daloradius/lang

    will upload the downloaded zh.php to this directory.

# systemctl Restart Radiusd.service 
# systemctl Restart httpd


Set config-> Language settings->simplified Chinese


Complete


Attachment:

zh.php Download Address: zh.php;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.