搭建可视化管理DNS服务器
DNS服務器搭建
Centos7
#yum install bind bind-chroot
#yum install ?mysql-server php php-soap php-mysql php-intl php-xml php-cli php-soap php-intl
#yum install wget net-tools vim lsof
#rpm --import http://repos.jethrocarr.com/jethrocarr_signing_key.gpg
#wget -O /etc/yum.repos.d/jethrocarr-c7-public.repo?\
http://repos.jethrocarr.com/config/centos/7/jethrocarr-c7-public.repo
#yum install namedmanager-www
#yum install namedmanager-bind
#wget http://repo.mysql.com/mysql80-community-release-el7.rpm
#yum localinstall mysql80-community-release-el7-3.noarch.rpm
#yum update
#yum install mysql-community-server
#service mysqld restart
#service httpd restart
#lsof -i:80
#lsof -i:3306
?
##查看mysql安裝時默認密碼并驗證
#grep "password" /var/log/mysqld.log
?
##修改密碼命令
Mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new password';
?
#/usr/share/namedmanager/resources/autoinstall.pl
?
##mysql8.0創建用戶失敗,需要手動創建用戶
否則報錯: Unable to connect to DB:Access denied for user 'namedmanager'@'localhost' (using password: YES)
Mysql>create user "namedmanager"@"localhost" identified by "1qaz@WSX";
?
##授權
Mysql>GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , INDEX , ALTER , CREATE TEMPORARY TABLES, LOCK TABLES ON `namedmanager` . * TO 'namedmanager'@'localhost';
?
#修改namedmanager配置文件,vim /etc/namedmanager/config.php
?
##配置httpd權限,紅色部分注釋掉 vim /etc/httpd/conf/httpd.conf
##否則出現:You don't have permission to access /namedmanager on this server.
?
?
#ln /etc/named.namedmanager.conf /var/named/chroot/etc/named.namedmanager.conf
?
#查看mysql數據庫用戶
Mysql>SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
?
#查看數據庫
Mysql>show databases;
?
?
配置:
vim /etc/httpd/conf/httpd.conf
/etc/namedmanager/config-bind.php
/var/named/chroot/etc/named.conf
?
#重啟服務service named-chroot restart
#添加開機啟動項systemctl enable named httpd mysqld
補充:
Named->named-chroot需要的操作
# ln /etc/named.namedmanager.conf /var/named/chroot/etc/named.namedmanager.conf
# chown named:named /var/named/chroot/etc/named.namedmanager.conf
# cp -rv /usr/share/doc/bind-9.8.2/sample/etc/* /var/named/chroot/etc/
# cp -rv /usr/share/doc/bind-9.8.2/sample/var/* /var/named/chroot/var/
## 在bind chroot 的目錄中創建相關文件
touch /var/named/chroot/var/named/data/cache_dump.db
touch /var/named/chroot/var/named/data/named_stats.txt
touch /var/named/chroot/var/named/data/named_mem_stats.txt
touch /var/named/chroot/var/named/data/named.run
mkdir /var/named/chroot/var/named/dynamic
touch /var/named/chroot/var/named/dynamic/managed-keys.bind
?
## 將 Bind 鎖定文件設置為可寫
chmod -R 777 /var/named/chroot/var/named/data
chmod -R 777 /var/named/chroot/var/named/dynamic
[root@localhost ~]# vi /var/named/chroot/etc/named.conf
include "/etc/named.namedmanager.conf";
# 提示: 當前需要修改 named.conf , 添加 include "/etc/named.namedmanager.conf";
?
參考:
?
?
?
總結
以上是生活随笔為你收集整理的搭建可视化管理DNS服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于uni-app的表白墙小程序
- 下一篇: linux会话空闲无法关机,解决linu