🌟2017년 이전 포스팅 모음 🌟/💞Linux OS💞

CentOS Linux에 SuLinux-APM-Tools 팩키지 한번에 설치 하기

🌟BugsBunny🌟 2011. 5. 11. 13:23

 

Sulinux는 CentOS와 Redhat 계열의 팩키지를 포팅해서 만든 리눅스 OS라 거의 전반적인 내용이
같고 거의 비숫한 라이브러리를 사용하기 때문에 필요한 의존 팩키지만 설치해 주면
CentOS에서 마음대로 사용할수 있는 팩키지이다.
<기존에 설치되 있는 APM를 모두 삭제 한다.>
[root@ns♥Sunny♥/temp]# yum -y remove httpd-suexec httpd httpd-manual   
[root@ns♥Sunny♥/temp]# yum -y remove mysql-server mysql mysqlclient mysql-devel
< Cuteos에서 필요한 의존 라이브러리 팩키지 설치>
[root@ns♥Sunny♥/temp]# yum -y install flex libxml2-devel gdbm-devel gcc-c++ libc-client-devel gmp-devel gd-devel libc-client-devel \
gmp-develbzip2-devel pcre-devel libxslt-devel freetype-devel
< CuteOS에서 수 리눅스의 APM 팩키지를 소스 SRPM로 받아서 설치한다.>
[root@ns♥Sunny♥/temp]# wget
ftp://ftp.superuser.co.kr/SULinux/1.5/os/i386/SULinux/RPMS/dialog*.rpm
[root@ns♥Sunny♥/temp]# wget ftp://ftp.superuser.co.kr/SULinux/1.5/os/i386/SULinux/RPMS/APM_Install-tools*.rpm
[root@ns♥Sunny♥/temp]# rpmbuild --rebuild  APM_Install-tools-1.4-1.SULinux.src.rpm
[root@ns♥Sunny♥/temp]# rpm -Uvh /usr/src/redhat/RPMS/i386/APM_Install-tools-1.4-1.SULinux.i386.rpm
[root@ns♥Sunny♥/temp]# rpm -Uvh /usr/src/redhat/RPMS/i386/APM_Install-tools-debuginfo-1.4-1.SULinux.i386.rpm
[root@ns♥Sunny♥/temp]# cd /mnt/disk_backup2/SULinux-Server/RPMS
<다음 팩키지가 없으면 스크립트가 실행되지 않는다. 꼭 설치해 주어야 한다.>
[root@ns♥Sunny♥/mnt/disk_backup2/SULinux-Server/RPMS]# rpm -Uvh dialog-1.0.20040731-3.i386.rpm
[root@ns♥Sunny♥/mnt/disk_backup2/SULinux-Server/RPMS]# cd ~/bin/
[root@ns♥Sunny♥~/bin]# ./apmtools  ==> 설치 자동 스크립트
어떤 작업을 하시겠습니까?
(X) ==> APM 설치  ==> OK
(X) ==>  Apache_1.3.37  + (X) ==>  PHP_5.2.1  + (X)  MySQL_5.0.27  ==> 3가지 선택해서 설치가 가능하다.
 Apache : 1.3.37  +  PHP : 5.2.1  + MySQL : 5.0.27 
위와같이 설치하시겠습니까?    ==> OK
==> 설치가 시작되고 시간은 시스템 사양에 따라 다르다. 보통 6분 걸리다.
[root@ns♥Sunny♥~/bin]# mkdir -m 755 -p /home/httpd/www
[root@ns♥Sunny♥~/bin]# mkdir -m 644 /etc/httpd
[root@ns♥Sunny♥~/bin]# ln -s /usr/local/apache/bin/apachectl /usr/local/sbin/
[root@ns♥Sunny♥~/bin]# ln -s /usr/local/apache/bin/httpd /usr/local/sbin/
[root@ns♥Sunny♥~/bin]# ln -s /usr/local/apache/bin/htpasswd /usr/local/sbin/
[root@ns♥Sunny♥~/bin]# ln -s /usr/local/apache/bin/apxs /usr/local/sbin/
[root@ns♥Sunny♥~/bin]# chmod 750 /usr/local/apache_1.3.37/bin/apachectl
[root@ns♥Sunny♥~/bin]# chmod 750 /usr/local/apache_1.3.37/bin/httpd
[root@ns♥Sunny♥~/bin]# chmod 750 /usr/local/apache_1.3.37/bin/htpasswd
[root@ns♥Sunny♥~/bin]# chmod 750 /usr/local/apache_1.3.37/bin/apxs
[root@ns♥Sunny♥~/bin]# chown root:sunny /usr/local/apache_1.3.37/bin/apachectl
[root@ns♥Sunny♥~/bin]# chown root:sunny /usr/local/apache_1.3.37/bin/httpd
[root@ns♥Sunny♥~/bin]# chown root:sunny /usr/local/apache_1.3.37/bin/htpasswd
[root@ns♥Sunny♥~/bin]# chown root:sunny /usr/local/apache_1.3.37/bin/apxs
[root@ns♥Sunny♥~/bin]# chkconfig --add httpd
[root@ns♥Sunny♥~/bin]# chkconfig --level 3 httpd on
[root@ns♥Sunny♥~/bin]# chmod 700 /usr/local/mysql/share/mysql/mysql.server
[root@ns♥Sunny♥~/bin]# chkconfig --add mysqld
[root@ns♥Sunny♥~/bin]# chkconfig --level 3 mysqld on
[root@ns♥Sunny♥~/bin]# chmod 644 /usr/local/apache_1.3.37/conf/*
[root@ns♥Sunny♥~/bin]# mkdir -m 644 /usr/local/apache/conf.d
[root@ns♥Sunny♥~/bin]# ln -s /usr/local/apache_1.3.37/conf.d/ /etc/httpd/conf.d/
[root@ns♥Sunny♥~/bin]# chmod 644 /usr/local/apache_1.3.37/conf.d
[root@ns♥Sunny♥~/bin]# rm -fr /usr/local/apache_1.3.37/conf/httpd.conf
[root@ns♥Sunny♥~/bin]# cat << EOF >> /usr/local/apache_1.3.37/conf/httpd.conf
---------------------------------------------------------------------------------------------
# server as "/usr/local/apache/logs/foo.log".
ServerType standalone
ServerRoot "/usr/local/apache_1.3.37"
#LockFile /usr/local/apache_1.3.37/logs/httpd.lock
PidFile /usr/local/apache_1.3.37/logs/httpd.pid
ScoreBoardFile /usr/local/apache_1.3.37/logs/httpd.scoreboard
#ResourceConfig /usr/local/apache_1.3.37/conf/srm.conf
#AccessConfig /usr/local/apache_1.3.37/conf/access.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0
#Listen 3000
#Listen 12.34.56.78:80
#BindAddress *
# Example:
# LoadModule foo_module libexec/mod_foo.so
LoadModule security_module    libexec/mod_security.so
LoadModule php5_module        libexec/libphp5.so
#ExtendedStatus On
Port 80
User nobody
Group nobody
#ServerAdmin
root@localhost.localdomain
ServerAdmin root@linuxsunny.pe.kr
#ServerName www.example.com
ServerName www.linuxsunny.pe.kr
DocumentRoot "/home/httpd/www"
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory "/home/httpd/www">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
#<IfModule mod_userdir.c>
#    UserDir public_html
#</IfModule>
#<Directory /home/*/public_html>
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS PROPFIND>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <LimitExcept GET POST OPTIONS PROPFIND>
#        Order deny,allow
#        Deny from all
#    </LimitExcept>
#</Directory>
<IfModule mod_userdir.c>
    UserDir web
</IfModule>
<Directory /home/*/web>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.php index.php3 index.cgi index.jsp main.htm start.htm
</IfModule>
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>
#CacheNegotiatedDocs
UseCanonicalName On
<IfModule mod_mime.c>
    TypesConfig /usr/local/apache_1.3.37/conf/mime.types
</IfModule>
DefaultType text/plain
<IfModule mod_mime_magic.c>
    MIMEMagicFile /usr/local/apache_1.3.37/conf/magic
</IfModule>
HostnameLookups Off
ErrorLog /usr/local/apache_1.3.37/logs/error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /usr/local/apache_1.3.37/logs/access_log common
#CustomLog /usr/local/apache_1.3.37/logs/referer_log referer
#CustomLog /usr/local/apache_1.3.37/logs/agent_log agent
#CustomLog /usr/local/apache_1.3.37/logs/access_log combined
ServerSignature On
# > AddType       text/html .ahtml
# > EBCDICConvert Off=InOut .ahtml
# EBCDICConvertByType  On=InOut text/* message/* multipart/*
# EBCDICConvertByType  On=In    application/x-www-form-urlencoded
# EBCDICConvertByType  On=InOut application/postscript model/vrml
# EBCDICConvertByType Off=InOut */*
<IfModule mod_alias.c>
    Alias /icons/ "/usr/local/apache_1.3.37/icons/"
    <Directory "/usr/local/apache_1.3.37/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    Alias /manual/ "/usr/local/apache_1.3.37/htdocs/manual/"
    <Directory "/usr/local/apache_1.3.37/htdocs/manual">
        Options Indexes FollowSymlinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    ScriptAlias /cgi-bin/ "/usr/local/apache_1.3.37/cgi-bin/"
    <Directory "/usr/local/apache_1.3.37/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>
</IfModule>
<IfModule mod_autoindex.c>
    IndexOptions FancyIndexing
    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*
    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core
    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^
    DefaultIcon /icons/unknown.gif
    # Format: AddDescription "description" filename
    #AddDescription "GZIP compressed document" .gz
    #AddDescription "tar archive" .tar
    #AddDescription "GZIP compressed tar archive" .tgz
    #ReadmeName README.html
    #HeaderName HEADER.html
    #IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
### -------------------------------------------------- ###
    #ReadmeName list1.htm
    #HeaderName list2.htm
    #IndexIgnore .??* *~ *# HEADER* README* list* RCS CVS *,v *,t
</IfModule>
<IfModule mod_mime.c>
    AddLanguage da .dk
    AddLanguage nl .nl
    AddLanguage en .en
    AddLanguage et .ee
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage he .he
    AddCharset ISO-8859-8 .iso8859-8
    AddLanguage it .it
    AddLanguage ja .ja
    AddCharset ISO-2022-JP .jis
    AddLanguage kr .kr
    AddCharset ISO-2022-KR .iso-kr
    AddLanguage nn .nn
    AddLanguage no .no
    AddLanguage pl .po
    AddCharset ISO-8859-2 .iso-pl
    AddLanguage pt .pt
    AddLanguage pt-br .pt-br
    AddLanguage ltz .lu
    AddLanguage ca .ca
    AddLanguage es .es
    AddLanguage sv .sv
    AddLanguage cs .cz .cs
    AddLanguage ru .ru
    AddLanguage zh-TW .zh-tw
    AddCharset Big5         .Big5    .big5
    AddCharset WINDOWS-1251 .cp-1251
    AddCharset CP866        .cp866
    AddCharset ISO-8859-5   .iso-ru
    AddCharset KOI8-R       .koi8-r
    AddCharset UCS-2        .ucs2
    AddCharset UCS-4        .ucs4
    AddCharset UTF-8        .utf8
    <IfModule mod_negotiation.c>
        LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
    </IfModule>
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php4 .php3 .php .htm .html .phtml .ph .inc
    AddType application/x-httpd-php-source .phps
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    #AddType application/x-compress .Z
    #AddType application/x-gzip .gz .tgz
    #AddHandler cgi-script .cgi
    #AddType text/html .shtml
    #AddHandler server-parsed .shtml
    #AddHandler send-as-is asis
    #AddHandler imap-file map
    #AddHandler type-map var
</IfModule>
</IfModule>
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#MetaDir .web
#MetaSuffix .meta
#ErrorDocument 500 "The server made a boo boo.
#ErrorDocument 404 /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
#ErrorDocument 402
http://www.example.com/subscription_info.html
<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule>
<IfModule mod_security.c>
    # Enable ModSecurity
    SecFilterEngine On
    # Reject requests with status 403
    SecFilterDefaultAction "deny,log,status:403"
    # Some sane defaults
    SecFilterScanPOST On
    SecFilterCheckURLEncoding On
    SecFilterCheckUnicodeEncoding Off
    # Accept almost all byte values
    SecFilterForceByteRange 1 255
    # Server masking is optional
    # SecServerSignature "Microsoft-IIS/5.0"
    # Designate a directory for temporary files
    # storage. It is a good idea to change the
    # value below to a private directory, just as
    # an additional measure against race conditions
    SecUploadDir /tmp
    SecUploadKeepFiles Off
    # Only record the interesting stuff
    SecAuditEngine RelevantOnly
    # Uncomment below to record responses with unusual statuses
    # SecAuditLogRelevantStatus ^5
    SecAuditLog logs/modsec_audit.log
    # You normally won't need debug logging
    SecFilterDebugLevel 0
    SecFilterDebugLog logs/modsec_debug.log
    # Only accept request encodings we know how to handle
    # we exclude GET requests from this because some (automated)
    # clients supply "text/html" as Content-Type
    SecFilterSelective REQUEST_METHOD "!^(GET|HEAD)$" chain
    SecFilterSelective HTTP_Content-Type "!(^application/x-www-form-urlencoded$|^multipart/form-data;)"
    # Do not accept GET or HEAD requests with bodies
    SecFilterSelective REQUEST_METHOD "^(GET|HEAD)$" chain
    SecFilterSelective HTTP_Content-Length "!^$"
    # Require Content-Length to be provided with
    # every POST request
    SecFilterSelective REQUEST_METHOD "^POST$" chain
    SecFilterSelective HTTP_Content-Length "^$"
    # Don't accept transfer encodings we know we don't handle
    SecFilterSelective HTTP_Transfer-Encoding "!^$"
</IfModule>
#<Location /server-status>
#    SetHandler server-status
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Location>
#<Location /server-info>
#    SetHandler server-info
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Location>
#<Location /cgi-bin/phf*>
#    Deny from all
#    ErrorDocument 403
http://phf.apache.org/phf_abuse_log.cgi
#</Location>
#NameVirtualHost *:80
#<VirtualHost *:80>
#    ServerAdmin
webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
NameVirtualHost *
<VirtualHost *>
    DocumentRoot /usr/local/apache/htdocs/
    ServerName *
</VirtualHost>
#Added for SSU
<Directory "/usr/local/apache/htdocs/>
    AllowOverride AuthConfig
</Directory>
EOF
-------------------------------------------------------------------------------------
[root@ns♥Sunny♥/etc/init.d]# ./httpd restart
./httpd restart: httpd restarted
[root@ns♥Sunny♥/etc/init.d]# ./mysqld start
Starting MySQL                                             [  확인  ]
[root@ns♥Sunny♥/etc/init.d]# ps aux | grep httpd
root      4495  0.1  1.7 18148 8108 ?        Ss   20:32   0:00 /usr/local/apache_1.3.37/bin/httpd
nobody    4509  0.0  1.4 18280 6520 ?        S    20:33   0:00 /usr/local/apache_1.3.37/bin/httpd
[root@ns♥Sunny♥/etc/init.d]# ps aux | grep mysql
root      4562  0.0  0.2  6720 1176 pts/6    S    20:34   0:00 /bin/sh /usr/local/mysql_5.0.27/bin/mysqld_safe --datadir=/usr/local/mysql_5.0.27/data --pid-file=/usr/local/mysql_5.0.27/data/ns.linuxsunny.pe.kr.pid ................ 생략...
[root@ns♥Sunny♥/etc/init.d]# nmap -sS -O -v localhost
80/tcp   open  http
3306/tcp open  mysql
==>  서비스 포트 상황을 확인하면 된다