# cat /etc/redhat-release
Rocky Linux release 9.3 (Blue Onyx)
# dnf update -y && dnf upgrade -y
# yum install httpd*
# curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.11"
# yum install -y MariaDB-client MariaDB-connect-engine MariaDB-devel mariadb-server
# systemctl enable mariadb
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
# systemctl start mariadb
# systemctl status mariadb
● mariadb.service - MariaDB 10.11.7 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: disabled)
# dnf module enable php:8.1
# dnf module list php
Last metadata expiration check: 0:01:57 ago on Tue Apr 2 16:22:07 2024.
Rocky Linux 9 - AppStream
Name Stream Profiles Summary
php 8.1 common [d], devel, minimal PHP scripting language
# dnf install -y php php-cli php-curl php-mysqlnd php-gd php-opcache php-zip php-intl php-devel php-gd php-ldap php-odbc php-pear php-xml php-mbstring php-mhash gettext php-gmp
마지막에 꼭 8.1 인지 확인해야한다 .
# php -v
PHP 8.1.27 (cli) (built: Dec 19 2023 20:35:55) (NTS gcc x86_64)
Copyright (c) The PHP Group
# systemctl start httpd
# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 29875/sshd: /usr/sb
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 53412/mariadbd
tcp6 0 0 :::22 :::* LISTEN 29875/sshd: /usr/sb
tcp6 0 0 :::80 :::* LISTEN 58012/httpd
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::3306 :::* LISTEN 53412/mariadbd
# ps -ef |grep php
root 58013 1 0 16:26 ? 00:00:00 php-fpm: master process (/etc/php-fpm.conf)
apache 58014 58013 0 16:26 ? 00:00:00 php-fpm: pool www
apache 58015 58013 0 16:26 ? 00:00:00 php-fpm: pool www
apache 58016 58013 0 16:26 ? 00:00:00 php-fpm: pool www
apache 58017 58013 0 16:26 ? 00:00:00 php-fpm: pool www
apache 58018 58013 0 16:26 ? 00:00:00 php-fpm: pool www
root 58236 1400 0 16:26 pts/0 00:00:00 grep --color=auto php
# dnf config-manager --set-enabled crb
# dnf install -y epel-release
# dnf install -y pdns pdns-backend-mysql pdns-recursor
# cp -arp /etc/pdns /etc/pdns_ori
# cp -arp /etc/pdns-recursor /etc/pdns-recursor_ori
# vi /etc/pdns/pdns.conf
# cat /dev/null > /etc/pdns/pdns.conf
# vi /etc/pdns/pdns.conf
allow-axfr-ips=127.0.0.1 config-dir=/etc/pdns daemon=yes disable-axfr=no guardian=yes launch=gmysql local-port=53 module-dir=/usr/lib64/pdns recursor=127.0.0.1:53 setgid=pdns setuid=pdns socket-dir=/var/run/pdns version-string=DNS logging-facility=0 log-dns-details=yes log-dns-queries=yes loglevel=5 gmysql-host=127.0.0.1 gmysql-user=pdns gmysql-password=pdns!@#123 gmysql-dbname=pdns gmysql-port=3306 gmysql-socket=/var/lib/mysql/mysql.sock |
mysql 작업
# vi /etc/my.cnf.d/server.cnf
[mysqld] sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES log-bin = mysql-bin server-id = 1 init_connect = 'SET collation_connection = utf8_general_ci, NAMES utf8' character-set-server = utf8 collation-server = utf8_general_ci expire_logs_days = 10 |
# mysql -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5 Server version: 10.11.7-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed MariaDB [mysql]> CREATE USER 'pdns'@'localhost' IDENTIFIED BY 'pdns!@#123'; Query OK, 0 rows affected (0.003 sec) MariaDB [mysql]> CREATE DATABASE pdns ; Query OK, 1 row affected (0.001 sec) MariaDB [mysql]> GRANT ALL PRIVILEGES ON pdns.* TO 'pdns'@'localhost' WITH GRANT OPTION; Query OK, 0 rows affected (0.003 sec) MariaDB [mysql]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | pdns | | performance_schema | | sys | | test | +--------------------+ 6 rows in set (0.001 sec) MariaDB [mysql]> show grants for pdns@'localhost'; +-------------------------------------------------------------------------------------------------------------+ | Grants for pdns@localhost | +-------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO `pdns`@`localhost` IDENTIFIED BY PASSWORD '*30A026E7C66EE9240F47EC5191CC9917D9028DFC' | | GRANT ALL PRIVILEGES ON `pdns`.* TO `pdns`@`localhost` WITH GRANT OPTION | +-------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.000 sec) |
# mysql -u root -p pdns < /usr/share/doc/pdns/schema.mysql.sql
Enter password:
진행 시
MariaDB [(none)]> use pdns Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed MariaDB [pdns]> show tables; +----------------+ | Tables_in_pdns | +----------------+ | comments | | cryptokeys | | domainmetadata | | domains | | records | | supermasters | | tsigkeys | +----------------+ 7 rows in set (0.000 sec) |
# wget https://github.com/poweradmin/poweradmin/archive/refs/tags/v3.7.0.tar.gz
# ll
-rw-r--r-- 1 root root 10937134 Apr 2 16:50 v3.7.0.tar.gz
# tar -zxvf v3.7.0.tar.gz
# ll
drwxrwxr-x 15 root root 4096 Dec 26 00:45 poweradmin-3.7.0
# mv poweradmin-3.7.0 poweradmin
# systemctl start pdns
# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 29875/sshd: /usr/sb
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 58732/pdns_server
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 53412/mariadbd
tcp6 0 0 :::22 :::* LISTEN 29875/sshd: /usr/sb
tcp6 0 0 :::53 :::* LISTEN 58732/pdns_server
tcp6 0 0 :::80 :::* LISTEN 58012/httpd
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::3306 :::* LISTEN 53412/mariadbd
다하면 http://IP/poweradmin/ 치면
이렇게 나온다 installer 클릭.
Go to step 2 -> Go to step 3
마지막 admin 패스워드만 내가 웹 로그인할 패스워드이고 나머지는 유형에 맞게 넣어주면된다.
Go to step 4
Go to step 5
CREATE USER 'testuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pdns!@#123';
GRANT SELECT, INSERT, UPDATE, DELETE ON pdns.* TO 'testuser'@'localhost';
DB에 입력하라고 알려준다.
(버전에 따라 CREATE USER 'testuser'@'localhost' IDENTIFIED WITH BY 'pdns!@#123'; 이렇게 넣어야 들어갈수도 있다.)
MariaDB [mysql]> select user ,host from user;
+-------------+---------------------------+
| User | Host |
+-------------+---------------------------+
| PUBLIC | |
| mariadb.sys | localhost |
| mysql | localhost |
| pdns | localhost |
| root | localhost |
| testuser | localhost |
+-------------+---------------------------+
이것도 친절하게 알려줍니당 ~
/var/www/html/poweradmin/inc
경로에 config-defaults.inc.php 파일이 있습니다
이파일을 config.inc.php 파일로 복사해서 아래 내용을 넣어줍니다.
그리고 위에 적힌것들을 해당 파일에 맞게 넣어주면 완성 ~
cp install/htaccess.dist .htaccess 이건 install 폴더에 보면 없다..
해서 그냥 install만
# mv install ../ 해도 되고 rm -rf install 지워도 된당..
admin 에 아까입력한 패스워드 넣고 로그인 ~
매우 깔끔하네요
'Linux&Ubuntu > 서버' 카테고리의 다른 글
senmail 발송 실패 (0) | 2024.06.18 |
---|---|
nfs 구축 centos7,ubuntu22.04 (0) | 2024.05.31 |
Rocky 8 nfs S,C 설치 (0) | 2024.03.04 |
linux hostname 변경 (0) | 2024.02.19 |
centos7 DKIM 설정 (1) | 2024.02.01 |