<./>.dev./hood

리눅스 버전 확인 -
[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

-> esc(press) -> :wq



기본 설치-
[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 밑에

[root@localhost ~]# /etc/init.d/iptables restart



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
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/xferlog
xferlog_std_format=YES

# (default follows)
chroot_local_user=YES
chroot_list_enable=YES

chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

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

-> esc(press) -> :wq

.... 아이디 확인 ....

[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.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

-> esc(press) -> :wq

[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]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1

-> 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$
->
location ~ \.(php|html|htm|js)$

-> :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                  
php-cli.x86_64                       5.3.3-46.el6_6                  
php-common.x86_64                    5.3.3-46.el6_6                  
php-fpm.x86_64                       5.3.3-46.el6_6                  
php-mbstring.x86_64                  5.3.3-46.el6_6                  
php-mcrypt.x86_64                    5.3.3-3.el6
php-mysql.x86_64                     5.3.3-46.el6_6                  
php-pdo.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-cli-5.5.27-1.el6.remi.x86_64
php-fpm-5.5.27-1.el6.remi.x86_64
php-xml-5.5.27-1.el6.remi.x86_64
php-mbstring-5.5.27-1.el6.remi.x86_64
php-pecl-jsonc-1.3.7-1.el6.remi.5.5.x86_64
php-common-5.5.27-1.el6.remi.x86_64
php-5.5.27-1.el6.remi.x86_64
php-mcrypt-5.5.27-1.el6.remi.x86_64
php-pdo-5.5.27-1.el6.remi.x86_64
php-mysqlnd-5.5.27-1.el6.remi.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
listen.allowed_clients = 127.0.0.1
listen.owner = nginx
listen.group = nginx
listen.mode = 0666
user = nginx
group = nginx
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
slowlog = /var/log/php-fpm/www-slow.log
security.limit_extensions = .php .php3 .php4 .php5 .html .htm
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session


[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":{

  }

}


-> esc(press) -> :wq
[root@localhost ~]# php composer.phar install



mariadb 설치 phpmyadmin 연동 -
[root@localhost ~]# vi /etc/yum.repos.d/MariaDB.repo
-> insert(press) ->

[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

-> 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';
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> quit;

[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