Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
more
Archives
Today
Total
관리 메뉴

클라우드 엔지니어 꿈나무

Untangle 을 사용하여 apache, php 및 Mysql 서버 구성 본문

Linux

Untangle 을 사용하여 apache, php 및 Mysql 서버 구성

새싹싹이 2023. 10. 31. 10:11

구성도

빨간 표시는 진입 불가

외부로 나가는 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