centos 6.6 에서 ftp, nginx, php, mariadb 설치
리눅스 버전 확인 -
[root@localhost ~]# lsb_release -a
네트워크 설정-
[root@localhost ~]# ping google.com
ping : unknown host google.com
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
-> insert(press) ->
ONBOOT=yes |
기본 설치-
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install wget
setup 설치(방화벽) -
[root@localhost ~]# yum install setuptool system-config-securitylevel-tui authconfig system-config-network-tui ntsysv
[root@localhost ~]# yum install system-config-firewall
[root@localhost ~]# /etc/init.d/messagebus start
[root@localhost ~]# setup(write)
-> 방화벽 설정(enter) -> 사용자설정(enter) -> www(enter) -> save&quite(enter)
or
[root@localhost ~]# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT <- ssh 밑에 |
ftp 설치-
[root@localhost ~]# rpm -qa vsftpd*
[root@localhost ~]# yum install vsftpd -y
[root@localhost ~]# chkconfig vsftpd on
[root@localhost ~]# vi /etc/vsftpd/vsftpd.conf
-> insert(press) ->
anonymous_enable=NO # (default follows) chroot_list_file=/etc/vsftpd/chroot_list pasv_enable=NO (응답: 425 Failed to establish connection.) |
-> esc(press) -> :wq
[root@localhost ~]# service vsftpd start
[root@localhost ~]# netstat -anp | grep vsftpd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 24918/vsftpd
[root@localhost ~]# chkconfig --list | grep vsftpd
vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost ~]# vi /etc/vsftpd/user_list
[root@localhost ~]# vi /etc/vsftpd/ftpusers
-> insert(press) ->
#root |
.... 아이디 확인 ....
[root@localhost ~]# useradd id
[root@localhost ~]# passwd id
....비밀번호 교체 ....
[root@localhost ~]# vi /etc/vsftpd/chroot_list
....새 파일 작성후 아이디 추가....
[root@localhost ~]# vi /etc/sysconfig/selinux
-> insert(press) ->
# This file controls the state of SELinux on the system. |
[root@localhost ~]# getsebool -a | grep ftp
[root@localhost ~]# setsebool allow_ftpd_full_access on
[root@localhost ~]# service vsftpd restart
[root@localhost ~]# vi /etc/vsftpd/user_list
[root@localhost ~]# vi /etc/vsftpd/ftpusers
출처: http://devhood.tistory.com/174?category=847530 [<./>.dev./hood]
nginx 서버 설치 -
[root@localhost ~]# vi /etc/yum.repos.d/nginx.repo
-> insert(press) ->
[nginx] |
-> esc(press) -> :wq(write)
[root@localhost ~]# yum install nginx
Verifying : nginx-1.8.0-1.el6.ngx.x86_64 1/1
[root@localhost ~]# vi /etc/nginx/conf.d/default.conf
-> insert(press)
location ~ \.php$ |
-> :wq
[root@localhost ~]# service nginx start
[root@localhost ~]# chkconfig nginx on
[root@localhost ~]# chkconfig --list nginx
nginx 0:off 1:off 2:on 3:on 4:on 5:off 6:off
php-fpm 설치 -
[root@localhost ~]# rpm -qa | grep php
php.x86_64 5.3.3-46.el6_6 |
[root@localhost ~]# yum remove php.x86
php-cli.x86_64 php-common.x86_64 php-fpm.x86_64 php-mbstring.x86_64
php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
[root@localhost ~]# rpm -qa | grep remi-release
[root@localhost ~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
[root@localhost ~]# rpm -qa | grep remi-release
remi-release-6.4.1.el6.remi.noarch |
[root@localhost ~]# ll /etc/yum.repos.d/remi.repo
-rw-r--r--. 1 root root 1694 oc 3 06:10 /etc/yum.repos.d/remi.repo |
[root@localhost ~]# yum --enablerepo=remi-php55 install php php-fpm php-pdo php-mcrypt php-mstring
[root@localhost ~]# rpm -qa | grep php
php-pecl-zip-1.12.5-1.el6.remi.5.5.x86_64 |
php-mysqlnd 설치가 되지 않았다면
[root@localhost ~]# yum --enablerepo=remi-php55 install php-mysqlnd
[root@localhost ~]# vi /etc/php-fpm.d/www.conf
listen = /tmp/php5-fpm.sock |
[root@localhost ~]# ls -la /var/lib/php
drwxrwx--- 2 root apache 4096 2015-07-15 00:00 session |
[root@localhost ~]# ls -la /var/lib/php/session
-rw------- 1 apache apache 13842 2013-07-12 06:14 sess_2hp41jsraac5dei7nn93c5mre3ucgvgj |
[root@localhost ~]# chown -R nginx:nginx /var/lib/php/session
[root@localhost ~]# chmod 0777 /var/lib/php/session
[root@localhost ~]# service php-fpm start
[root@localhost ~]# service nginx restat
[root@localhost ~]# service mysql restart
컴포저 설치 (locally) -
[root@localhost ~]# cd /(설치 디렉토리 이동)/
[root@localhost ~]# curl -sS https://getcomposer.org/installer | php
[root@localhost ~]# vi composer.json
-> insert(press) ->
{ "require":{ } } |
[root@localhost ~]# php composer.phar install
mariadb 설치 phpmyadmin 연동 -
[root@localhost ~]# vi /etc/yum.repos.d/MariaDB.repo
-> insert(press) ->
[mariadb] |
-> esc(press) -> :wq
[root@localhost ~]# yum install MariaDB-server MariaDB-client
[root@localhost ~]# /etc/init.d/mysql start
[root@localhost ~]# /usr/bin/mysql -u root mysql
MariaDB [mysql]> update user set password=password('비밀번호') where user='root'; |
[root@localhost ~]# chkconfig mysql on
[root@localhost ~]# chkconfig --list mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost ~]# cd /usr/share/
[root@localhost share]# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.10/phpMyAdmin-4.0.10.10-all-languages.tar.gz
[root@localhost share]# tar -xvf phpMyAdmin-4.0.10.10-all-languages
[root@localhost share]# mv phpMyAdmin-4.0.10.10-all-languages phpmyadmin
[root@localhost share]# cp config.sample.inc.php config.inc.php
phpmyadmin 접속시 아래와 같은 오류 떴을 때
The mbstring extension is missing. Please check your PHP configuration.
[root@localhost share]# cd ~
[root@localhost ~]# php -r "mb_substr();"
PHP Fatal error: Call to undefined function mb_substr() in Command line code on line 1
[root@localhost ~]# rpm -qa php-mbstring
[root@localhost ~]# yum info php-mbstring | grep Repo
[root@localhost ~]# yum install php-mbstring
[root@localhost ~]# rpm -qa php-mbstring
php-mbstring-5.3.3-3.el6_2.8.x86_64
[root@localhost ~]# ln -s /usr/share/phpmyadmin /usr/share/nginx/html/
[root@localhost ~]# service nginx restart
[root@localhost ~]# service php-fpm restart
[root@localhost ~]# service mysql restart
참고 포스트 -
http://opennaru.tistory.com/104
http://jongkwang.com/?p=941
http://ann-moon.tistory.com/99
http://www.krizna.com/centos/install-phpmyadmin-nginx-centos-6/
http://blog.naver.com/hispromise/80205608825
http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_php-mbstring_%EC%84%A4%EC%B9%98
http://akal.co.kr/?p=78
http://webdevnovice.tistory.com/6?category=615997
https://www.haruair.com/blog/1860
http://nowonbun.tistory.com/115
http://zetawiki.com/wiki/Vsftpd_%ED%99%88_%EB%94%94%EB%A0%89%ED%86%A0%EB%A6%AC_%EB%B2%97%EC%96%B4%EB%82%A0_%EC%88%98_%EC%9E%88%EA%B2%8C_%ED%95%98%EA%B8%B0
http://zetawiki.com/wiki/Vsftpd_root_%EC%A0%91%EC%86%8D_%EA%B0%80%EB%8A%A5%ED%95%98%EA%B2%8C_%ED%95%98%EA%B8%B0
https://matthew.kr/centos-%EC%9D%98-vsftpd-%EC%A0%91%EC%86%8D%EC%8B%9C-500-oops-cannot-change-directoryroot-%EC%97%90%EB%9F%AC/
http://zetawiki.com/wiki/CentOS_6%EC%97%90_PHP_5.5_%EC%84%A4%EC%B9%98_%28yum%29
http://webdir.tistory.com/183'OS > Linux' 카테고리의 다른 글
centos7 에 node.js 설치 하기 (0) | 2015.07.13 |
---|---|
centos, php-mcrypt 설치 (0) | 2015.07.13 |
nginx, php, mariadb utf-8 문자셋 세팅 (0) | 2015.07.13 |
리눅스 포트 보안 필수 확인 사항 (0) | 2015.04.07 |
서비스 중인 포트 사용 확인 (0) | 2015.04.03 |