분류없음2008/07/18 17:57
1. 버전을 확인해봅니다.
[root@localhost public_html]# uname -a
Linux localhost.localdomain 2.6.20-1.2316.fc5 #1 SMP Fri Apr 27 19:19:10 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux

2. 최신 커널임을 확인하고 다음의 yum 을 설치합니다 . dependency 채크로 추가로 설치가 필요한 것이 있으면 모두 설치합니다.

yum install httpd
yum install httpd-devel

yum install libpng
yum install libpng-devel

yum install libjpeg
yum install libjpeg-devel

yum install gd

yum install mysql
yum install mysql-devel
yum install mysql-server

yum install php
yum install php-pdo
yum install php-gd
yum install php-mysql
yum install php-mbstring
yum install php-mcrypt


3. /etc/init.d/mysqld start
mysql데몬 구동
# mysql -u root mysql (root 비번설정)
mysql> update user set password=password('새로운패스워드') where user='root';

4. vi /etc/my.cnf 를 열고 다음을 채크합니다.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-innodb
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

5. vi /etc/php.ini
engine = On
register_globals = On
register_long_arrays = On
register_argc_argv = Off
post_max_size = 20M
magic_quotes_gpc = On
default_mimetype = "text/html"
default_charset = "euc-kr"
extension_dir = "/usr/lib64/php/modules"
file_uploads = On
upload_max_filesize = 20M
allow_url_fopen = On
default_socket_timeout = 60
max_execution_time = 30    ; Maximum execution time of each script, in seconds
max_input_time = 600    ; Maximum amount of time each script may spend parsing request data
memory_limit = 20M      ; Maximum amount of memory a script may consume (8MB)
error_reporting = E_ALL & ~E_NOTICE

; 중요 꼭 채크하세요!!
session.save_path = "/var/lib/php/session"
; 중요 꼭 채크하세요!!

session.name = PHPSESSID
session.use_cookies = 1
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php


이 정도의 상수값을 확인하고 자신의 취향에 맞추어 변경하면 됩니다.

cd /var/lib/php
chown daemon:daemon session 을 하여 session 기록이 문제없는지 확인합니다.

6. vi /etc/httpd/conf/httpd.conf

ServerRoot "/etc/httpd"
Listen 80

#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
....
생략..
....
....
#

ServerAdmin you@example.com
DocumentRoot "/home/mild/public_html"

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
#    Deny from all
    Allow from all
</Directory>

#  virtual hosting 시 / 이하 다른 디렉토리로 이동이 가능해야 되므로 이렇게 설정합니다.
# 그렇지 않으면 403 에러나요!!


<Directory "/home/mild/public_html">

    #Options Indexes FollowSymLinks
# 이걸 꼭 주석처리 합니다 안하면 디렉토리 리스팅됨.

    AllowOverride None

    Order allow,deny
    Allow from all

</Directory>


<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog logs/error_log

LogLevel warn

<IfModule log_config_module>
.. 생략..
</IfModule>

<IfModule alias_module>
.. 생략..
</IfModule>

<IfModule cgid_module>
.. 생략..
</IfModule>

<Directory "/etc/httpd/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

DefaultType text/plain

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    # 이 부분을 꼭 해주세요!!
    AddType application/x-httpd-php .php .php3 .htm .html
</IfModule>

# magic 기능을 사용하실려면 주석 푸세요..!!
#MIMEMagicFile conf/magic

# 중요 mpm 셋업 따로 하세요!!

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# RPM 설치시 자동으로 생깁니다.
Include conf.d/*.conf

7. vi /etc/httpd/conf/extra/httpd-mpm.conf

<IfModule !mpm_netware_module>
    PidFile logs/httpd.pid
</IfModule>


<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>
LockFile logs/accept.lock
</IfModule>
</IfModule>


<IfModule mpm_prefork_module>
    StartServers          20
    MinSpareServers      5
    MaxSpareServers      10
    ServerLimit          1024
    MaxClients          1024
    MaxRequestsPerChild  0
</IfModule>


<IfModule mpm_worker_module>
    StartServers          20
    ServerLimit        1024
    MaxClients          1024
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild  0
</IfModule>


<IfModule mpm_beos_module>
    StartThreads            10
    MaxClients              50
    MaxRequestsPerThread 10000
</IfModule>


<IfModule mpm_netware_module>
    ThreadStackSize      65536
    StartThreads          250
    MinSpareThreads        25
    MaxSpareThreads        250
    MaxThreads            1000
    MaxRequestsPerChild      0
    MaxMemFree            100
</IfModule>


<IfModule mpm_mpmt_os2_module>
    StartServers          2
    MinSpareThreads        5
    MaxSpareThreads      10
    MaxRequestsPerChild    0
</IfModule>

8. vi /etc/httpd/conf/extra/httpd-vhost.conf

<VirtualHost *>
    DocumentRoot /home/mild/public_html
    ServerName club.mildsoft.net
    ServerAlias club.mildsoft.net
    ScriptAlias /cgi-bin/ "/home/mild/public_html/cgi-bin/"
    RewriteEngine on
    RewriteRule ^/([a-zA-Z0-9]+)$      /home/mild/public_html/club/index\.php?club_id=$1
#    ErrorLog /home/mild/web_log/error_log
#    CustomLog /home/mild/web_log/access_log common
</VirtualHost>

<VirtualHost *>
    DocumentRoot /home/mild/public_html
    ServerName club.mildsoft.net
    ServerAlias club.mildsoft.net testclub.mildsoft.net
    ScriptAlias /cgi-bin/ "/home/mild/public_html/cgi-bin/"
    RewriteEngine on
    RewriteRule ^/([a-zA-Z0-9]+)$      /home/mild/public_html/club/index\.php?club_id=$1
#    ErrorLog /home/mild/web_log/error_log
#    CustomLog /home/mild/web_log/access_log common
</VirtualHost>

<VirtualHost *>
    DocumentRoot /home/mild/public_html
    ServerName mildsoft.net
    ServerAlias www.mildsoft.net mildsoft.net db1.mildsoft.net db2.mildsoft.net db3.mildsoft.net db4.mildsoft.net db5.mildsoft.net test.mildsoft.net
    ScriptAlias /cgi-bin/ "/home/mild/public_html/cgi-bin/"
#    ErrorLog /home/mild/web_log/error_log
#    CustomLog /home/mild/web_log/access_log common
</VirtualHost>

정리를 하자면

위에 yum 을 다 설치하고

/etc/my.cnf
/etc/php.ini
/etc/httpd/conf/httpd.conf 와
/etc/httpd/conf/extra/httpd-mpm.conf
/etc/httpd/conf/extra/httpd-vhost.conf

이 정도만 세팅하면 깔끔하게 64비트 버전 잘 작동할 껍니다.
이올린에 북마크하기(0) 이올린에 추천하기(0)
Posted by 차가운바람