2016년 5월 29일 일요일

cent OS 4.2 설치 메뉴얼

1. 리눅스 설치시 파티션
/boot 100M
/var  1000M (서버에서 대량메일 발송시 4000M로 잡는다)
swap  메모리의 두배로 잡는다 (ex: 512M 일때 1024M)
/tmp  500M
/    나머지 몽땅 (잡아줄때.. 하단 체크해서.. 메인 영역에 나타나도록 설치함)


-------
결과를 보면..
/boot
/
swap
extended 영역에..
  /var
  /tmp
로 구성이 되어 있으면 됨..


------------------------------------------------------------
2. 패키지는 Development Tools, FTP service 만 체크 하고 설치


cd 1,2,3번이 필요


cent OS 4.2 설치후 셋팅



------------------------------------------------------------
3. 네트워크 설정


Subnet: 255.255.255.240
Gateway: 222.111.111.111


나중에 다시 변경하려면..
netconfig
로 변경후.. 다시 시작해야 함..
/etc/rc.d/init.d/network restart


------------------------------------------------------------
4. Nofirewall 체크 하고 설치


하단 부분에..
Enable SELinux: Disabled 선택해 주세요.



------------------------------------------------------------
5. 텔넷과 ssh에서 한글깨지는 것 수정


/etc/sysconfig/i18n 를 수정해 주면 된다.


vi /etc/sysconfig/i18n


LANG="en_US.UTF-8"
SUPPORTED="en_US.UTF-8:en_US:en:ko_KR.UTF-8:ko_KR:ko"
SYSFonT="latarcyrheb-sun16"
이렇게 되어 있는 것을...하단처럼 수정..
----------------------->


LANG="ko_KR.eucKR"
SUPPORTED="en_US.UTF-8:en_US:en:ko_KR.eucKR:ko_KR:ko"
SYSFonT="lat0-sun16"
SYSFonTACM="8859-15"


수정후.. logout 했다가 다시 Login 하면 적용됨..


------------------------------------------------------------
6. 데몬 에러 삭제


ntsysv 실행하고
smartd 삭제
reboot


------------------------------------------------------------
7. root 사용자에게 단축키 등록


/root/.bashrc 에 등록한다.(앞으로의 일을 편리하게 하기 위해)
제일 하단에 등록하면 된다.


vi /root/.bashrc


# Ryu wrote start
alias l='ls -l'
alias ll='ls -al --show-control-chars'
alias ld='ls -ld'


alias tarzx='tar zxvpf'
alias tarzc='tar zcvpf'
alias tarx='tar xvpf'
alias tarc='tar cvpf'


alias vihttpd.conf='vi /usr/local/apache/conf/virtualhost.conf'
alias viinetd.conf='vi /etc/inetd.conf'
alias vinamed.conf='vi /etc/named.conf'
alias vilocal_host_names='vi /etc/mail/local-host-names'
alias vivirtusertable='vi /etc/mail/virtusertable'


alias kasendmail='killall -HUP sendmail'
alias kanamed='/etc/rc.d/init.d/named restart'
alias kahttpd='/usr/local/apache/bin/apachectl restart'
alias kaftpd='/etc/rc.d/init.d/proftpd restart'
alias kaxinetd='/etc/rc.d/init.d/xinetd restart'
alias kamysqld='/etc/rc.d/init.d/mysqld restart'


alias mysqlroot='mysql -u root -p mysql'


alias hashmail='makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable'
# Ryu wrote end


로그아웃 후 다시 로그인 하면 사용할 수 있다!



------------------------------------------------------------
8. ssh 포트 변경하기


/etc/ssh/sshd_config 수정


vi /etc/ssh/sshd_config


#Port 22
아래에 다음과 같이 입력
ex) Port 7148


vi 에디터 종료 후


/etc/rc.d/init.d/sshd stop
종료를 확인 후


시작
/etc/rc.d/init.d/sshd start


이후 접속부턴 포트를 바뀐 포트로 설정해 주셔야 사용가능합니다.



------------------------------------------------------------
9. 일반계정 추가시 단축키 설정


디렉토리를 만들고 퍼미션 701로 준다.


cd /usr/local
mkdir ucctown
chmod 701 ucctown


bin과 sbin 디렉토리 생성 bin 701 sbin 700 퍼미션 조정


cd ucctown
mkdir bin
chmod 701 bin
mkdir sbin
chmod 700 sbin


sbin에 사용자 쉘 등록


cd sbin


vi mailuseradd


#!/bin/sh
if [ -d /home/$2/.Mail ]
        then echo OK
        else
                echo OK
                mkdir /home/$2/.Mail
                chmod 701 /home/$2/.Mail
fi


useradd -d /home/$2/.Mail/$1 -s /bin/false $1
chmod 700 /home/$2/.Mail/$1
rm -f /home/$2/.Mail/$1/.bash*
passwd $1


입력


vi subuseradd


#!/bin/sh
if [ -d /home/$2/.Sub ]
        then echo OK
        else
                echo OK
                mkdir /home/$2/.Sub
                chmod 701 /home/$2/.Sub
fi


useradd -d /home/$2/.Sub/$1 $1
chmod 701 /home/$2/.Sub/$1
passwd $1


입력


vi webuseradd


#!/bin/sh
useradd $1
chmod 701 /home/$1
rm -f /home/$1/.mail
echo OK
passwd $1


입력


3개 파일 퍼미션 700으로 변경


chmod 700 *


cd ..


cd bin


만약에 텔넷 사용시 막아두는 쉘 (보안상 텔넷은 잘 사용하지 않는다.)


vi ucctownsh


#! /bin/sh


echo "텔넷 사용이 불가능합니다."
echo ""
echo "불가피하게 텔넷 작업이 필요하신 분은"
echo "담당자에게 메일 부탁드립니다."
exit


입력


chmod 705 ucctownsh


작성한걸 /usr/local/sbin에 심볼릭 링크


cd /usr/local/sbin


ln -s /usr/local/ucctown/sbin/mailuseradd mailuseradd
ln -s /usr/local/ucctown/sbin/webuseradd webuseradd
ln -s /usr/local/ucctown/sbin/subuseradd subuseradd


자 이제 사용이 가능할 것이다!



------------------------------------------------------------
10. 일반계정 등록


적당한 계정을 하나 등록한다.


webuseradd james



------------------------------------------------------------
11. ssh 접속시 root 접속 못하게 설정


vi /etc/ssh/sshd_config


#아래부분의 주석을 해제하고 no로 수정
PermitRootLogin no



------------------------------------------------------------
12. su 명령어 특정 사용자만 실행 가능하게 설정


우선 root 권한으로 명령을 실행할 수 있는 명령어 sudo를 삭제한다


rm -rf /usr/bin/sudo


첫 번째, /etc/group 파일에서 wheel 그룹에 su 명령어를 사용할 사용자를 추가합니다.


vi /etc/group


wheel:x:10:root,james


두 번째, /etc/pam.d/su


vi /etc/pam.d/su


#%PAM-1.0
auth      sufficient  /lib/security/$ISA/pam_rootok.so
아래에 추가
auth      required /lib/security/$ISA/pam_wheel.so debug group=wheel



/etc/rc.d/init.d/sshd stop
종료를 확인 후


시작
/etc/rc.d/init.d/sshd start


로그아웃했다가 다시 로그인해서 확인해 보라..


------------------------------------------------------------
13. 불필요한 rpm을 제거하기


서버에 불필요한 프로그램들을 삭제한다.
차근차근히 따라 하기를 바란다. 메뉴얼대로 걍 따라하면 된다.
rpm -e 이름 으로 삭제가 되지 않는다면 이름뒤에 --nodeps 옵션을 주면된다.


rpm -qa|grep sendmail
/etc/rc.d/init.d/sendmail stop
yum remove sendmail


rpm -qa|grep dosfstools
rpm -e dosfstools --nodeps


rpm -qa|grep hotplug
rpm -e hotplug --nodeps


rpm -qa|grep mkinitrd
rpm -e mkinitrd --nodeps



------------------------------------------------------------
14. 파일 디렉토리 권한 변경


/bin/rpm 의 기본 실행권한을 변경하는 방법
chmod 700 /bin/rpm


/etc/rc.d/init.d/ 의 스크립트 관리
부팅시 정상적인 서비스를 시작하게 하거나 또는 시작하지 않도록 제어하는 스크립트
파일의 실행권한을 조정


chmod -R 700 /etc/rc.d/init.d/*


cd /


chmod 701 bin/
chmod 701 boot/
chmod 701 dev/
chmod 701 etc/
chmod 701 home/
chmod 701 initrd/
chmod 701 lib/
chmod 701 media/
chmod 701 misc/
chmod 701 mnt/
chmod 701 opt/
chmod 700 root/
chmod 701 sbin/
chmod 701 usr/
chmod 701 var/


chmod 700 /bin/ps
chmod 700 /usr/bin/halt


chmod 700 /usr/bin/w
chmod 700 /usr/bin/who
chmod 700 /usr/bin/which


chmod 700 /usr/bin/wget



------------------------------------------------------------
15. proftpd 설치하기 (32비트용으로 깜..)


cd /usr/local/src


wget http://apt.sw.be/packages/proftpd/proftpd-1.2.10-8.0.rh9.dag.i386.rpm
rpm -Uvh proftpd-1.2.10-8.0.rh9.dag.i386.rpm


/etc/proftpd.conf 수정
vi /etc/proftpd.conf


#ListOptions                    "-a"
주석처리해 주세요.



------------------------------------------------------------
16. 크~~ 드디어 APM 설치(굉장히 주의를 해주기를...)


최초 mysql 설치 이번 메뉴얼에서는 mysql-4.0.18 버전으로 설치한다.


압축을 풀고


tar zxvf mysql-4.0.18.tar.gz


cd mysql-4.0.18


./configure --prefix=/usr/local/mysql --with-charset=euc_kr


make && make install


groupadd mysql


adduser -g mysql mysql


vi /etc/passwd


mysql:x:522:523::/home/mysql:/sbin/nologin // nologin 으로 수정


rm -rf /home/mysql


cd /usr/local/mysql/bin


./mysql_install_db


cd ..


chown -R mysql.mysql var


cd /usr/local/mysql/share/mysql


vi mysql.server


편집기로 열어서 safe_mysql이 실행되는 라인에 --language=korean 옵션을 추가한다.


$bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file --language=korean >/dev/null 2>&1 &


cp my-medium.cnf /etc/my.cnf


cp -p ./mysql.server /usr/local/mysql/bin/


vi /etc/profile


PATH="$PATH:/usr/X11R6/bin:/usr/local/mysql/bin"


추가


cp -p /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld


ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc3.d/S90mysqld


mysql 설치종료


mysql 실행


/etc/rc.d/init.d/mysqld start


mysql 종료


/etc/rc.d/init.d/mysqld stop


Mysql 경로 설정하기


vi ~/.bash_profile


PATH=$PATH:$HOME/bin:/usr/local/mysql/bin // db Path 부분만 추가


Mysql 관리자 비번 변경


/usr/local/mysql/bin/mysql mysql


use mysql


update user set password=password('패스워드입력') where user='root';


flush privileges;


exit



* mysql-ftont 접근 셋팅하기


mysqlroot


패스워드 입력


show databases;    <--현재 가지고 있는 데이터베이스를 보여 준다.


test 데이터베이스가 있을 경우 삭제 해 준다.


drop database test;


use mysql;


show tables;


select * from user;


update user set Host='%' where User='root' AND Host='호스트명';


flush privileges;


exit;


자 셋팅이 끝났다 확인해서 접속해 보자!



* jpeg 설치 - jpeg 압축 / 압축해제 라이브러리 소프트웨어


tar xvfz jpegsrc.v6b.tar.gz


cd jpeg-6b


cp /usr/share/automake-1.9/config.guess .
cp /usr/share/automake-1.9/config.sub .


./configure --enable-shared --enable-static


make
make install


에러가 난다면


mkdir /usr/local/man


mkdir /usr/local/man/man1


make install



* freetype 설치 - 텍스트의 이미지출력등을 하기 위한 공개 폰트엔진


tar xvfz freetype-2.1.9.tar.gz


cd freetype-2.1.9


./configure


make && make install


 


* libpng 설치


tar -xzvf libpng-1.2.7.tar.gz


cd libpng-1.2.7


cp scripts/makefile.linux makefile


make && make install


 


gd설치하기


tar -xzvf gd-2.0.28.tar.gz


cd gd-2.0.28


./configure


make && make install



libmcrypt-2.5.7.tar.gz 설치


tar xvzfp libmcrypt-2.5.7.tar.gz


cd libmcrypt-2.5.7


./configure


make && make install



mm-1.3.1.tar.gz 설치


tar xvzfp mm-1.3.1.tar.gz


cd mm-1.3.1


./configure


make && make install



** 이번엔 아파치 설치


tar xvzfp httpd-2.0.54.tar.gz


cd httpd-2.0.54


./configure --prefix=/usr/local/apache --enable-rule=SHARED_CORE --enable-modules=so --enable-so --enable-shared=max


make && make install


cd -


ln -s /usr/local/apache/bin/apachectl /usr/sbin/


ln -s /usr/local/apache/bin/httpd /usr/sbin/


ln -s /usr/local/mysql/bin/mysql /usr/sbin/


echo "/usr/local/apache/lib" >> /etc/ld.so.conf


/sbin/ldconfig


vi /usr/local/apache/conf/httpd.conf


//맨마지막 줄에 내용 추가.. (있는지 확인하고..)
AddType application/x-httpd-php .php .php4 .html .phtml .inc
AddType application/x-httpd-php-source .phps


#Virtual Each Setting file..
Include conf/virtualhost.conf


저장하고..



vi /usr/local/apache/conf/virtualhost.conf
해서 아래 내용 입력한다..


NameVirtualHost 211.321.321.321


#--- UCCTown.co.kr ---#
<VirtualHost 211.321.321.321>
ServerName myhost.co.kr
ServerAlias www.myhost.co.kr
DocumentRoot "/home/myhost"
</VirtualHost>


#--- qbox.tv ---#
<VirtualHost 211.321.321.321>
ServerName youhost.co.kr
ServerAlias www.youhost.co.kr
DocumentRoot "/home/youhost"
</VirtualHost>



아파치 설치 끝!!!


 


** 제일 문제인 php 설치!!!


tar xvzfp php-5.0.4.tar.gz


cd php-5.0.4


중요한 설정 부분!


./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/etc --with-zlib --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --with-gd --with-mysql=/usr/local/mysql --with-mod-charset --with-libxml-dir=/usr/include/libxml2 --with-language=korean --with-charset=euc_kr --with-openssl --with-xml --with-gmp --enable-gd-native-ttf --with-iconv --with-iconv-dir --with-ftp


make


make install


cp php.ini-dist /etc/php.ini


 


** Zend 설치 !


tar zxvf ZendOptimizer-2.5.7-linux-glibc21-i386.tar.gz


cd ZendOptimizer-2.5.7-linux-glibc21-i386


./install.sh



여기까지 드디어 APM 설치가 완료되었습니다.


이제 남은건 설정부분을 수정해 주는 것입니다.


이부분 꽤 중요합니다.



**  아파치 설정


httpd.conf 파일 참조



혹시 Forbidden 에러가 난다면 아래를 참조해 보시길..
<Directory /home/*>
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>


 


**  PHP 설정하기


vi /usr/local/Zend/etc/php.ini
register_globals = on
// register_globals = Off 를 on 으로 수정


아파치 다시 시작


------------------------------------------------------------
17. 부팅시 자동 시작하도록 설정하기


vi /etc/rc.local
//마지막 줄에 아래 추가


/usr/local/apache/bin/apachectl start
/etc/rc.d/init.d/mysqld start
/etc/rc.d/init.d/named start
/etc/rc.d/init.d/proftpd start


 


------------------------------------------------------------
17. jdk 설치


최신 버전 jdk-1_5_0_06-linux-i586-rpm.bin 로 설치


우선 권한 변경


chmod 755 jdk-1_5_0_06-linux-i586-rpm.bin


./jdk-1_5_0_06-linux-i586-rpm.bin


해주면 머라머라 영어로 나온다 스페이스바로 넘기다 보면


yes no 가 나온다


당연 yes를 하면 설치가 된다


설치 후 환경변수만 잡아 주면 된다.


 



vi /etc/profile
=======================================================================================
JAVA_HOME=/usr/java/jdk1.5.0_06
APACHE_HOME=/usr/local/apache
PATH=$PATH:$JAVA_HOME/bin:$APACHE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
export JAVA_HOME CLASSPATH APACHE_HOME
export NLS_LANG=.KO16KSC5601
=======================================================================================


source /etc/profile


 


------------------------------------------------------------
18. Tomcat 설치


필요한 소스
apache-tomcat-5.5.12.tar.gz


tar xvfz apache-tomcat-5.5.12.tar.gz


mv apache-tomcat-5.5.12 /usr/local/tomcat


환경변수 수정 (파일제공)


vi /etc/profile


JAVA_HOME=/usr/java/jdk1.5.0_06
CATALINA_HOME=/usr/local/tomcat
APACHE2_HOME=/usr/local/apache
PATH=$PATH:$JAVA_HOME/bin:$APACHE2_HOME/bin:$CATALINA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
export JAVA_HOME CLASSPATH APACHE2_HOME CATALINA_HOME
export NLS_LANG=.KO16KSC5601


source /etc/profile


 


------------------------------------------------------------
19. Tomcat Web Server Connector, JK2를 이용한 Apache2 웹서버와 Tomcat5의 연동


필요한 소스들을 챙겨둔다.


apr-1.2.2.tar.gz
apr-util-1.2.2.tar.gz
libtool-1.5.20.tar.gz
jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz



우선 apr 설치


tar xvzf apr-1.2.2.tar.gz


cd apr-1.2.2


./configure --prefix=/usr/local/apr


make


make install


다음은 apr-util 설치


tar xvzf apr-util-1.2.2.tar.gz


cd apr-util-1.2.2


./configure --with-apr=/usr/local/apr


make


make install


libtool 설치


tar xvzf libtool-1.5.20.tar.gz


cd libtool-1.5.20


./configure --prefix=/usr/local/libtool


make


make install


vi /etc/profile


#libtool
PATH=$PATH:/usr/local/libtool
export PATH


추가


source /etc/profile


mv /usr/local/apache/build/libtool /usr/local/apache/build/libtool_old


ln -s /usr/local/libtool/bin/libtool  /usr/local/apache/build/libtool



젤로 중요한 톰캣 커넥터 설치


tar xvzf jakarta-tomcat-connectors-jk2-src-current.tar.gz


cd jakarta-tomcat-connectors-jk2-2.0.4-src/


cd jk/native2/


./buildconf.sh


./configure --with-apxs2=/usr/local/apache/bin/apxs



no apxs given
need to check for Perl first, apxs depends on it...
checking for perl... /usr/bin/perl
configure: error: can't locate libapr


libapr.so 파일을 못 찾아서 에러냄 -.-;


touch /usr/local/apache/lib/libapr.so  로 configure 속임 -_-



./configure --with-apxs2=/usr/local/apache/bin/apxs


에러가 난다면 vi /etc/profile을 살펴 보세요..


혹시 아파치 변수가 APACHE_HOME로 잡혀 있다면 APACHE2_HOME로 수정후


source /etc/profile


./configure --with-apxs2=/usr/local/apache/bin/apxs


make


cd ..


cd build


cd jk2


cd apache2


cp mod_jk2.so /usr/local/apache/modules


chmod +x /usr/local/apache/modules/mod_jk2.so


cd ..


cd ..


cd ..


cd ..


cd conf


cp workers2.properties /usr/local/apache/conf


vi /usr/local/apache/conf/workers2.properties 수정


 # Shared memory handling. Needs to be set.
 [shm]
 file=/var/log/httpd/shm.file
 size=1048576
 debug=0
 disabled=0


 # Example socket channel, explicitly set port and host.
 [channel.socket:localhost:8009]
 port=8009
 host=192.123.123.123  //내 IP 적어줌


 # define the worker
 [ajp13:localhost:8009]
 channel=channel.socket:localhost:8009


 # Announce a "status" worker
 [status:status]


 # Uri mapping
 [uri:/jsp-examples/*]
 worker=ajp13:localhost:8009


 [uri:/servlets-examples/*]
 worker=ajp13:localhost:8009


 [uri:/tomcat-docs/*]
 worker=ajp13:localhost:8009


 [uri:/*.jsp]
 worker=ajp13:localhost:8009


 [uri:/status/*]
 worker=status:status


셋팅 끝 아파치 재가동 톰캣 재가동


------------------------------------------------------------
20. 네임서버 설정


(2) /etc/resolv.conf (서버에서 쓸 dns)
search 도메인  : 여기에는 보통 자기 도메인 또는 localhost를 적습니다.(3개까지 가능)
nameserver 아이피 : 서버에서 사용할 dns를 적습니다. 주로 위에서 설명들인 대표 dns를 적습니다.(3개까지)
예)
search localhost
nameserver 168.126.63.1
nameserver 168.126.63.2


 


------------------------------------------------------------
21. 센드메일 설치


yum install sendmail


cd /etc/mail


vi sendmail.mc


dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl


위의 내용에서 빨간 부분을 지우시기 바랍니다.


DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
아래와 같이 빨간 부분을 적어 넣어 주석 처리 합닏.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl


편집 종료


[root@test mail]# pwd
/etc/mail
[root@test mail]# m4 sendmail.mc > sendmail.cf


/etc/rc.d/init.d/sendmail restart


/etc/mail/access 파일 편집


vi /etc/mail/access


이 파일을 잘 사용하면 조금의 스팸 필터링을 할 수 있습니다. 하지만 기본 설정만 하도록 하겠습니다.
이 서버에서 사용할 도메인을 다음과 같이 넣어줘야 합니다. 예를 들어 도메인이 0link.co.kr 이라면,
0link.co.kr                    RELAY
이렇게 relay가 가능하게 합니다. 이 설정은 메일을 보낼 때 위 도메인으로 메일을 보내면 relay를 하겠단 설정입니다.
이렇게 설정하고 다음과같이 db를 만둘어 주어야 합니다.


makemap hash access < access


vi /etc/mail/local-host-names


이 파일은 쉽게 설명하면 메일을 받을 도메인을 넣어두는 파일입니다.. 예를들어 도메인이 0link.co.kr이라면,
0link.co.kr
위와같이 도메인을 달랑 적어주면 됩니다. 물론 다중 도메인이면 한 도메인에 한줄씩 줄~줄~ 적으면 됩니다.
위 파일설정을 바꾼 다음엔 반드시 sendmail을 재 시작해 줘야합니다.~


compat-libcom_err-1.0-5.i386.rpm 설치


pop3서버 설치


rpm -qa | grep imap
imap-2001a-18


위와같이 설치되어 있지 않다면 다음 방법으로 설치하시기 바랍니다.
wget http://ftp.superuser.co.kr/pub/redhat/9/RPMS/imap-2001a-18.i386.rpm
rpm -Uvh imap-2001a-18.i386.rpm


이렇게 설치 하게 되면, imap, imaps , ipop3, pop3s 이렇게 4개의 서버가 설치됩니다.
여기서 ipop3 만 사용합니다.


ntsysv
명령어를 사용하여 다른 데몬은 채크를 지워 주시기 바랍니다. 물론 ipop3는 채크가 된 상태여야 합니다.


/etc/rc.d/init.d/xinetd restart


ps. -  cat /dev/null > 파일명


 


   
vsftp 자동 설치하고 나서 에러가 나는 경우.
/etc/vsftp.conf 열어서..한 줄 추가
pasv_promiscuous=YES
저장하 재시작
service vsftpd start
 vsftp 자동 설치하고 나서 에러가 나는 경우.
/etc/vsftp.conf 열어서..한 줄 추가
pasv_promiscuous=YES
저장하 재시작
service vsftpd start
 
 
 
 
// ---------------------------------------------------------------------------
OS : CentOS release 5.2


* OS 설치시 package Group 내가 선택한 것..
- Editors
- Engineering and Scientific
- Development Tools
- Administration Tools
- System Tools



mysql 설치
mysql-5.0.24


configure 시 오류 메세지
오류 메세지 : checking for termcap functions library... configure: error: No curses/termcap library found
해결 방법 : yum -y install ncurses-devel


./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euckr --enable-thread-safe-client
make && make install


# cd /usr/local/mysql/bin
# ./mysql_install_db
# useradd -M mysql
# chown -R mysql:mysql /usr/local/mysql/data
# /usr/local/mysql/bin/mysqld_safe &
# cd /usr/local/mysql/bin
# ./mysqladmin -u root password 암호
# ./mysql -u root -p mysql


apache 설치
httpd-2.0.63
접속자 수 최대로 올리기
# vi server/mpm/prefork/prefork.c
[EDITOR]#define DEFAULT_SERVER_LIMIT 256 을
[EDITOR]#define DEFAULT_SERVER_LIMIT 1280 으로 수정
저장하고 아웃
# vi server/mpm/worker/worker.c
[EDITOR]#define DEFAULT_SERVER_LIMIT 16 을
[EDITOR]#define DEFAULT_SERVER_LIMIT 20 으로 수정
저장하고 아웃
./configure --prefix=/usr/local/apache2 --enable-so --enable-modules=so --with-mpm=worker --enable-rewrite
make && make install



php 설치
php-5.2.6
configure 시 오류
오류 메세지 : configure: error: xml2-config not found. Please check your libxml2 installation
해결 방법 : yum install libxml2 libxml2-devel -y


오류 메세지 : configure: error: Please reinstall the BZip2 distribution
해결 방법 : yum -y install bzip2-devel


오류 메세지 : configure: error: libjpeg.(a|so) not found.
해결 방법 : yum -y install libjpeg-devel


오류 메세지 : configure: error: libpng.(a|so) not found.
해결 방법 : yum -y install libpng-devel


오류 메세지 : configure: error: freetype.h not found.
해결 방법 : yum -y install freetype-devel


오류 메세지 : configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
해결 방법 : yum -y install libc-client-devel


오류 메세지 : configure: error: Kerberos libraries not found.
해결 방법 : yum -y install krb5-devel


오류 메세지 : configure: error: Cannot find OpenSSL's <evp.h>
해결 방법 : yum -y install openssl-devel


./configure --enable-bcmath --enable-ftp --enable-filepro --enable-libxml2 --enable-memory-limit --enable-sockets --enable-spl --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-versioning --enable-wddx --disable-cli --disable-debug --disable-dmalloc --disable-posix --disable-rpath --with-apxs2=/usr/local/apache2/bin/apxs --with-bz2 --with-freetype-dir --with-gd --with-gettext --with-imap=shared --with-jpeg-dir --with-kerberos --with-libxml-dir --with-mod-charset --with-mysql=/usr/local/mysql --with-png-dir --with-ttf --with-zlib --with-mysqli=/usr/local/mysql/bin/mysql_config --with-imap-ssl=/usr/lib --with-openssl
ssl 추가시 
make && make install



apache httpd.conf 설정


NameVirtualHost *:80
ServerName *:80


KeepAlive On
KeepAliveTimeout 2
(2초간 접속을 끊지 않고 기다린다..)


Timeout 30
(dos 공격 방지)


ServerLimit 20 --> 서버 갯수를 설정
StartServers 20 --> 아파치를 처음 시작할때 생성하는 서버 갯수
MaxClients 500 --> ThreadsPerChild * StartServers 값
ThreadsPerChild 25 --> 서버 하나가 만들어 낼수 있는 쓰레드 갯수입니다. 최대 64개
MinSpareThreads 25 --> 서버 하나가 만들어 낼수 있는 쓰레드의 최소 갯수입니다. 보통은 ThreadsPerChild 와 맞추어 줌
MaxSpareThreads 500 --> 시스템 전체에서 만들어 낼수 있는 쓰레드 갯수의 최대치



<VirtualHost *:80>
    AddType application/x-httpd-php .php .html .inc .htm
    #php 를 인식 시킬 확장자 명
    ServerAdmin 이메일
    #서버 관리자 이메일
    DocumentRoot /home/test
    #html 을 읽을 위치
    ServerName 도메인
    #도메인 주소
#  php_admin_value auto_prepend_file /home/test/move_url/move_page.html
    #도메인 접근시 최초 열어볼 페이지 주소
#  RewriteEngine on
    #Rewrite Engine 사용 여부
#  RewriteRule ^/([a-zA-Z0-9]+)$ /home/test/rewrite.html?rewrite=$i
    #Rewrite 사용시 load 할 페이지 주소
    php_admin_flag register_globals On
    #register_global 설정
</VirtualHost>


 

댓글 없음:

댓글 쓰기