CentOS7 + httpd 2.4.12 + mariadb 10.0.16 + php 5.6.6 설치 정보
웹서버 CentOS7 + httpd 2.4.12 + mariadb 10.0.16 + php 5.6.6 설치
관련링크
본문
CentOS7 최소설치를(minimal) 한 상태에서 최신 APM 소스 설치를 진행해 보았습니다.
이전버전과 조금 틀린점이 있으니 아래 내용대로 ctrl+c ctrl+v 하시면서 따라하면 큰무리없이 It works! 을 보실 수 있을겁니다....^^
@ apache /usr/local/apache/
@ mariadb /usr/local/mariadb/
@ php /usr/local/php/
@ apache-log /logs/
@ db 파일 저장 위치 /usr/local/mariadb/data
@ 패키지 제거 및 설치
# rpm -qa httpd php mysql
# yum remove -y httpd php mysql
# yum -y install ORBit2 PyXML a2ps acpid alsa-lib amtu aspell at atk audiofile audit-libs-python autoconf* autofs automake* avahi avahi-glib bc bind bind-chroot bind-libs bind-utils cairo ccid compat-libstdc++-33 conman cpp cpuspeed crash createrepo crypto-utils cryptsetup-luks cups-libs cvs cyrus-sasl-md5 cyrus-sasl-plain db4-devel dbus-python device-mapper-multipath dhcp dhcp-devel dialog dmraid dos2unix dosfstools dump e2fsprogs-devel ed eject elfutils elfutils-libs enscript expat-devel expect expect-devel expectk fetchmail file finger flex fontconfig fontconfig-devel foomatic ftp gcc gcc-c++ gdb gdbm-devel gettext gfs2-utils glib2-devel glibc-devel glibc-headers gmp-devel gnutls gpm gtk2 hal hdparm hesiod hicolor-icon-theme imake iptraf iptstate ipvsadm irqbalance jwhois kernel-devel kernel-headers keyutils-libs-devel kpartx krb5-devel krb5-workstation ksh lcms lftp libICE libSM libX11 libX11-devel libXau libXau-devel libXcursor libXdmcp libXdmcp-devel libXext libXfixes libXft libXi libXinerama libXpm libXpm-devel libXrandr libXrender libXt libXxf86vm libaio libaio-devel libart_lgpl libbonobo libc-client libcurl-devel libdaemon libevent libfontenc libgomp libgssglue libhugetlbfs libhugetlbfs-devel libidn-devel libmng libnl libnl-devel libpcap libselinux-devel libselinux-python libsepol-devel libsmi libstdc++-devel libsysfs libtiff libtool libtool-ltdl libwvstreams libxml2-devel libxml2-python libxslt libxslt-python lksctp-tools logwatch lrzsz lsof m2crypto mailcap mailx make nasm man man-pages man-pages-ko mc mcstrans mdadm memtest86+ mesa-libGL mesa-libGL-devel mgetty microcode_ctl mkbootdisk mlocate mrtg mt-st mtools mtr mutt nc ncurses-devel net-snmp-libs netpbm nfs-utils nfs-utils-lib nmap nscd nss_db ntp ntsysv numactl oddjob openssh-clients openssl-devel pam-devel pam_krb5 pam_passwdqc pam_pkcs11 pango parted parted-devel patch pax pciutils pcsc-lite perl perl-Archive-Tar perl-BSD-Resource perl-Compress-Zlib perl-DBI perl-Digest-HMAC perl-Digest-SHA1 perl-HTML-Parser perl-HTML-Tagset perl-IO-Socket-INET6 perl-IO-Socket-SSL perl-IO-Zlib perl-Net-IP perl-Net-SSLeay perl-Newt perl-Socket6 perl-String-CRC32 perl-URI perl-libwww-perl pkgconfig pm-utils postgresql-libs prelink procmail psacct psutils pulseaudio-esound-compat pyOpenSSL pykickstart pyorbit pyparted python-pyblock pyxf86config quota rdate rdist readahead rmt rpcbind rpm-build rsh rsync rusers rwho samba samba-client samba-common samba-swat sendmail sendmail-cf setools setserial setuptool shared-mime-info sip sos spamassassin squashfs-tools strace stunnel symlinks sysfsutils syslinux sysstat system-config-date system-config-firewall talk tcl tcp_wrappers tcpdump tcsh telnet telnet-server time tk tmpwatch traceroute tree ttmkfdir unix2dos unixODBC unzip usbutils usermode vconfig vim-common vim-enhanced vsftpd wget wireless-tools words xinetd xorg-x11-proto-devel yp-tools ypbind ypserv zip zlib-devel GConf2 ImageMagick ImageMagick-perl avahi-libs bwidget cloog-ppl crda cryptsetup-luks-libs cups db4-cxx deltarpm desktop-file-utils device-mapper-multipath-libs dmidecode dmraid-events docbook-dtds flac foomatic-db foomatic-db-filesystem foomatic-db-ppds ghostscript ghostscript-fonts gnome-doc-utils-stylesheets gnome-python2 gnome-python2-canvas gnome-user-docs gnome-vfs2 gpm-libs groff-perl gstreamer gstreamer-tools hal-info hal-libs html2ps hunspell iw jasper-libs kpathsea lcms-libs libIDL libX11-common libXcomposite libXdamage libXdamage-devel libXext-devel libXfixes-devel libXfont libXres libXtst libXxf86vm-devel libasyncns libcanberra libcanberra-gtk2 libcom_err-devel libcroco libdrm-devel libedit libglade2 libgnomecanvas libgsf libnetfilter_conntrack libnfnetlink libnotify libogg libpaper librsvg2 libsamplerate libsndfile libtalloc libtasn1 libtdb libthai libtirpc libusb1 libvorbis libwmf-lite libwnck libxcb libxcb-devel lm_sensors-libs mesa-dri-drivers mozilla-filesystem mpfr mrtg-libs netpbm-progs notification-daemon ntpdate openjpeg-libs pcsc-lite-libs perl-Compress-Raw-Zlib perl-Crypt-OpenSSL-Bignum perl-Crypt-OpenSSL-RSA perl-Crypt-OpenSSL-Random perl-Date-Manip perl-Digest-SHA perl-Encode-Detect perl-ExtUtils-MakeMaker perl-ExtUtils-ParseXS perl-IO-Compress-Base perl-IO-Compress-Zlib perl-Mail-DKIM perl-MailTools perl-Module-Pluggable perl-Net-DNS perl-Net-LibIDN perl-NetAddr-IP perl-Package-Constants perl-Pod-Escapes perl-Pod-Simple perl-SNMP_Session perl-Test-Harness perl-Time-HiRes perl-TimeDate perl-YAML-Syck perl-devel perl-libs perl-version pixman poppler poppler-data poppler-utils portreserve ppl psutils-perl pulseaudio pulseaudio-libs pycairo pygobject2 pygtk2 pygtk2-libglade python-decorator python-deltarpm python-slip python-slip-dbus rarian rarian-compat rtkit samba-winbind-clients setools-console setools-gui setools-libs setools-libs-tcl sgml-common sgpio sound-theme-freedesktop speex startup-notification system-config-date-docs system-config-firewall-tui tex-preview texinfo texinfo-tex texlive texlive-dvips texlive-latex texlive-texmf texlive-texmf-dvips texlive-texmf-errata texlive-texmf-errata-dvips texlive-texmf-errata-fonts texlive-texmf-errata-latex texlive-texmf-fonts texlive-texmf-latex texlive-utils tokyocabinet urlview urw-fonts usermode-gtk xcb-util xml-common xorg-x11-font-utils xulrunner xz xz-lzma-compat yelp lksctp-tools-devel libtool-ltdl-devel gmp mhash mhash-devel gdbm zlib curl g++ openssl bzip2-devel libc-client-devel bison system-config-securitylevel libc-client-devel readline-devel compat-readline43 distcache-devel cmake lynx php-snmp gd-devel glibc-*
@ 기타 모듈 설치
# cd /usr/local/src
# mkdir etc
# cd etc
# wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.5.tar.gz
# wget https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.1.tar.gz
# wget http://ijg.org/files/jpegsrc.v9a.tar.gz
# wget http://sourceforge.net/projects/libpng/files/libpng16/1.6.16/libpng-1.6.16.tar.gz
# wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
# wget http://heanet.dl.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz
# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
# tar zxvf freetype-2.5.5.tar.gz; tar zxvf libgd-2.1.1.tar.gz; tar zxvf jpegsrc.v9a.tar.gz; tar zxvf libpng-1.6.16.tar.gz; tar zxvf imap-2007f.tar.gz; tar zxvf pcre-8.36.tar.gz; tar zxvf libmcrypt-2.5.8.tar.gz; tar zxvf libiconv-1.14.tar.gz
# cd /usr/local/src/etc/jpeg-9a;./configure --prefix=/usr/local/jpeg --enable-shared --enable-static;make clean;make -j4; make install;
# cd /usr/local/src/etc/libpng-1.6.16
# cp scripts/makefile.linux Makefile
# make clean;make -j4;make install
# cd /usr/local/src/etc/freetype-2.5.5
# make clean;./configure --prefix=/usr/local/freetype;make -j4;make install
# cd /usr/local/src/etc/libgd-2.1.1
# make clean;./configure --prefix=/usr/local/gd;make -j4;make install
# cd /usr/local/src/etc/imap-2007f
Makefile을 오픈하여 EXTRACFLAGS= 를 EXTRACFLAGS=-fPIC 로 수정 합니다.
# make clean;make lr5
# mkdir /usr/local/imap
# mkdir /usr/local/imap/include
# mkdir /usr/local/imap/lib
# cp c-client/*.h /usr/local/imap/include/
# cp c-client/*.c /usr/local/imap/lib/
# cp c-client/c-client.a /usr/local/imap/lib/libc-client.a
# cp imapd/imapd /usr/sbin/
# vi /etc/xinetd.d/imapd
service imap
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
log_on_success += HOST DURATION
log_on_failure += HOST
}
# service xinetd restart
# cd /usr/local/src/etc/pcre-8.36
# make clean;./configure --prefix=/usr/local --enable-unicode-properties=yes;make -j4;make install
# cd /usr/local/src/etc/libmcrypt-2.5.8
# make clean;./configure --prefix=/usr/local;make -j4;make install
# cd /usr/local/src/etc/libiconv-1.14
# make clean;./configure --prefix=/usr/local;make -j4;
iconv 컴파일 설치시 에러
./configure
이상없이 컴파일 실행 후
make 실행시 아래와 같은 에러 발생 하였다.
gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBIConV=1 -DDEPENDS_ON_LIBINTL=1 -O2 -march=native -c careadlinkat.c
gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBIConV=1 -DDEPENDS_ON_LIBINTL=1 -O2 -march=native -c malloca.c
gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBIConV=1 -DDEPENDS_ON_LIBINTL=1 -O2 -march=native -c progname.c
In file included from progname.c:26:0:
./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)
make[2]: *** [progname.o] Error 1
make[2]: Leaving directory `/usr/src/libiconv-1.14/srclib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/libiconv-1.14/srclib'
make: *** [all] Error 2
다음과 같이
srclib/stdio.h 파일 1010줄을 다음과 같이 추가하여 수정한다.
+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
#endif
# make install
# ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
vi /etc/sysconfig/selinux 를 열어
SELINUX=enforcing 를 SELINUX=disabled 로 바꿔주고 서버 재부팅 한다.
reboot
@ 아파치 설치전 apr 설치
# cd /usr/local/src
# wget http://archive.apache.org/dist/apr/apr-1.5.1.tar.gz
# wget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
# tar zxvf apr-1.5.1.tar.gz
# cd /usr/local/src/apr-1.5.1
# ./configure --prefix=/usr/local/apr
# make;make install
# cd /usr/local/src
# tar zxvf apr-util-1.5.4.tar.gz
# cd /usr/local/src/apr-util-1.5.4
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make;make install
*** httpd 2.4.14 설치 ***
cd /usr/local/src
wget http://mirror.apache-kr.org//httpd/httpd-2.4.12.tar.gz
tar zxvf httpd-2.4.12.tar.gz
prefork 설정시
# vi server/mpm/prefork/prefork.c (73번 라인)
DEFAULT_SERVER_LIMIT의 상수값을 1024로 수정.
worker 설정시
# vi server/mpm/worker/worker.c (84번 라인)
DEFAULT_SERVER_LIMIT의 상수값을 64로 수정.
# cd httpd-2.4.12
./configure \
--prefix=/usr/local/apache \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-z \
--with-pcre \
--enable-mods-static='vhost_alias log_config logio mime mime_magic alias headers status http negotiation' \
--enable-mods-shared='file_cache disk_cache deflate expires usertrack unique_id actions userdir autoindex cgi cache mem_cache distcache auth_digest rewrite remoteip' \
--enable-rewrite \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-ssl \
--disable-imagemap \
--disable-include \
--disable-charset-lite \
--disable-reqtimeout \
--disable-cgid \
--disable-asis \
--enable-so \
--enable-authn-socache=no \
--enable-socache-shmcb \
--enable-socache-dbm=no \
--enable-ldap=no \
--enable-authnz-ldap=no \
--enable-cgid=no \
--enable-dav=no \
--enable-dav-fs=no \
--enable-isapi=no \
--enable-proxy=no \
--enable-proxy-connect=no \
--enable-proxy-ftp=no \
--enable-proxy-http=no \
--enable-proxy-fcgi=no \
--enable-proxy-scgi=no \
--enable-proxy-fdpass=no \
--enable-proxy-ajp=no \
--enable-proxy-balancer=no \
--enable-proxy-express=no \
--enable-ext-filter=no \
--enable-authnz-ldap=no \
--enable-lbmethod-byrequests=no \
--enable-lbmethod-bytraffic=no \
--enable-lbmethod-bybusyness=no \
--enable-lbmethod-heartbeat=no \
--enable-dav-lock=no \
--enable-mpms-shared=all
이 컴파일 옵션은 다음과 같은 특징을 같습니다.
## LDAP 를 사용할 수 없다.
## Proxy를 사용할 수 없다.
## DSO 로 컴파일 되었다.
## MPM 을 Loadable MPM으로 컴파일 되었다. 이는 Run-time 에서 MPM 모델을 바꿀 수 있다는 뜻.
# make;make install
httpd의 기본적으로 사용할 계정을 생성해 줍니다.
# /usr/sbin/useradd -c "Apache" -u 48 -s /sbin/nologin -r -d /usr/local/apache/htdocs apache
그리고 나서 httpd.conf 파일을 다음과 같이 수정해 줍니다.
vim /usr/local/apache/conf/httpd.conf
User apache
Group apache
'Loadable MPM'(–enable-mpms-shared=all) 으로 컴파일 되었기 때문에 자신이 사용할 MPM 모듈을 활성화 해줍니다.
#LoadModule mpm_event_module modules/mod_mpm_event.so # event MPM
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so # prefork
#LoadModule mpm_worker_module modules/mod_mpm_worker.so # worker
그리고 ServerName 을 자신의 서버 환경에 맞게 적어줍니다.
ServerName localhost:80
서버관리자 메일주소 설정
ServerAdmin http://kr1.php.net/distributions/php-5.6.6.tar.gz
# tar zxvf php-5.6.6.tar.gz
# cd php-5.6.6
# ./configure --prefix=/usr/local/php \
--enable-fpm \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-libdir=lib \
--with-gettext \
--with-mhash \
--with-gmp \
--with-gd \
--with-jpeg-dir=/usr/local/jpeg \
--with-png-dir=/usr/local/lib \
--with-mcrypt=/usr/local/lib \
--with-iconv=/usr/local/lib \
--with-freetype-dir=/usr/local/freetype \
--with-config-file-path=/usr/local/lib \
--with-zlib \
--enable-gd-native-ttf \
--enable-bcmath \
--enable-exif \
--with-mcrypt \
--with-zlib \
--with-bz2 \
--enable-mbstring \
--enable-opcache \
--with-curl \
--with-openssl \
--with-imap=/usr/local/imap \
--with-imap-ssl \
--with-pdo-mysql=/usr/local/mariadb \
--with-mysql=/usr/local/mariadb \
--with-mysqli=/usr/local/mariadb/bin/mysql_config \
--enable-pcntl \
--enable-mbregex \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-libxml-dir=/usr \
--with-kerberos \
--disable-debug \
--enable-soap \
--with-gdbm \
--enable-ftp \
--enable-calendar \
--enable-shmop \
--enable-inline-optimization \
--enable-sigchild \
--enable-sockets \
--enable-maintainer-zts
# make; make install
* php.ini 파일을 다음과 같이 복사해 줍니다.
# cp php.ini-production /usr/local/lib/php.ini
추가작업은 아래와 같이
# vi /root/.bash_profile
PATH=$PATH:$HOME/bin 를
PATH=$PATH:$HOME/bin:/usr/local/mariadb/bin:/usr/local/apache/bin:/usr/local/php/bin 로 수정
source /root/.bash_profile
service httpd restart 또는 systemctl restart httpd.service
@ php.ini 설정
# vi /usr/local/lib/php.ini
post_max_size = 100M
upload_max_filesize = 100M
allow_url_fopen = Off
short_open_tag = On
disable_functions = exec,passthru,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source 또는
disable_functions = system, show_source, exec, shell_exec, curl_exec, parse_ini_file, curl_multi_exec, proc_open, passthru, set_time_limit, ini_restore, mysql_list_dbs, ini_alter, dl, pfsockopen, openlog, syslog, symlink, link, chgrp, leak, popen, escapeshellcmd, apache_child_terminate, apache_get_modules, apache_get_version, apache_getenv, apache_note, apache_setenv, virtual, mb_send_mail 또는
disable_functions = php_uname, putenv, getmyuid, getmypid, passthru, leak, listen, diskfreespace, tmpfile, link, ignore_user_abord, shell_exec, popen, dl, set_time_limit, exec, system, highlight_file, source, show_source, fpaththru, virtual, posix_ctermid, posix_getcwd, posix_getegid, posix_geteuid, posix_getgid, posix_getgrgid, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgid, posix_getpgrp, posix_getpid, posix_getppid, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_getuid, posix_isatty, posix_kill, posix_mkfifo, posix_setegid, posix_seteuid, posix_setgid, posix_setpgid, posix_setsid, posix_setuid, posix_times, posix_ttyname, posix_uname
자주 살펴보는 파일은 심볼릭 링크를 설정해서 /root/conf 파일에 모아두자
# mkdir /root/conf
# cd /root/conf
# ln -s /usr/local/lib/php.ini /root/conf/php.ini
# ln -s /usr/local/apache/conf/httpd.conf /root/conf/httpd.conf
# ln -s /usr/local/apache/conf/extra/httpd-vhosts.conf /root/conf/httpd-vhosts.conf
# ln -s /usr/local/apache/conf/extra/httpd-ssl.conf /root/conf/httpd-ssl.conf
# ln -s /etc/my.cnf /root/conf/my.cnf
# ln -s /etc/sysconfig/iptables /root/conf/iptables
1
댓글 20개

혹시 (우분투OS + MySQL) 서버에서 (센토스OS + mariaDB) 서버로 이전하면 문제 생길까요?
ps.
적어주신 내용인 명령어 입력 부분과 단순 출력 부분이 구분이 안 되서 헷갈리네요.
혹시, hwp나 웹에디터를 이용해 직접 입력해야만 하는 명령어만 색상 다르게 안 될까요?
입력해야만 하는 명령어만 따로 색상 구분된 hwp 버전으로 나오면 좋겠습니다. ^^

그리고 본문 페이지에서 # 만 빼고 복사 하셔서 붙혀넣기 하시면 됩니다.
설치를 시작하시면 직관적으로 쉘상에 확인이 가능 하실껄로 예상 합니다.
다음번 작업때는 다른 방법을 강구해 보겠습니다.....^^

그거 어디까지 적고 엔터쳐야 해요?



설마 서버 앞에서 직접 작업하시나요?


혹시 색상 잘 못 된 부분 있나 좀 봐주세요.
메일로 보냈습니다.
PS. 이 부분도 잘 이해가...
'Loadable MPM'(–enable-mpms-shared=all) 으로 컴파일 되었기 때문에 자신이 사용할 MPM 모듈을 활성화 해줍니다.
#LoadModule mpm_event_module modules/mod_mpm_event.so # event MPM
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so # prefork
#LoadModule mpm_worker_module modules/mod_mpm_worker.so # worker

서버 설치후에 셋중에 하나만 쓰시면 됩니다.
사용하시고 싶은 방식을 주석을 풀고 쓰시면 됩니다.
그리고 메일은 안왔는데요?

http://www.homzzang.com/bbs/password.php?w=s&bo_table=suggest&wr_id=11
위 게시물 비밀번호 1111 입니다. 첨부파일로 올렸어요.


가능하면, 쓰시는 편집기로 수정해보도록 할게요.

웹작업시에는 에디터 플러스 씁니다.

명령어와 편집내용이 구분이 잘 안가서 어렵네요.
원래 이렇게 복잡한가요? 우분투로 세팅할 땐 이렇게 안 복잡했는데...

./configure --prefix=/usr/local/php 다음부터 --enable-maintainer-zts 까지 같이 입력해야 합니다.



단지 OS만 CentOS6.6을 사용하고 있습니다.
여러가지로 이전버전보다는 좋은 퍼모먼스를 보여주네요....^^
Makefile을 오픈하여 EXTRACFLAGS= 를 EXTRACFLAGS=-fPIC 로 수정 합니다.
vim 으로 위의 내용 같이 수정을 했는데
fPIC 경로를 찾을수 없다고 나옵니다 ..
어떻게 수정해야 할까요 ?
gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -g -O2 -c progname.c
In file included from progname.c:26:0:
./stdio.h:1010:1: error: expected identifier or ‘(’ before ‘+’ token
+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
^
./stdio.h:1010:2: error: stray ‘#’ in program
+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
^
./stdio.h:1012:1: error: expected identifier or ‘(’ before ‘+’ token
+#endif
^
./stdio.h:1012:2: error: stray ‘#’ in program
+#endif
^
./stdio.h:1629:2: error: #endif without #if
#endif
^
make[1]: *** [progname.o] 오류 1