클라우드 엔지니어 꿈나무
Untangle 을 사용하여 apache, php 및 Mysql 서버 구성 본문
구성도
빨간 표시는 진입 불가
외부로 나가는 IP는 10.0.0.1
Workstation
Untangle
WEB
# mkdir /php
실제 PC
scp *.php root@172.254.0.11:/php
WEB
# ls /php
# yum install -y httpd
# yum install -y epel-release yum-utils
# yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum-config-manager --enable remi-php73
# yum install -y php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd
# vi /etc/httpd/conf/httpd.conf
# systemctl enable --now httpd
# firewall-cmd --permanent --add-port=443/tcp
# firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd --reload
DB
# ping 실제PC아이피 (DB에서 실제 PC에서는 ping이 가나 실제 PC에서는 DB로 ping 안 감)
# yum install -y http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm => mysql repo 생성
# vi /etc/yum.repos.d/mysql-community.repo
mysql 5.7 community 를 다운받았으니 gpgcheck=0 으로 표시
# yum install -y mysql-community-server
# firewall-cmd --permanent --add-port=3306/tcp
# firewall-cmd --reload
# systemctl start mysqld
# cat /var/log/mysqld.log | grep password => mysql 초기 패스워드 확인
# mysql_secure_installation => 비밀번호 재설정
새로운 비밀번호 입력 후,
mysql> Change the password for root? y
비밀번호 재입력
mysql> Do you wish to continue with the password provided? y
mysql> Remove anonymous users? y
mysql> Disallow root login remotely? n
mysql> Remove test database and access to it? y
mysql> Reload privilege tables now? y
# mysql -uroot -p
mysql> grant all privileges on *.* to 'root'@'%' identified by 'It12345!';
mysql> flush privileges;
mysql> create database member;
mysql> use member;
mysql> create table member( no int not null, id varchar(10) not null, name varchar(20) not null, phone varchar(20) not null, address varchar(100) not null);
WEB
# cd /php
# cp *php /var/www/html
# ls /var/www/html
실제 PC 인터넷창
<<참고>>
grant privileges 까지 했는데 permission denied가 되는 경우 selinux가 disabled로 되어 있는지 확인
10.0.0.1
10.0.0.1/person1.php
10.0.0.1/table1.php
'Linux' 카테고리의 다른 글
ESXi - HAProxy를 활용하여 웹 접속 (1) | 2023.11.02 |
---|---|
Esxi 내 untangle vmware 툴 설치 (0) | 2023.11.01 |
Vshpere Live-Migration 및 Xen 설치 (0) | 2023.10.24 |
RHCSA 기출 Redhat RH-134 : crontab (1) | 2023.10.19 |
따배도 컨테이너 보관 창고(Docker Registry) - private hub (1) | 2023.10.19 |