solaris9 에서 Apache2, PHP, Mysql4.x 컴파일 및 설치

1. 모든 소스화일 다운로드

컴파일러 및 관련 라이브러리화일들은 http://sunfreeware.com에서 다운로드 받아서 설치하였음.


Sun에서 배포하는 companion CD를 이용할때에는 LDFLAG 및 PATH등을 조정하여야 한다.

설치한 패키지화일

autoconf-2.57-sol9-sparc-local.gz

libgcc-3.3-sol9-sparc-local.gz

automake-1.7.2-sol9-sparc-local.gz

libpcap-0.7.2-sol9-sparc-local.gz

bison-1.75-sol9-sparc-local.gz

libpng-1.2.4-sol9-sparc-local.gz

coreutils-4.5.4-sol9-sparc-local.gz

libtool-1.5-sol9-sparc-local.gz

flex-2.5.4a-sol9-sparc-local.gz

libxml2-2.5.5-sol9-sparc-local.gz

freetype-2.1.2-sol9-sparc-local.gz

lsof-4.68-sol9-sparc-local.gz

gcc_small-3.3.2-sol9-sparc-local.gz

m4-1.4-sol9-sparc-local.gz

gd-2.0.12-sol9-sparc-local.gz

make-3.80-sol9-sparc-local.gz

gettext-0.11.5-sol9-sparc-local.gz

ncurses-5.3-sol9-sparc-local.gz

glib-1.2.10-sol9-sparc-local.gz

shutils-2.0.15-sol9-sparc-local.gz

gnupg-1.2.1-sol9-sparc-local.gz

tar-1.13.19-sol9-sparc-local.gz

gtk+-1.2.10-sol9-sparc-local.gz

xinetd-2.3.10-sol9-sparc-local.gz

iplog-2.2.3-sol9-sparc-local.gz

zip-2.3-sol9-sparc-local.gz

jpeg-6b-sol9-sparc-local.gz

zlib-1.1.4-sol9-sparc-local.gz

사용한 소스화일들.

httpd-2.0.48.tar.gz

mysql-4.0.16.tar.gz

php-4.3.4.tar.gz

2. mysql 컴파일

컴파일러는 gcc3.2를 이용했음(sunfreeware.com에서 다운로드 하였음).

환경변수의 설정

CC=gcc CFLAGS=”-O3 -m64 -fno-omit-frame-pointer”

CXX=gcc

CXXFLAGS=”-O3 -m64 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti”

LDFLAGS=’-R/usr/local/lib’

설정한 PATH는

PATH=/usr/sbin:/usr/bin:/usr/local/bin:/usr/ccs/bin:/usr/local/lib
./configure –prefix=/usr/local/mysql

–with-extra-charsets=complex –enable-thread-safe-client

–enable-local-infile –enable-assembler –with-named-z-libs=no –with-named-curses-libs=-lcurses –disable-shared

===========================================================================

sql_lex.cc: In function void lex_init()':

sql_lex.cc:85: error: symbols’ undeclared (first use this function)

sql_lex.cc:85: error: (Each undeclared identifier is reported only once for

each function it appears in.)

sql_lex.cc:87: error: sql_functions' undeclared (first use this function)

sql_lex.cc: In function int find_keyword(LEX*, unsigned int, bool)’:

sql_lex.cc:171: error: get_hash_symbol' undeclared (first use this function)

make[4]: *** [sql_lex.o] Error 1

make[4]: Leaving directory /var/tmp/mysql-4.0.16/sql’

make[3]: *** [all-recursive] Error 1

make[3]: Leaving directory /var/tmp/mysql-4.0.16/sql'

make[2]: *** [all] Error 2

make[2]: Leaving directory /var/tmp/mysql-4.0.16/sql’

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/mysql-4.0.16′

make: *** [all] Error 2

===================================================================================

에러발생.

LD_LIBRARY_PATH=/usr/local/lib 를 추가하고, 컴파일, 결과는 같은 에러..

웹사이트 참조한 결과,

환경 변수 추가후, make clean 또는 소스화일을 다시 풀고 make해야함..

그렇게 하여 이상 없이 make끝남..

make

cd

find /* > mysql1.txt

cd /

make install

cd

find /* > mysql2.txt

diff mysql1.txt mysql2.txt > Install-Mysql.txt

3. MySQL의 구동.

4. Apache, PHP의 컴파일

Apache precompile

apache2 소스 디렉토리에서,

./configure –prefix=/usr/local/apache2 –datadir=/exprot/home/apache –sysconfdir=/etc/apache\

아래 옵션은 openna사이트를 참고 해서 적당히 바꿨음.

–exec-prefix=/usr \

–bindir=/usr/bin \

–sbindir=/usr/sbin \

–mandir=/usr/share/man \

–sysconfdir=/etc/httpd/conf \

–includedir=/usr/include/httpd \

–libexecdir=/usr/lib/httpd/modules \

–datadir=/home/httpd \

–localstatedir=/var \

–with-mpm=prefork \

–enable-access=shared \

–enable-actions=shared \

–enable-alias=shared \

–enable-auth=shared \

–enable-auth-dbm=shared \

–enable-auth-digest=shared \

–enable-autoindex=shared \

–enable-cern-meta=shared \

–enable-cgi=shared \

–enable-cgid=shared \

–enable-dav=shared \

–enable-dav-fs=shared \

–enable-dir=shared \

–enable-env=shared \

–enable-expires=shared \

–enable-file-cache=shared \

–enable-headers=shared \

–enable-include=shared \

–enable-log-config=shared \

–enable-mime=shared \

–enable-mime-magic=shared \

–enable-negotiation=shared \

–enable-rewrite=shared \

–enable-setenvif=shared \

–enable-speling=shared \

–enable-ssl=shared \

–enable-unique-id=shared \

–enable-usertrack=shared \

–enable-vhost-alias=shared \

–enable-suexec=shared \

–with-suexec-caller=www \

–with-suexec-docroot=/home/httpd \

–with-suexec-logfile=/var/log/httpd/suexec.log \

–with-suexec-bin=/usr/sbin/suexec \

–with-suexec-uidmin=500 –with-suexec-gidmin=500 \

–disable-auth-anon \

–disable-charset-lite \

–disable-disk-cache \

–disable-mem-cache \

–disable-cache \

–disable-deflate \

–disable-ext-filter \

–disable-case-filter \

–disable-case-filter-in \

–disable-example \

–disable-proxy \

–disable-proxy-connect \

–disable-proxy-ftp \

–disable-proxy-http \

–disable-status \

–disable-asis \

–disable-info \

–disable-imap \

–disable-userdir \

–with-z \

–with-ssl \

–with-suexec

make

make install
환경화일 수정후 실행. 잘 된다…

PHP소스디렉토리에서,

옵션은 openna를 참조하여 적당히 바꿨음..

./configure –with-layout=Solaris –prefix=/usr/local/php \

–with-config-file-path=/etc/apache2 \

–enable-force-cgi-redirect \

–with-apxs2=/usr/local/apache2/bin/apxs \

–with-zlib \

–with-bz2 \

–with-gd \

–with-ttf \

–with-png \

–with-jpeg-dir=/usr/local \

–with-png-dir=/usr/local \

–with-freetype-dir=/usr/local \

–with-expat-dir=/usr/local \

–with-gmp \

–with-xml \

–with-imap=shared \

–with-mysql=shared,/usr/local/mysql \

–with-mysql-sock=/tmp/mysql.sock \

–with-pgsql=shared \

–with-ldap=shared \

–with-pspell \

–disable-debug \

–disable-rpath \

–disable-posix \

–enable-pic \

–enable-discard-path \

–enable-safe-mode \

–enable-magic-quotes \

–enable-bcmath \

–enable-dio \

–enable-gd-native-ttf \

–enable-sysvsem \

–enable-sysvshm \

–enable-track-vars \

–enable-wddx \

–enable-inline-optimization \

–enable-memory-limit

에러발생….
다른 방법을 찾아봄

참고 사이트는http://www.php.net/manual/en/install.apache2.php

apache2가 설치된것을 모두 제거하고 다시 컴파일.

이때, 옵션은 최소로 주었으며, –enable-so 옵션을 더 주었음.

./configure –enable-so –prefix=/usr/local/apache2 –datadir=/export/home/apache2 –sysconfdir=/etc/apache2 –enable-autoindex=shared –enable-vhost=shared –enable-userdir=shared
에러 없이 컴파일및 설치됨.

php컴파일

./configure –with-layout=Solaris –prefix=/usr/local/php \

–with-config-file-path=/etc/apache2 \

–with-apxs2=/usr/local/apache2/bin/apxs \

–with-gd \

–with-xml \

–with-mysql=shared,/usr/local/mysql \

–with-mysql-sock=/tmp/mysql.sock \

–enable-pic \

–enable-exif \

–enable-bcmath \

–enable-inline-optimization \

–enable-zlib

위의 옵션만 사용함.

에러는 없었으나, mysql지원이 안됨

다시 컴파일

위의 옵션중에서

–with-mysql=shared,/usr/local/mysql을 –with-mysql=/usr/local/mysql로 바꿈

잘 된다..

============================================================================

컴파일된 화일들

apache2

php

mysql

 

========================================

cd sql
gen_lex_hash > lex_hash.h
ld.so.1: : fatal: libstdc++.so.6: open failed: No such file or directory
Killed

crle -l /usr/lib -l /opt/local/lib

cd ..
make

3 comments

    • poss on 2007년 2월 12일 at 9:09 오후
    • Reply

    ./configure –enable-layout=GNU –prefix=/usr/local/apache2 –sysconfdir=/etc/httpd –datadir=/home/apache2 –enable-module=all –with-mpm=metuxmpm –with-z

    요렇게 하면 모든 모듈을 사용가능한 상태로 컴파일 가능

  1. Thank you for sharing!

    • snowfox on 2008년 3월 17일 at 11:49 오후
    • Reply

    ./configure –prefix=/usr/local/apache2 –enable-mods-shared=most –enable-ssl –with-ssl=/usr/local/openssl

    error:
    ssl_engine_pphrase.c: In function `ssl_pphrase_Handle_CB’:

    —>
    solution.
    http://www.mail-archive.com/debian-apache@lists.debian.org/msg06443.html
    ————–

    Here is a patch to fix the problem:

    — httpd-2.0.54.orig/modules/ssl/ssl_toolkit_compat.h 2005-02-04
    12:21:18.000000000 -0800
    +++ httpd-2.0.54/modules/ssl/ssl_toolkit_compat.h 2005-07-06
    08:50:38.468750000 -0700
    @@ -24,6 +24,12 @@

    #ifdef OPENSSL_VERSION_NUMBER

    +#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL)
    +#ifndef PEM_F_DEF_CALLBACK
    +#define PEM_F_DEF_CALLBACK PEM_F_PEM_DEF_CALLBACK
    +#endif
    +#endif
    +
    /*
    * rsa sslc uses incomplete types for most structures
    * so we macroize for OpenSSL those which cannot be dereferenced

댓글 남기기

Your email address will not be published.

%d 블로거가 이것을 좋아합니다: