블로그 이미지
너덜

calendar

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

Notice

Tag

'server'에 해당되는 글 1

  1. 2012.04.04 apache 설치.
2012. 4. 4. 14:04 server/apache

apache 설정

#### 1. directory make & install & download

mkdir /app/src
cd /app/src


yum install wget make sendmail

yum -y install gcc gcc-c++ compat-gcc-34-g77 flex openssl* termcap libtermcap libtermcap-devel gdbm-devel gd* php-gd zlib* pam* curl* pid* libiconv libmcrypt* libmhash libxml* freetype* ncurses* libpng* libjpeg* bzip2-devel openldap-devel libc-client-devel php5-dev bison libtool

wget http://192.168.0.1/src/httpd-2.2.17.tar.gz
wget http://192.168.0.1/src/php-5.2.14.tar.gz
wget http://192.168.0.1/src/mysql-5.1.51.tar.gz
wget http://192.168.0.1/src/cronolog-1.6.2.tar.gz
wget http://192.168.0.1/src/ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz
wget http://caos.kldp.net/frs/download.php/4855/mod_url-apache2-1.15.tar.gz2

wget http://www.sqlite.org/cvstrac/getfile/sqlite/tool/lemon.c
gcc -o lemon lemon.c
mv lemon /usr/loca/bin/


#### 2. httpd-2.2.17

cd /app/src
tar xvzf httpd-2.2.17.tar.gz

cd /app/src/httpd-2.2.17
./configure --prefix=/app/apache --enable-rule=SHARED_CORE --enable-modules=all --enable-mods-shared=most --enable-so --enable-ssl --with-mpm=worker
make
make install

cp -f /app/apache/bin/apachectl /etc/rc.d/init.d/httpd
ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc3.d/S99httpd


#### mod_url설치.

cd /app/src
tar xvf mod_url-apache2-1.15.tar.gz2
/app/apache/bin/apxs -aic mod_url-apache2/mod_url.c

echo '<IfModule mod_url.c>' >> /app/apache/conf/httpd.conf
echo 'CheckURL On' >> /app/apache/conf/httpd.conf
echo '</IfModule>' >> /app/apache/conf/httpd.conf


#### cronolog 설치.
cd /app/src
tar xvzf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure --prefix=/app/cronolog
make
make install


#### 3. mysql client 설치.
cd /app/src/
tar xvzf mysql-5.1.51.tar.gz
cd mysql-5.1.51
./configure --prefix=/app/mysql --enable-thread-safe-client --with-charset=utf8 --without-server --without-docs --without-man
make
make install

 

#### 4. PHP 설치.
cd /app/src
tar xvzf php-5.2.14.tar.gz
cd php-5.2.14
./configure --prefix=/app/php --with-apxs2=/app/apache/bin/apxs --with-mysql=/app/mysql --with-mysqli=/app/mysql/bin/mysql_config --with-config-file-path=/app/apache/conf --with-gd --enable-magic-quotes --enable-ftp --enable-sockets --with-zlib --with-png-dir --with-jpeg-dir --with-freetype-dir --disable-debug --with-freetype-dir --with-libxml-dir=/usr/lib --with-curl --enable-mbstring --enable-exif --with-iconv --with-openssl --enable-soap --with-mcrypt
make
make install

cp /app/src/php-5.2.14/php.ini-dist /app/apache/conf/php.ini


vi /app/apache/conf/httpd.conf

## 1.   DirectoryIndex index.html 옆에 index.php 추가.
## 2. #AddOutputFilter INCLUDES .shtml 밑에 아래 추가.
    AddType application/x-httpd-php .php .htm .html
    AddType application/x-httpd-php-source .phps

echo '<?phpinfo();?>' > /app/apache/htdocs/index.php

 

#### 4.1 Zend 설치.
cd /app/src
tar xvzf ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz
sh /app/src/ZendOptimizer-3.3.3-linux-glibc23-x86_64/install.sh

# /app/Zend
# /app/apache/conf
# /app/apache/bin/apachectl

 

 

#### 압축 설정

vi /app/apache/conf/httpd.conf

<IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/plain text/html text/xml
        AddOutputFilterByType DEFLATE application/xhtml+xml application/xml application/rss+xml
        AddOutputFilterByType DEFLATE text/css application/javascript application/x-javascript
        AddOutputFilterByType DEFLATE audio/midi

        DeflateCompressionLevel 1

        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifModule>

 

#### vhost 아래 내용은 test.com으로 오는 놈을 www.test.com으로 변경하는 작업이다.

<VirtualHost *:80>
    ServerAdmin nerd@naver.com
    DocumentRoot "/data/apache/www/"
    ServerName test.com
    RedirectMatch /(.*)$ http://www.test.com/$1
    ErrorLog "|/app/cronolog/sbin/cronolog /data/logs/www-redirect-error_%Y%m%d.log"
    CustomLog "|/app/cronolog/sbin/cronolog /data/logs/www-redirect-access_%Y%m%d.log" common
    <Directory />
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
 
<VirtualHost *:80>
    ServerAdmin nerd@freebee.kr
    DocumentRoot "/data/apache/www/"
    ServerName www.azubu.com
    ErrorLog "|/app/cronolog/sbin/cronolog /data/logs/www-error_%Y%m%d.log"
    CustomLog "|/app/cronolog/sbin/cronolog /data/logs/www-access_%Y%m%d.log" common
    <Directory />
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

# vi 아파치 경로/server/mpm/worker/worker.c
[EDITOR]#define DEFAULT_SERVER_LIMIT 16 을
[EDITOR]#define DEFAULT_SERVER_LIMIT 20 으로 수정
저장하고 아웃 하셔야 합니다.


KeepAlive On
KeepAliveTimeout 2
Timeout 30


ServerLimit 20 --> 서버 갯수를 설정합니다.
StartServers 20 --> 아파치를 처음 시작할때 생성하는 서버 갯수입니다.
MaxClients 1280 --> ThreadsPerChild * StartServers 값입니다.
ThreadsPerChild 64 --> 서버 하나가 만들어 낼수 있는 쓰레드 갯수입니다. 최대 64개 입니다.
MinSpareThreads 64 -->  서버 하나가 만들어 낼수 있는 쓰레드의 최소 갯수입니다. 보통은 ThreadsPerChild 와 맞추어 줍니다.
MaxSpareThreads 1280 --> 시스템 전체에서 만들어 낼수 있는 쓰레드 갯수의 최대치 입니다.
                    ThreadsPerChild(64) * StartServers(20) 값이며, 보통 MaxClients 와 맞추어 줍니다.
MaxRequestsPerChild 0 --> 서버 하나가 만들어 내는 접속의 최대치 입니다. 0 일경우 무한대 이며, 숫자를 적으면 그 숫자만큼 접속되고 나면 서버를 죽였다 살립니다.

 

ServerLimit          20
StartServers         20
MaxClients         1280
MinSpareThreads      64
MaxSpareThreads    1280
ThreadsPerChild      64
MaxRequestsPerChild   0

posted by 너덜
prev 1 next