Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Sunday, December 13, 2015

CentOS nginx phpMyAdmin 설치


# 확장 패키지(EPEL)가 있는지 확인
rpm -qa epel-release

# 확장 패키지 설치
yum install epel-release

# phpMyAdmin 설치
yum install phpMyAdmin

# 설치폴더
/usr/share/phpMyAdmin

# 폴더 심볼릭 링크 생성
cd /usr/share/nginx/html
ln -s /usr/share/phpMyAdmin phpMyAdmin

CentOS nginx + php에서 file not found 에러

Nginx와 php연동시 File not found 에러가 나는 경우가 있다.
이때는 nginx설정에서 fastcgi_param에서 다음과 같이 html폴더를 절대경로로 명시해 주면된다.

vi /etc/nginx/conf.d/default.conf

    location ~ \.php$ {
        #root           /usr/share/nginx/html;
        #fastcgi_pass   127.0.0.1:9000;
        fastcgi_pass    unix:/var/run/php-fpm/www.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
        include        fastcgi_params;
    }

그리고 nginx restart하자.
service nginx restart

CentOS nginx iptables 설정


CentOS에서 nginx를 설치하고 나면 80번 포트가 막혀있다.
그래서 다음과 같이 iptables를 편집해서 80번 포트를 열어야 한다.

sudo vi /etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

service iptables restart


Monday, January 5, 2015

MySQL libmysqlclient.so.18: cannot open shared object file: No such file or directory

CentOS에서 MySQL C API를 사용하는 프로그램을 실행 도중 위와 같은 에러가 발생했다.
find로 찾은 결과 다음과 같은 위치에 있었다.

[root@SE3576 src2]# find / -name  libmysqlclient.so.18
/usr/local/src/mysql-5.6.21/libmysql/libmysqlclient.so.18
/usr/local/mysql/lib/libmysqlclient.so.18

그래서 다음과 같이 LD_LIBRARY_PATH를 정해주어야 한다.
내가 작업하는 CentOS 서버의 경우에는 iconv.so까지 찾을수가 없어서 다음과 같이 정의했다.
export LD_LIBRARY_PATH=/usr/local/mysql/lib/:/usr/local/src/libiconv-1.14/lib/.libs/:$LD_LIBRARY_PATH





Thursday, September 11, 2014

CentOS MySQL API 설치

yum -y install mysql
yum -y install mysql-server
yum -y install mysql-devel

chgrp -R mysql /var/lib/mysql
chmod -R 770 /var/lib/mysql

service mysqld start

// libmysqlclient 설치
yum whatprovides "*libmysqlclient*"