[[ CentOS 7 + APM(mariadb) Yum 설치 ]]
최소설치를 하면 네트워크 설정이 되어 있지 않다. 아래에서 IP, MAC 등의 정보는 자신에게 맞게 마꾸어 설정한다.
1. 네트워크 설정
1. IP 설정#>vi /etc/sysconfig/network-scripts/ifcfg-end??? -> 7에서는 eth0 처럼 안하고 랜덤문자로 되는듯
고정아이피에서 NETMASK 설정을 할려면 PREFIX 라인을 지우고 NETMASK=255.255.255.224로 설정
네임서버는 KT 168.1226.63.1 보다는 SK 210.220.163.82 를 추천
- KT는 php fsockopen 등에서 도메인으로 접속시 접속이 안되거나 느린 현상이 있음
2. 데몬 재시작
#>service network restart
2. setup tools 설치
#>yum install net-tools
#>yum install NetworkManager-tui
#>nmtui --> 네트워크 관리툴 실행 파일#>yum install iptables-services
#>systemctl mask firewalld#>systemctl enable iptables
#>systemctl enable ip6tables
#>systemctl stop firewalld
#>systemctl start iptables
#>systemctl start ip6tables#>yum install setuptool system-config-firewall-tui ntsysv bind-utils
3. ssh 설정
1. 한글 깨짐시 설정
#>vi ~/.bash_profile ==> 해당 계정으로 로그인후
LANG=ko_KR.euckr2. ssh root 로그인 차단
#>vi /etc/ssh/sshd_config
#>service sshd restart- #PermitRootLogin yes
+ PermitRootLogin no
- X11Forwarding yes
+ #X11Forwarding yes
4. APM 설치
1. yum remi update
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm/etc/yum.repos.d
vi remi.repo
1. 기본 APM 설치#>yum --enablerepo=remi,remi-test,remi-php56 install httpd
#>yum install mariadb-server mariadb
#>yum --enablerepo=remi,remi-test,remi-php56 install php
2. 추가 라이브러리 설치
#>yum --enablerepo=remi,remi-test,remi-php56 install gd gd-devel libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel fontconfig fontconfig-devel libxml2 libxml2-devel openssl openssl-devel gmp gmp-devel mhash mhash-devel libmcrypt libmcrypt-devel mysql-server php-mysql php-devel php-gd php-mbstring php-mhash
2-1. 기타 업데이트
#>yum --enablerepo=remi,remi-test,remi-php56 update
3. MariaDB(Mysql) 설정
#> service mariadb start
#> mysql_secure_installation
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] N
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
#>service mariadb restart
3-1. MySQL 자동실행
#>systemctl enable mariadb
4. PHP 설정
#> vi /etc/httpd/conf.d/php.conf
DirectoryIndex index.html index.htm index.php
AddHandler php5-script .php .htm .html -> 추가
#>vi /etc/php.ini
short_open_tag=Off ->short_open_tag=On
;error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
display_errors = Off -> display_errors = On
[Date]
date.timezone = Asia/Seoul -> 주석풀고 타임존 설정
5. Apache 설정
#>vi /etc/httpd/conf/httpd.conf
AddDefaultCharset UTF-8 -> AddDefaultCharset EUC-KR -> 문자셋 조정
#>systemctl enable httpd
#>systemctl restart httpd
DocumentRoot 에러
#>chcon -R -t httpd_user_content_t /home/MyID/www
yum 전체 업데이트 후 리부팅
#>yum --enablerepo=remi,remi-test,remi-php56 update
#>reboot
5. 기타 서버 설정
시간 동기화
#>yum install rdate.x86_64
#>crontab -e
58 * * * * /usr/bin/rdate -s time.bora.net > /dev/null 2>&1
SELINUX - php의 fopen 등에서 퍼미션에러 날때
#>vi /etc/selinux/config
#SELINUX=enforcing
SELINUX=disabled
#>setenforce 0 (잠시 중지)
mysql 설정
#>vi /etc/my.cnf
max_connections = 356
thread_cache_size = 8
long_query_time=1
log-slow-queries
log-output=TABLE
VirtualHost
파일 생성
#>vi /etc/httpd/conf.d/virtualhost.conf
NameVirtualHost *:80
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost><VirtualHost *:80>
ServerAdmin webmaster@korea.com
DocumentRoot /home/www.korea.com/public_html
ServerName kospi100.com
ServerAlias www.korea.com#AddDefaultCharset UTF-8
ErrorLog logs/www.korea.com-error_log
#CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
#403 접근 권한 에러날때 추가
<Directory "/home/korea.com">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>/etc/rc.d/rc.local 활성화 (시작시 프로그램 실행 시킬때)
#>vi /usr/lib/systemd/system/rc-local.service
:: 변경-mariadb 실행후 실행하도록 변경
After=mariadb.service
::마지막에 추가
[Install]
WantedBy=multi-user.target
#>chmod 755 /etc/rc.d/rc.local#>systemctl --system daemon-reload
#>systemctl enable rc-local.service
#>systemctl start rc-local.service
#>vi /etc/rc.d/rc.local
실행하고자 하는 프로그램 실행 명령

댓글목록
등록된 댓글이 없습니다.