  | 
	
 | 	
	  | 
	
	
		
	  |  
	| 
	
	 |  
	 
		
		
			 ▶ 아래에 있는 모든 내용을 파일로 저장한 후 쉘명령어로 실행시키면 자동으로 APM이 설치됩니다.(centos 4.1~4.8까지는 정상적으로 작동하지만 다른 버전에서              설치하시면 정상적으로 작동 안 할 수도 있습니다.) |  
		  |  
	 
		
		
			
				
				############## APM 파일 다운로드 ################ 
				cd /usr/local/src/ 
				wget http://g01.asadal.net/apm-4.4.4_mysql4.0.tar.gz 
				tar xvzpf apm-4.4.4_mysql4.0.tar.gz 
				sh apm_install.sh
  
				################################################ 
				# #              Installation Program started                      # # 
				# #              < ASADAL >                                          # # 
				# #    ==============  Package List  =================   # # 
				# #               1. APACHE 1.3.37                                  # # 
				# #               2. PHP 4.4.4                                          # # 
				# #               3. MySQL 4.0.27                                    # # 
				# #               4. GD 2.0.26                                          # # 
				# #               5. ZendOptimizer 2.6.2                            # # 
				# #               6. Mod_Throttle 3.1.2                             # # 
				# #=================================================# # 
				# ############################################ # 
				# ############################################ #
  
				################## 변수값 설정 ################## 
				apache=apache_1.3.37 
				php=php-4.4.4 
				mysql=mysql-4.0.27 
				zend=ZendOptimizer-2.6.2-linux-glibc21-i386 
				mod_throttle=mod_throttle-3.1.2
  
				zlib=zlib-1.2.3 
				libjpeg=jpeg-6b 
				libpng=libpng-1.2.8 
				libmcrypt=libmcrypt-2.5.7 
				libiconv=libiconv-1.9.2 
				freetype=freetype-2.1.9 
				gd=gd-2.0.26gif
  
				apache_dir=/usr/local/etc/httpd 
				mysql_dir=/usr/local/mysql/data 
				gd_dir=/usr/local/gd2026
  
				################## IP 체크 ###################### 
				ip=$(/sbin/ifconfig | grep "inet addr" | awk '{print $2}'| head -n 1| sed -e 's/addr://g')
  
				################## 기존 설치 파일 삭제 ############# 
				rm -Rf /usr/local/apache 
				rm -Rf /usr/local/etc/httpd 
				rm -Rf /usr/local/mysql 
				rm -Rf /usr/local/Zend 
				rm -Rf /usr/local/lib 
				rm -Rf /usr/local/gd207 
				rm -Rf /usr/local/gd2026 
				rm -Rf ./$apache 
				rm -Rf ./$php 
				rm -Rf ./$mysql 
				rm -Rf ./$gd 
				rm -Rf ./$zend
  
				################## 설치 시작 ################## 
				clear 
				sleep 5 
				################## 시간 설정 ################### 
				rdate -s time.bora.net 
				clock -w 
				################## 패치 ##################### 
				rpm -Uvh compat-libcom_err-1.0-5.i386.rpm 
				rpm -Uvh imap-2001a-18.i386.rpm 
				rpm -Uvh imap-devel-2001a-18.i386.rpm 
				################## 압축 해제 ################## 
				tar -zxvpf apache_1.3.37.tar.gz 
				tar -zxvpf php-4.4.4.tar.gz 
				tar -zxvpf mysql-4.0.27.tar.gz 
				tar -zxvpf gd-2.0.26gif.tar.gz 
				tar -zxvpf ZendOptimizer-2.6.2-linux-glibc21-i386.tar.gz 
				tar -zxvpf mod_throttle312.tar.gz
  
				tar -zxvpf zlib-1.2.3.tar.gz 
				tar -zxvpf jpegsrc.v6b.tar.gz 
				tar -xvpf libpng-1.2.8.tar 
				tar -zxvpf libmcrypt-2.5.7.tar.gz 
				tar -zxvpf libiconv-1.9.2.tar.gz 
				tar -zxvpf freetype-2.1.9.tar.gz 
				tar -zxvpf gd-2.0.26gif.tar.gz 
				################## zlib install ################## 
				cd ./$zlib 
				./configure &&  make && make install 
				cd - 
				################## libjpeg install ################## 
				mkdir -p /usr/local/man/man1 
				cd ./$libjpeg 
				./configure --enable-shared --enable-static && make && make install 
				cd - 
				################## libpng install #################### 
				cd ./$libpng 
				cp ./scripts/makefile.linux ./makefile 
				make test && make install 
				cd - 
				################## libmcrypt install ################# 
				cd ./$libmcrypt 
				./configure --disable-posix-threads 
				make && make check && make install 
				cd - 
				################## libiconv install ################## 
				cd ./$libiconv 
				./configure && make && make install 
				cd - 
				################## freetype install ################## 
				cd ./$freetype 
				./configure && make && make install 
				cd - 
				################## gd install ####################### 
				cd ./$gd 
				./configure --prefix=$gd_dir && make && make install 
				cd - 
				################## MySQL install ################### 
				adduser mysql
  
				cd ./$mysql 
				./configure  --prefix=/usr/local/mysql --localstatedir=$mysql_dir --with-charset=latin1 
				--with-mysqld-ldflags=-all-static 
				make 
				strip sql/mysqld 
				make install 
				/usr/local/mysql/bin/mysql_install_db
  
				chown -R root /usr/local/mysql 
				chown -R mysql $mysql_dir 
				chgrp -R mysql /usr/local/mysql 
				cd - 
				################## Apache install ################## 
				cd ./$apache 
				./configure 
				cd - 
				################## PHP install ##################### 
				cd ./$php 
				./configure  --with-apache=../$apache --with-mysql=/usr/local/mysql --with-gd=$gd_dir  
				--with-gif-dir=/usr/lib  --with-png-dir --with-zlib-dir --with-jpeg-dir --enable-mbstring --with-iconv  
				--with-mcrypt --enable-exif --with-imap --with-imap-ssl --with-kerberos --with-freetype-dir  
				--enable-ftp --enable-socket --disable-debug --enable-track-vars --enable-magic-quotes  
				--enable-versioning --enable-gd-native-ttf --enable-gd-imgstrttf --with-gdbm --enable-dba=shared 
				make 
				make install 
				cd - 
				################## Mod_Throttle install ############# 
				cp ./$mod_throttle/mod_throttle.c ./$apache/src/modules/extra/ 
				################## Apache install ################## 
				cp -f ./httpd.h ./$apache/src/include 
				cd ./$apache 
				./configure --prefix=$apache_dir --activate-module=src/modules/php4/libphp4.a 
				--add-module=src/modules/extra/mod_throttle.c --enable-module=so --enable-module=rewrite 
				make 
				make install 
				cd - 
				cp -f ./$php/php.ini-dist /usr/local/lib/php.ini 
				chown root.root /usr/local/lib/php.ini 
				chmod 644 /usr/local/lib/php.ini 
				################## Zend install ################## 
				cd ./$zend 
				./install.sh 
				cd - 
				cp -f ./php.ini /usr/local/Zend/etc/ 
				chown root.root /usr/local/Zend/etc/php.ini 
				chmod 644 /usr/local/Zend/etc/php.ini 
				cp -f /usr/local/lib/php/extensions/no-debug-non-zts-20020429/dba.so /usr/local/lib/php/extensions/ 
				################## Apache 설정 ################## 
				sed -e "s/SERVER_IP/$ip/g" ./httpd.conf > $apache_dir/conf/httpd.conf 
				cp -f ./test.php $apache_dir/htdocs/ 
				cp -f $apache_dir/htdocs/index.html.en $apache_dir/htdocs/index.html 
				chown root.root $apache_dir 
				chown -R root.root $apache_dir/htdocs 
				chown -R root.root $apache_dir/bin 
				chown -R root.root $apache_dir/conf 
				chown -R root.root $apache_dir/logs 
				chmod 755 $apache_dir 
				chmod 755 $apache_dir/bin 
				chmod 755 $apache_dir/conf 
				chmod 755 $apache_dir/logs 
				chown root.root $apache_dir/bin/httpd 
				chmod 511 $apache_dir/bin/httpd 
				rm -Rf $apache_dir/htdocs/manual > /dev/null 
				rm -Rf $apache_dir/cgi-bin/* > /dev/null 
				chmod g-s /usr/bin/man 
				  |  
		  |  
	 |  
 
								
	
						 |