'CentOS'에 해당되는 글 1건

  1. 2006/02/16 CentOS 4.2 설치후 한 작업 (utf-8 관련 수정)

-- 한글 설정
: .bash_profile 에 /etc/sysconfig/i18n 에 있는 인코딩 문자중 한글 인코딩으로 코드추가


-- 프롬프트 변경
: /etc/bashrc ps2변수 수정


-- .vimrc 수정


-- suid/sgid 찾아보기 & 퍼미션 수정
find / -type f \( -perm -4000 -o -perm -2000 \) > ~/perm.txt


-- 자원제한
/etc/profile 에서 ulimit -Su 20 ; ulimit -Sv 20000
/root/.bash_profile 에서 ulimit -Su 7155 ; ulimit -Sv unlimited # root는 모든 자원을 쓸수있다


-- 커널파라미터 조정
echo "0" > /proc/sys/net/ipv4/tcp_timestamps
echo "1" >  /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route
echo "0" > /proc/sys/net/ipv4/conf/all/accept_redirects
echo "1" > /proc/sys/net/ipv4/conf/all/log_martians
echo "1" >  /proc/sys/net/ipv4/tcp_syncookies


-- yum 업데이트
yum -y update


-- 방화벽 설정
/etc/sysconfig/iptables 편집후 재기동


-- cron
4 4 * * * rdate -s time.bora.net
10 4 * * 3 yum -y update



-- mysql 4.1.x 설치
# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euckr
# make && make install
# cp my-medium.cnf /etc/my.cnf
# bin/mysql_install_db --user=mysql
# useradd -M mysql -s /sbin/nologin
# chown -R root  .
# chown -R mysql data/
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &


mysql Charset을 euc-kr로 컴파일했었는데 대세가 UTF-8인지라 지우고 다시 설치함

-- mysql 5.0.x

# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=utf8 --with-mysqld-user=mysql --with-collation=utf8_general_ci --with-extra-charset=complex --without-debug --with-client-ldflags=-all-static

# make && make install

# cp my-medium.cnf /etc/my.cnf
# bin/mysql_install_db --user=mysql

# bin/mysqld_safe --user=mysql &


/etc/my.cnf 편집 (http://www.inet.co.kr/faq/stories.php?story=06/02/03/6766921 참조)


[client]
#password = your_password
default-character-set=utf8

[mysqld]
init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci

[mysql]
default-character-set=utf8


* MySql에서 데이터베이스 생성
mysql>CREATE DATABASE 디비명 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


mysql> status
--------------
./mysql  Ver 14.12 Distrib 5.0.18, for pc-linux-gnu (i686) using  EditLine wrapper

Connection id:          7
Current database:       xxx
Current user:           xxx2
@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.0.18-log
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /tmp/mysql.sock
Uptime:                 26 min 38 sec

Threads: 1  Questions: 43  Slow queries: 0  Opens: 0  Flush tables: 1  Open tables: 7  Queries per second avg: 0.027
--------------

mysql> select logid,refer from tblLog;
+-------+-----------------+
| logid | refer           |
+-------+-----------------+
|     1 | 대한민국        |
|     2 | 쪽바리쉐리      |
|     3 | 이뉴엔도        |
|     4 | 황모씨            |
|     5 | ㅋㅋㅋ          |
|     6 | 맨유            |
|     7 | Shawn Green     |
|     8 | 짝짝짝          |
|     9 | 가나다          |
|    10 |                 |
+-------+-----------------+
10 rows in set (0.00 sec)


mysql> select logid,refer from tblLog order by refer;
+-------+-----------------+
| logid | refer           |
+-------+-----------------+
|    10 |                 |
|     7 | Shawn Green     |
|     5 | ㅋㅋㅋ          |
|     9 | 가나다          |
|     1 | 대한민국        |
|     6 | 맨유            |
|     3 | 이뉴엔도        |
|     8 | 짝짝짝          |
|     2 | 쪽바리쉐리      |
|     4 | 황모씨            |
+-------+-----------------+
10 rows in set (0.00 sec)


mysql> select logid,length(logid),refer,length(refer) from tblLog;
+-------+---------------+-----------------+---------------+
| logid | length(logid) | refer           | length(refer) |
+-------+---------------+-----------------+---------------+
|     1 |             1 | 대한민국        |            12 |
|     2 |             1 | 쪽바리쉐리      |            15 |
|     3 |             1 | 이뉴엔도        |            12 |
|     4 |             1 | 황모씨            |             9 |
|     5 |             1 | ㅋㅋㅋ          |             9 |
|     6 |             1 | 맨유            |             6 |
|     7 |             1 | Shawn Green     |            11 |
|     8 |             1 | 짝짝짝          |             9 |
|     9 |             1 | 가나다          |             9 |
|    10 |             2 |                 |             0 |
+-------+---------------+-----------------+---------------+
10 rows in set (0.01 sec)



-- apache 2.0.x 설치
httpd.h 헤더파일 수정
# useradd -M apache -s /sbin/nologin
# ./configure --prefix=/data/www --enable-rule=SHARED_CORE --enable-module=so
# make && make install
# /usr/local/apache/bin/apxs -c mod_rewrite.c // 필요모듈 컴파일


-- php 5.1.x 설치
# ./configure --with-apxs2=/usr/local/apache/bin/apxs --enable-sockets --enable-track-vars --enable-libxml --with-libxml-dir=/usr/lib --with-mod-charset --with-mysql=/usr/local/mysql --with-openssl --with-config-file-path=/usr/local/apache/conf
# make && make install
# cp php.ini-recommended /usr/local/apache/conf/php.ini


-- ZendOptimizer 2.6.x 설치
# ./install

httpd.conf, php.ini, my.cnf 수정, 로그파일 위치지정(파티션 큰곳으로 링크)


-- sendmail 8.13.x 설치
# yum install sendmail-cf
# cd /etc/mail
/etc/mail/sendmail.mc 파일수정
TRUST_AUTH_MECH(`LOGIN PLAIN EXTERNAL DIGEST-MD5 CRAM-MD5')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5')dnl
dnlDAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
# m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
/etc/mail/local-host-names 에 메일사용할 도메인기재(호스팅업체들 모두기재)
/etc/mail/access 에 RELAY 허용할 IP(대역) 기재
# makemap hash /etc/mail/access < /etc/mail/access
# /etc/rc.d/init.d/sendmail start


-- qpopper 4.0.x 설치
# ftp ftp.qualcomm.com
# ./configure --enable-specialauth --enable-servermode
# make
# cp popper /usr/local/lib/
# touch /etc/xinetd.d/pop3
# /etc/rc.d/init.d/xinet restart
TAG CentOS