centos 7 apm yum install

2018. 12. 18. 02:56OS/리눅스

반응형

** 붉은 글씨는 수정해야 하는 문자들임


[apm 설치]


#> 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

패키지 yum install


#> yum install httpd

apache(httpd) yum install


#> vi /etc/yum.repos.d/MariaDB.repo

기존의 yum 으로 설치할 경우 MariaDB 5.5 버전이 설치가됨

최신버전 설치를 원할경우 yum 미러 경로를 직접 지정


# MariaDB 10.1 CentOS repository list

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

[mariadb]

name = MariaDB

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

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

gpgcheck=1


:wq 로 저장하고 나감


#> yum install MariaDB-server MariaDB-client

마리아디비 인스톨


#> rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm


#> rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm


php 역시 yum 으로 설치하면 php5.4 버전이 설치가 됨

최신 버전으로 설치하기 위해 webtatic EL 저장소 추가


#> yum install php70w

php iinstall


#> yum install php70w-mysql php70w-pdo php70w-pgsql php70w-odbc php70w-mbstring php70w-mcrypt php70w-gd


#> yum install php70w-pear php70w-pdo_dblib php70w-pecl-imagick php70w-pecl-imagick-devel php70w-xml php70w-xmlrpc

관련 php 패키지


[설치 확인 및 버전확인]


#> httpd -v


#> php -v


#> mysql -V


[apm 설정 및 구동]


#> vi /etc/httpd/conf/httpd.conf

httpd 기본설정


66L User nobody (apache -> nobody 수정)

67L Group nobody (apache -> nobody 수정)


95L ServerName localhost 또는 ServerName 서버IP (#ServerName www.example.com:80 -> ServerName localhost 수정)


:wq 저장하고 나감


#> systemctl stop firewalld

방화벽 정지


#> systemctl mask firewalld

재부팅 이후에도 올라오지 않도록 설정


#> iptables -L

iptables 확인


#> systemctl start httpd

httpd 구동


#> systemctl enable httpd

부팅 후 자동 실행 설정


#> service httpd restart

service 명령어 정상 작동 여부 확인


#> ps -ef | grep httpd

아파치 구동 확인




#> vi /etc/httpd/conf/httpd.conf


164L DirectoryIndex index.html --> DirectoryIndex index.html index.htm index.php (추가)


283L AddType application/x-compress .Z

284L AddType application/x-gzip .gz .tgz


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

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


:wq 저장하고 나감


#> cd /var/www/html

yum 설치 시 html 파일 기본 업로드 디렉토리


#> vi /var/www/html/phpinfo.php

php 정보를 보여주는 함수파일 생성


<?php phpinfo(); ?>


:wq 저장하고 나감


#> ll

phpinfo.php 파일 확인


#> service httpd restart

php 환경설정 적용을 위해 apache 재시작


#> ps -ef | grep httpd

apache 구동확인




#> systemctl start mariadb

마리아디비 구동


#> ps -ef | grep mysql

마리아디비 구동확인


#> mysql_secure_installation

마리아디비 기본설정


Enter current password for root (enter for none): 패스워드가 없기때문에 엔터


Set root password? [Y/n] Y (DB Root 패스워드 설정)


New password: 패스워드 입력

Re-enter new password: 패스워드 재확인


Remove anonymous users? [Y/n] Y (익명의 접근을 막을 것인지 여부. 보안을 위해 Y)


Disallow root login remotely? [Y/n] Y (DB Root 원격을 막을 것인지 여부. 보안을 위해 Y)


Remove test database and access to it? [Y/n] Y (test 용으로 생성된 데이터베이스를 삭제할 것인지 여부. Y 입력)


Reload privilege tables now? [Y/n] Y (현재 설정한 값을 적용할 것인지 여부. Y 입력)


Thanks for using MaraDB! --> 문구가 출력되면 정상


#> mysql -u root -p

마리아 디비 접속 확인

Enter password: 패스워드 입력


반응형