| 
				
				
					|  |  
					|  |  
					
				 
					|  |  
					|   |  
					|  |  
					|  |  
					|  |  
					|  |  
					|  |  
					|  |  
					|  |  
					|  |  
					|  |  
					| 
							
								| 6만원 이상 무료배송 |  
								|  |  
								| 주문하시는 총상품금액의 합계가
 6만원 이상일 경우
 택배비가 무료입니다.
 |  |  
					|  |  
					|  |  |  | 
	
		|  |  
		|  |  
		|  
				
					| linux (centos 5.3) 에서 apache php mysql jdk tomcat 설치 및 설정 |  |  
		|  |  
		|  
				
					| 작성자: 
						
							방장
						
						  
						
							작성일: 2009-07-02 17:47  
						
						조회: 118336  
						댓글: 1 |  |  
		|  |  
		| 
				
					| linux (centos 5.3) 에서 apache php mysql jdk tomcat 설치 
 
 yum -y install gcc cpp gcc-c++ compat-gcc-34-g77 flex openssl*
 yum -y install libjpeg-devel libpng-devel freetype-devel gd-devel libtermcap-devel ncurses-devel libxml2-devel libc-client-devel bzip2-devel
 
 #확인
 rpm -qa gcc* cpp* compat-gcc* flex* openssl*
 rpm -qa libjpeg* libpng* freetype* gd-*
 reboot [패키지_변경시_리부팅_필요]
 
 cd /usr/local/src
 wget ftp://ftp.neowiz.com/pub/mysql/Downloads/MySQL-5.1/mysql-5.1.35.tar.gz
 tar xvzf mysql-5.1.35.tar.gz
 wget ftp://ftp.neowiz.com/pub/apache/httpd/httpd-2.2.11.tar.gz
 tar xvzf httpd-2.2.11.tar.gz
 wget ftp://ftp.neowiz.com/pub/languages/php/php-5.2.10.tar.gz
 tar xvzf php-5.2.10.tar.gz
 useradd -M -s /bin/false mysql
 cd /usr/local/src/mysql-5.1.35
 ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all
 make && make install
 ll /usr/local/mysql
 /usr/local/mysql/bin/mysql_install_db --user=mysql
 chown -R root.mysql /usr/local/mysql
 chown -R mysql /usr/local/mysql/var
 
 vi /etc/profile
 PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
 source /etc/profile
 
 cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
 cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
 chkconfig --add mysqld
 chkconfig --list mysqld
 service mysqld start
 
 cd /usr/local/src/httpd-2.2.11
 ./configure --prefix=/usr/local/apache --enable-mods-shared=all --enable-so --enable-ssl --enable-modules=ssl --enable-rewrite --with-mpm=prefork
 make && make install
 
 cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
 vi /etc/init.d/httpd
 service httpd start
 
 
 cd /usr/local/src/php-5.2.10
 ./configure --with-config-file-path=/etc --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --disable-debug --enable-safe-mode --enable-sockets --enable-sysvsem=yes --enable-sysvshm=yes --enable-ftp --enable-gd-native-ttf --enable-inline-optimization --enable-bcmath --with-zlib --with-jpeg-dir --with-png-dir --with-freetype-dir --with-libxml-dir --enable-exif --with-gd --with-ttf --with-gettext --enable-sigchild --enable-mbstring --with-openssl --with-imap --with-imap-ssl --with-kerberos
 make && make install
 
 cp /usr/local/src/php-5.2.10/php.ini-dist /etc/php.ini
 vi /usr/local/apache/conf/httpd.conf
 User apache
 Group apache
 ServerName www.hompy.info:80
 DocumentRoot "/usr/local/apache/htdocs"
 LoadModule ssl_module modules/mod_ssl.so
 
 DirectoryIndex index.html index.htm index.php
 
 
 AddType application/x-httpd-php .php .html
 AddType application/x-httpd-php-source .phps
 
 service httpd restart
 rm /usr/local/apache/htdocs/index.html
 echo '' > /usr/local/apache/htdocs/index.php
 
 cd /usr/local/src
 tar xvzf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
 cd ZendOptimizer-3.3.3-linux-glibc23-i386
 ./install.sh
 # rm /etc/php.ini
 # ln -s /usr/local/Zend/etc/php.ini /etc/php.ini
 /usr/local/php/bin/pear upgrade-all
 /usr/local/php/bin/pear install DB File Mail Mail_Mime
 /usr/local/php/bin/pear install MDB2 MDB2_Driver_mysql MDB2_Driver_mysqli
 /usr/local/php/bin/pear install HTTP_Request XML_RPC
 vi /etc/profile
 PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/php/bin
 source /etc/profile
 /usr/local/apache/conf/httpd.conf
 #Include conf/extra/httpd-ssl.conf
 mkdir /usr/local/apache/conf/ssl
 cat > /usr/local/apache/conf/ssl/auto.sh
 #!/bin/sh
 echo "password"
 ^D
 chmod 700 /usr/local/apache/conf/ssl/auto.sh
 vi /usr/local/apache/conf/extra/httpd-ssl.conf
 #SSLPassPhraseDialog  builtin
 SSLPassPhraseDialog  exec:/usr/local/apache/conf/ssl/auto.sh
 DocumentRoot "/usr/local/apache/htdocs"
 ServerName www.hompy.info:443
 ServerAdmin your@email.com
 SSLCertificateFile /usr/local/apache/conf/ssl/server.crt
 SSLCertificateKeyFile /usr/local/apache/conf/ssl/server.key
 SSLCertificateChainFile /usr/local/apache/conf/ssl/server-ca.crt
 
 ---
 service httpd restart
 
 
 
 
 자바설치(jdk1.5.0_10)
 
 cd /usr/local/src
 ./jdk-1_5_0_10-linux-i586-rpm.bin
 yes
 설치완료
 /etc/profile에 추가
 export JAVA_HOME=/usr/java/jdk1.5.0_10
 PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/php/bin:/usr/java/jdk1.5.0_10/bin
 source /etc/profile
 
 
 
 jk 커넥터설치
 cd /usr/local/src
 tar xvfz tomcat-connectors-1.2.28-src.tar.gz
 cd tomcat-connectors-1.2.28-src/native
 ./configure --with-apxs=/usr/local/apache/bin/apxs
 make && make install
 mod_jk.so 가 /usr/local/apache/modules 디렉토리 안에 있고, 권한은 755로 설정되어있는지 확인한다..
 
 
 
 톰캣설치
 cd /usr/local
 tar xvfz apache-tomcat-5.5.27.tar.gz
 mv apache-tomcat-5.5.27 tomcat
 
 
 가상호스트 및 톰캣연동
 /usr/local/apache/conf/httpd.conf 파일설정
 
 # 가상호스트 및 톰캣연동
 LoadModule    jk_module  modules/mod_jk.so
 # Where to find workers.properties
 JkWorkersFile /usr/local/apache/conf/workers.properties
 # Where to put jk shared memory
 JkShmFile     /usr/local/apache/logs/mod_jk.shm
 # Where to put jk logs
 JkLogFile     /usr/local/apache/logs/mod_jk.log
 # Set the jk log level [debug/error/info]
 JkLogLevel    info
 # Select the timestamp log format
 JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
 Include conf/extra/httpd-vhosts.conf
 
 /usr/local/apache/conf/workers.properties 파일설정
 worker.list=tomcat1
 worker.tomcat1.port=8009
 worker.tomcat1.host=localhost
 worker.tomcat1.type=ajp13
 
 
 /usr/local/apache/conf/extra/httpd-vhosts.conf 파일설정
 
 #
 # Virtual Hosts
 #
 # If you want to maintain multiple domains/hostnames on your
 # machine you can setup VirtualHost containers for them. Most configurations
 # use only name-based virtual hosts so the server doesn't need to worry about
 # IP addresses. This is indicated by the asterisks in the directives below.
 #
 # Please see the documentation at
 # <URL:http://httpd.apache.org/docs/2.2/vhosts/>
 # for further details before you try to setup virtual hosts.
 #
 # You may use the command line option '-S' to verify your virtual host
 # configuration.
 #
 # Use name-based virtual hosting.
 #
 NameVirtualHost *:80
 #
 # VirtualHost example:
 # Almost any Apache directive may go into a VirtualHost container.
 # The first VirtualHost section is used for all requests that do not
 # match a ServerName or ServerAlias in any block.
 #
 # 톰캣연동안한것
 
 ServerAdmin your@email.com
 DocumentRoot "/home/webdata/your.domain.com"
 ServerName your.domain.com
 ErrorLog "logs/your.domain.com-error_log"
 CustomLog "logs/your.domain.com-access_log" common
 
 Options FollowSymLinks
 Order allow,deny
 Allow from all
 
 
 # 톰캣연동한것
 
 ServerAdmin your@email.com
 ServerAlias www.albumbang.com
 ErrorLog "logs/albumbang-error_log"
 CustomLog "logs/albumbang-access_log" common
 JkMount  /* tomcat1
 
 
 
 
 /usr/local/tomcat/conf/server.xml 파일설정
 -----생략-----
 
 
 -----생략-----
 
 enableLookups="false" redirectPort="8443" protocol="AJP/1.3" URIEncoding="utf-8" />
 
 
 
 -----생략-----
 www.albumbang.com" unpackWARs="true" autoDeploy="true">
 
 driverClassName="com.mysql.jdbc.Driver"
 url="jdbc:mysql://localhost:3306/mydb?autoReconnect=true&useUnicode=true&characterEncoding=euckr"
 username="myname"
 password="mypw"
 maxActive="100"
 maxIdle="10"
 removeAbandoned="true"
 maxWait="10000"
 validationQuery="select 1"
 testOnBorrow="true"
 testWhileIdle="true"
 timeBetweenEvictionRunsMillis="10000"
 minEvictableIdleTimeMillis="60000" />
 
 
 
 
 
 
 
 
 
 
 [리눅스에 톰캣과 아파치 설치후 부팅시 자동으로 실행하기]
 
 * 부팅시 톰캣 자동실행
 cd /etc/rc.d/init.d
 ln -s /usr/local/tomcat/bin/catalina.sh tomcatd
 cd /etc/rc.d/rc3.d
 ln -s /etc/rc.d/init.d/tomcatd S72tomcatd
 (혹 안되면 /usr/local/tomcat/bin/catalina.sh 에 다음과 같이 설정한다. export JAVA_HOME=/usr/java/jdk1.5.0_10)
 
 * 부팅시 아파치 자동실행
 #cd /etc/rc.d/init.d
 #ln -s /usr/local/apache/bin/apachectl httpd
 cd /etc/rc.d/rc3.d
 ln -s /etc/rc.d/init.d/httpd S75httpd
 
 
 
 
 
 /etc/profile 설정
 
 PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/java/jdk1.5.0_10/bin
 export JAVA_HOME=/usr/java/jdk1.5.0_10/bin
 alias apacherestart="/usr/local/apache/bin/apachectl restart"
 alias apachelog="tail -f /usr/local/apache/logs/error_log"
 alias apacheps="ps -ef|grep httpd"
 alias tomstart="/usr/local/tomcat/bin/catalina.sh start"
 alias tomstop="/usr/local/tomcat/bin/catalina.sh stop"
 alias tomlog="tail -f /usr/local/tomcat/logs/catalina.out"
 alias net80="netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l"
 
 다했으면
 source /etc/profile
 한다.
 
 
 
 
 감사합니다.
 
 
 
 |  |  
		|  |  
		|  |  
		|  |  
		| * 관련 댓글 한말씀 부탁합니다. |  
		|  |  |