CentOS 7 설치후 설정들

* 주요 구성 의존성 체크 (기설치된 버전 체크)

$ rpm -qa libjpeg* libpng* freetype* gd-* gcc gcc-c++ gdbm-devel libtermcap-devel

* 주요 라이브러리 및 프로그램 설치

$ yum install libjpeg* libpng* freetype* gd-* gcc gcc-c++ gdbm-devel libtermcap-devel

* Apache 설치

$ yum install httpd

* Base Repo 에 등록되어 있지 않은 Maria DB Repo 등록

$ vi /etc/yum.repos.d/MariaDB.repo

# MariaDB 10.1 CentOS repository list

# http://downloads.mariadb.org/mariadb/repositories/

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/10.1/centos7-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1

* MariaDB 설치

$ yum install MariaDB-server MariaDB-client

* PHP 설치

$ yum install -y php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql -y

* 설치된 버전 확인

$ httpd -v

$ php -v

$ mysql -v

* php session 폴더 권한 변경

sudo chmod 777 /var/lib/php/session

* PHP mbstring 설치

yum install php-mbstring -y

* httpd.conf 수정

$ vi /etc/httpd/conf/httpd.conf

62 # User/Group: The name (or # number) of the user/group to run httpd as.

63 # It is usually good practice to create a dedicated user and group for

64 # running httpd, as with most system services.

65 #

66 User nobody (apache → nobody 변경)

67 Group nobody (apache → nobody 변경)

93 # If your host doesn’t have a registered DNS name, enter its IP address here.

94 #

95 # ServerName www.example.com:80

96 ServerName 192.168.122.128:80 (도메인 또는 해당서버 IP 입력 추가)

* 방화벽 프로그램 설치

$ yum install -y firewalld

* 방화벽 등록 및 시작

$ systemctl unmask firewalld

$ systemctl enable firewalld

$ systemctl start firewalld

* 방화벽 Http 추가

$ firewall-cmd –permanent –zone=dmz –add-service=http

$ firewall-cmd –permanent –zone=dmz –add-service=https

$ firewall-cmd –permanent –zone=public –add-port=80/tcp –> 80포트 허가

$ firewall-cmd –reload

* Apache 에 PHP 가능하도록

$ vi /etc/httpd/conf/httpd.conf

161 # DirectoryIndex: sets the file that Apache will serve if a directory

162 # is requested.

163 #

164 <IfModule dir_module>

165 DirectoryIndex index.html index.htm index.php (추가)

166 </IfModule>

270 # AddType allows you to add to or override the MIME configuration

271 # file specified in TypesConfig for specific file types.

272 #

273 # AddType application/x-gzip .tgz

274 AddType application/x-httpd-php .php .html .htm .inc (추가)

275 AddType application/x-httpd-php-source .phps (추가)

* 서버시작

$ systemctl start httpd –> 시작

$ systemctl enable httpd –> 시스템 재시작시 반영

$ systemctl start mariadb

$ systemctl enable mariadb

* FTP 셋팅 (vsftpd)

$ yum -y install vsftpd –> 설치

$ firewall-cmd –permanent –add-port=21/tcp –> 방화벽 포트 오픈

$ firewall-cmd –permanent –add-port=20/tcp

$ firewall-cmd –permanent –add-service=ftp

$ firewall-cmd ––reload

$ systemctl enable vsftpd

$ systemctl restart vsftpd

–$ firewall-systemctl restart vsftpd.servicecmd –reload

–$ systemctl start vsftpd.service

–$ systemctl enable vsftpd.service

* Tomcat 설치

– Sun/Java JDK RPM 다운로드 및 설치 (다운로드된 Rpm 실행: $ rpm -ivh jdk.rpm)

– 설치된 여러개의 Java 중 설치한 JDK 선택 ($ alternatives –config java)

$ firewall-cmd –permanent –add-port=8080/tcp –> 방화벽 포트 오픈

$ firewall-cmd –reload

$ yum install -y tomcat* –skip-broken

Leave a reply:

Your email address will not be published.

Site Footer