반응형
/*
* 웹서버 설치 파일 저장 디렉토리 생성
*/
cd /home/eva/WEB/web_install
/*
* JDK 설치
*/
chmod 777 jdk-6u21-linux-i586.bin
./jdk-6u21-linux-i586.bin
mv ./jdk1.6.0_21 /usr/local/jdk1.6.0_21
/*
* profile 환경변수 설정
*/
vi /etc/profile
### for jdk setting ###
export CATALINA_HOME=/home/eva/WEB/apache-tomcat-6.0.29
export JAVA_HOME=/usr/local/jdk1.6.0_21
export PATH=$JAVA_HOME/bin:$CATALINA_HOME/bin:$PATH
export PATH
export CLASSPATH=$CLASSPATH:JAVA_HOME/lib
/*
* 아파치 설치
*/
tar -xvpzf httpd-2.2.16.tar.gz
cd httpd-2.2.16
./configure --prefix=/usr/local/httpd
make
make install
cd /usr/local/httpd
/*
* 아파치 환경파일 백업
*/
cd conf
cp httpd.conf httpd.conf.20101202
/*
* 아파치 환경파일 수정
*/
vi httpd.conf
DocumentRoot "/home/eva/WEB/WPSS" ====> root 디렉토리 지정
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module /usr/local/httpd/modules/mod_jk.so
# Where to find workers.properties
# update this path to match your conf directory location
JkWorkersFile /usr/local/httpd/conf/workers.properties
# Where to put jkshared Memory
#JkShmFile /usr/local/httpd/logs/mod_jk.shm
# where to put jk logs
JkLogFile /usr/local/httpd/logs/mod_jk.log
# Set the jk log level [debug/error/info]
#JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat "%w %V %T"
JkMount /*.jsp worker1
JkMount /webapps/* worker1
JkMount /ROOT/* worker1
JkMount /CMS7_Server/* worker1
JkMount /*.cms worker1
/*
* Mod JK 환경파일 설정
*/
vi workers.properties
worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=worker1
worker.inprocess.type=jni
/*
* Mod_jk 복사
*/
cp /home/eva/WEB/web_install/mod_jk-1.2.28-httpd-2.2.X.so /usr/local/httpd/modules/mod_jk.so
/*
* 서버 방화벽 iptables 설정
* 안해도 됨... 혹시나 80,8080 포트를 사용할수 있게 되었는지 확인해 봐야됨.
*/
--파일
vi /etc/sysconfig/iptables
--내용
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 543 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 557 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1522 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1523 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1524 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
/*
* 아파치 웹 디렉토리 권한 설정
*/
chmod 755 * ==>모든 디렉토리 파일을 755 로 설정해준다...어이가 없네 서글
/*
* 톰켓 설치
*/
tar xvzf apache-tomcat-6.0.29.tar.gz
mv ./apache-tomcat-6.0.29 /home/eva/WEB/apache-tomcat-6.0.29
/*
* 톰켓 환경파일 수정
*/
/home/eva/WEB/apache-tomcat-6.0.29/conf/tomcat-users.xml
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat,manager"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
==> 주석을 풀어주고, tomcat계정 roles에 manager를 추가한다.
/*
* 톰켓 자바 힙 메모리 입빠이~~설정
*/
vi catalina.sh
if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms1024m -Xmx2049m"
else
# JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Xms1024m -Xmx2049m"
fi
/*
* 톰켓 관련 디렉토리 권한 설정
*/
cd /home/eva/WEB/apache-tomcat-6.0.29/
find . -type d -exec chmod 755 {} \;
==> 하위 전체 권한을 줘야한다.
* 웹서버 설치 파일 저장 디렉토리 생성
*/
cd /home/eva/WEB/web_install
/*
* JDK 설치
*/
chmod 777 jdk-6u21-linux-i586.bin
./jdk-6u21-linux-i586.bin
mv ./jdk1.6.0_21 /usr/local/jdk1.6.0_21
/*
* profile 환경변수 설정
*/
vi /etc/profile
### for jdk setting ###
export CATALINA_HOME=/home/eva/WEB/apache-tomcat-6.0.29
export JAVA_HOME=/usr/local/jdk1.6.0_21
export PATH=$JAVA_HOME/bin:$CATALINA_HOME/bin:$PATH
export PATH
export CLASSPATH=$CLASSPATH:JAVA_HOME/lib
/*
* 아파치 설치
*/
tar -xvpzf httpd-2.2.16.tar.gz
cd httpd-2.2.16
./configure --prefix=/usr/local/httpd
make
make install
cd /usr/local/httpd
/*
* 아파치 환경파일 백업
*/
cd conf
cp httpd.conf httpd.conf.20101202
/*
* 아파치 환경파일 수정
*/
vi httpd.conf
DocumentRoot "/home/eva/WEB/WPSS" ====> root 디렉토리 지정
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module /usr/local/httpd/modules/mod_jk.so
# Where to find workers.properties
# update this path to match your conf directory location
JkWorkersFile /usr/local/httpd/conf/workers.properties
# Where to put jkshared Memory
#JkShmFile /usr/local/httpd/logs/mod_jk.shm
# where to put jk logs
JkLogFile /usr/local/httpd/logs/mod_jk.log
# Set the jk log level [debug/error/info]
#JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat "%w %V %T"
JkMount /*.jsp worker1
JkMount /webapps/* worker1
JkMount /ROOT/* worker1
JkMount /CMS7_Server/* worker1
JkMount /*.cms worker1
/*
* Mod JK 환경파일 설정
*/
vi workers.properties
worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=worker1
worker.inprocess.type=jni
/*
* Mod_jk 복사
*/
cp /home/eva/WEB/web_install/mod_jk-1.2.28-httpd-2.2.X.so /usr/local/httpd/modules/mod_jk.so
/*
* 서버 방화벽 iptables 설정
* 안해도 됨... 혹시나 80,8080 포트를 사용할수 있게 되었는지 확인해 봐야됨.
*/
--파일
vi /etc/sysconfig/iptables
--내용
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 543 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 557 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1522 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1523 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1524 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
/*
* 아파치 웹 디렉토리 권한 설정
*/
chmod 755 * ==>모든 디렉토리 파일을 755 로 설정해준다...어이가 없네 서글
/*
* 톰켓 설치
*/
tar xvzf apache-tomcat-6.0.29.tar.gz
mv ./apache-tomcat-6.0.29 /home/eva/WEB/apache-tomcat-6.0.29
/*
* 톰켓 환경파일 수정
*/
/home/eva/WEB/apache-tomcat-6.0.29/conf/tomcat-users.xml
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat,manager"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
==> 주석을 풀어주고, tomcat계정 roles에 manager를 추가한다.
/*
* 톰켓 자바 힙 메모리 입빠이~~설정
*/
vi catalina.sh
if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms1024m -Xmx2049m"
else
# JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Xms1024m -Xmx2049m"
fi
/*
* 톰켓 관련 디렉토리 권한 설정
*/
cd /home/eva/WEB/apache-tomcat-6.0.29/
find . -type d -exec chmod 755 {} \;
==> 하위 전체 권한을 줘야한다.
728x90
반응형
댓글