如何仅在CentOS 7上设置ISPConfig DNS

时间:2020-02-23 14:31:00  来源:igfitidea点击:

ISPConfig是由Ispconfig UG开发的一个开源托管控制面板,用于Linux。
ISPConfig根据BSD许可证许可。
它能够从一个控制面板管理多个服务器。
在本教程中,将介绍如何设置和使用ISPConfig来管理绑定DNS服务器。

Ispconfig可以管理下面的软件包和守护进程:http:apache2和nginxsmtp:postfixpop3/imap:courier和dovecot(1.2.x)ftp:pureftpddns:bind和mydnsdatabase:mysqlstatistics:webalizer和awstatsvirtualization:openvz

有关所有服务和函数的列表,请检查ISPCONFIG函数页面。

仅设置ISPCONFIG DNS

要拥有一个函数的ISPConfig DNS,我们将:安装和配置Bindinstall和Configure Ispconfig GUI

步骤1:安装和配置绑定DNS服务器

首先安装 epel-release然后绑定包

sudo yum install epel-release

安装绑定:

sudo yum -y install bind bind-utils haveged

一旦安装了绑定,备份配置文件并创建一个新的文件:

sudo mv /etc/named.conf /etc/named.conf.bak

创建具有以下内容的新配置文件:

# cat /etc/named.con
options {
      listen-on port 53 { any; };
      listen-on-v6 port 53 { any; };
      directory       "/var/named";
      dump-file       "/var/named/data/cache_dump.db";
      statistics-file "/var/named/data/named_stats.txt";
      memstatistics-file "/var/named/data/named_mem_stats.txt";
      allow-query     { any; };
      allow-recursion {"none";};
      recursion no;
};
logging {
      channel default_debug {
              file "data/named.run";
              severity dynamic;
      };
};
zone "." IN {
      type hint;
      file "named.ca";
};
include "/etc/named.conf.local";

创建一个 named.conf.local然后开始命名服务

sudo touch /etc/named.conf.local
sudo systemctl enable named.service
sudo systemctl start named.service

第1步:在CentOS 7上安装和配置ISPConfig

ISPConfig需要:MySQL Databasephp

要安装MariaDB服务器,请使用:在CentOS上安装MariaDB 10.x

为安装PHP添加REMI存储库:

我们将从Remi存储库安装所有PHP包。
将其添加如下

sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install yum-utils
sudo yum-config-manager --disable remi-php54
sudo yum-config-manager --enable remi-php72

安装PHP和所需的模块

使用以下命令安装PHP及其模块

sudo yum install php php-devel php-mysql php-gd php-imap php-ldap \
php-pear php-xml php-xmlrpc php-pecl-apc php-mbstring php-mcrypt \
php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick \
libxml2 libxml2-devel mod_fcgid php-cli wget

安装httpd:

sudo yum install ntp httpd httpd-devel mod_ssl perl-DateTime-Format-HTTP perl-DateTime-Format-Builder

设置PHP TimeZone:

$sudo vim /etc/php.ini
date.timezone = Africa/Nairobi

重新启动httpd:

sudo systemctl restart httpd

对于nginx:

sudo yum install nginx

仅安装和配置ISPConfig DNS

就像这种写作一样,最新版本的ISPConfig是3.1.
使用以下命令安装此命令:

cd /tmp 
wget -O ispconfig.tar.gz https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=stable-3.1

提取存档:

tar xfz ispconfig.tar.gz

开始安装:

cd ispconfig3*/install/
php -q install.php

我们应该获得类似于以下类似的初始屏幕:

——————————————————————————–
 _____ ___________   _____              __ _         ____
|_   _/ ___| ___ \/__ \           /_(_)       /__  \
  | | \ `–.| |_//|/\/___  _ __ | |_ _  __ _    _//
  | |  `–. \  __/ | |   /_ \| ’_ \|  _| |/_` |  |_ |
 _| |_/__//|     | __/\ (_) | | | | | | | (_| | ___\ \
 ___/____/_|      ____/___/|_| |_|_| |_|__, | ____/
                                              __/|
                                             |___/
——————————————————————————–


>> Initial configuration  

Operating System: CentOS 7.5

    Following will be a few questions for primary configuration so be careful.
    Default values are in [brackets] and can be accepted with <ENTER>.
    Tap in "quit" (without the quotes) to stop the installer.

选择专家安装模式,然后选择安装Web服务和DNS

Select language (en,de) [en]:

Installation mode (standard,expert) [standard]: expert

Full qualified hostname (FQDN) of the server, eg server1.domain.tld  [nms-02.eadc.]: dns-01.example.com

MySQL server hostname [localhost]:

MySQL server port [3306]:

MySQL root username [root]:

MySQL root password []: myslq-root-password

MySQL database to create [dbispconfig]:

MySQL charset [utf8]:

The next two questions are about the internal ISPConfig database user and password.
It is recommended to accept the defaults which are ’ispconfig’ as username and a random password.
If you use a different password, use only numbers and chars for the password.

ISPConfig mysql database username [ispconfig]:

ISPConfig mysql database password [cf503263b8a5ca9141319b09d50d75fc]:

Shall this server join an existing ISPConfig multiserver setup (y,n) [n]:

Apache and nginx detected. Select server to use for ISPConfig: (apache,nginx) [apache]: 

Adding ISPConfig server record to database.

Configure Mail (y,n) [y]: n

[WARN] autodetect for Jailkit failed
Force configure Jailkit (y,n) [n]: n

Skipping Jailkit

[WARN] autodetect for pureftpd failed
Force configure pureftpd (y,n) [n]: n

Skipping pureftpd

Configure DNS Server (y,n) [y]: y

Configuring BIND
The Web Server option has to be enabled when you want run a web server or when this node shall host the ISPConfig interface.
Configure Web Server (y,n) [y]: y

Configuring Apache
Configuring vlogger
[WARN] autodetect for OpenVZ failed
Force configure OpenVZ (y,n) [n]: n

Skipping OpenVZ

Configure Firewall Server (y,n) [y]: n

[WARN] autodetect for Metronome XMPP Server failed
Force configure Metronome XMPP Server (y,n) [n]: n

Skipping Metronome XMPP Server

[WARN] autodetect for Fail2ban failed
Force configure Fail2ban (y,n) [n]: n

Skipping Fail2ban

Configuring Apps vhost
Install ISPConfig Web Interface (y,n) [y]: y

Installing ISPConfig
ISPConfig Port [8080]: 

Admin password [fa3cbace]: 

Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: y

Generating RSA private key, 4096 bit long modulus
………………………………++
……………………………………………………………………………………………………………………++
e is 65537 (0x10001)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ′.’, the field will be left blank.
—–
Country Name (2 letter code) [XX]:KE
State or Province Name (full name) []: Nairobi
Locality Name (eg, city) [Default City]: Nairobi
Organization Name (eg, company) [Default Company Ltd]:theitroad Limited
Organizational Unit Name (eg, section) []:Infrastructure
Common Name (eg, your name or your server’s hostname) []:dns-01.example.com
Email Address []:[email protected]

Please enter the following ’extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
writing RSA key
			

Configuring DBServer
Installing ISPConfig crontab
Installing ISPConfig crontab
no crontab for root
Detect IP addresses
Restarting services …
done..

在防火墙上打开iSpconfig:

sudo firewall-cmd --add-port=8080/tcp --permanent
sudo firewall-cmd --reload

我们现在应该能够访问ISPConfig Web仪表板:

https://server-ip|hostname:8080

我们可以开始创建DNS区域文件和管理记录。