You cannot see this page without javascript.

FreeBSD APM Source Compile

Linux 조회 수 2163 추천 수 0 2016.05.20 23:42:20

ip고정


vi /etc/rc.conf:
ifconfig_em0="inet 192.168.0.254 netmask 255.255.255.0"
defaultrouter="192.168.0.1"


echo "nameserver 168.126.63.1" >> /etc/resolv.conf


관련 페키지 설치

portsnap fetch update && portupgrade -a

pkg install -y wget cmake ncurses libtool expat pcre openssl openssl-devel flex gcc patch gettext automake bison libtool autoconf binutils patchutils byacc diffstat cvs rcs subversion ctags cscope fuse openssl lzma doxygen intltool git swig pkgconf rsync gawk mawk gnulib

 

계정 생성

pw groupadd dba
adduser


ID : mysql

Full Name : MySQL

Group : dba

Shell : nologin

Home : /var/mysql

PW : no

 

컴파일러 버전변경

mv /usr/bin/cc /usr/bin/cc34
ln -s /usr/local/bin/gcc48 /usr/local/bin/cc
mv /usr/bin/c++ /usr/bin/c++34
ln -s /usr/local/bin/c++48 /usr/local/bin/c++
mv /usr/bin/CC /usr/bin/CC34
ln -s /usr/local/bin/c++48 /usr/local/bin/CC
mv /usr/bin/cpp /usr/bin/cpp34
ln -s /usr/local/bin/cpp48 /usr/local/bin/cpp

 

라이브러리 링크
ln -s /usr/local/lib /usr/lib


소스 다운로드 및 설치

cd /usr/src
wget http://ftp.kaist.ac.kr/mariadb/mariadb-10.1.14/source/mariadb-10.1.14.tar.gz
tar zxvf mariadb-10.1.14.tar.gz

chmod -R 777 mariadb-10.1.14
cd mariadb-10.1.14

cmake \
-DCMAKE_INSTALL_PREFIX=/apm/server/mariadb \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DMYSQL_DATADIR=/apm/apps/data \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/apm/server/mariadb/mysql.sock \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_ARIA_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_FEDERATEDX_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITH_XTRADB_STORAGE_ENGINE=1 \
-DWITH_ZLIB=system \
-DWITHOUT_TOKUDB=1

make
make install


디렉토리 생성 및 환경 설정
mkdir /apm/apps
cd /apm/server/mariadb
mkdir /apm/server/conf
mv /etc/my.cnf /apm/server/conf/my.cnf
vi /apm/server/conf/my.cnf


[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
datadir=/apm/apps/data
socket=/apm/server/mariadb/mysql.sock
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
 
# Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
# include all files from the config directory
# !includedir /etc/my.cnf.d

 

디렉토리 생성 및 권한 설정

mkdir /var/log/mariadb
mkdir /var/run/mariadb
chown mysql:dba /var/log/mariadb
chown mysql:dba /var/run/mariadb
./scripts/mysql_install_db --user=mysql --datadir=/apm/apps/data  --defaults-file=/apm/server/conf/my.cnf
chown -R mysql:dba /apm/server/mariadb
chown -R mysql:dba /apm/apps/data
ln -s /apm/server/mariadb/bin/mysql /usr/bin/mysql
ln -s /apm/server/mariadb/bin/mysqldump /usr/sbin/mysqldump
ln -s /apm/server/mariadb/bin/mysql_config /usr/sbin/mysql_config
ln -s /apm/server/mariadb/bin/mysqladmin /usr/sbin/mysqladmin
ln -s /apm/server/mariadb/support-files/mysql.server /etc/rc.d/mysql

service mysql start

ln -s /apm/server/mariadb/support-files/mysql.server /usr/local/etc/rc.d/mysql.server.sh


root 비밀번호 설정

mysqladmin -u root password

mysqladmin -u root -p reload


DB 접속 테스트

mysql -u root -p

 

Apache 다운로드 및 설치

cd /usr/src
wget http://mirror.apache-kr.org/httpd/httpd-2.4.20.tar.gz
tar zxvf httpd-2.4.20.tar.gz
cd httpd-2.4.20
./configure \
--prefix=/apm/server/apache/httpd \
--sysconfdir=/apm/server/conf \
--with-apr=/usr/local/bin/apr-1-config \
--with-apr-util=/usr/local/bin/apu-1-config \
--with-libxml2 \
--with-mpm=worker \
--with-pcre \
--with-ssl \
--with-z \
--enable-authn-socache=no \
--enable-authnz-ldap=no \
--enable-cache \
--enable-cgid=no \
--enable-deflate \
--enable-dav \
--enable-dav-fs=no \
--enable-dav-lock=no \
--enable-ext-filter=no \
--enable-expires \
--enable-file-cache \
--enable-headers \
--enable-isapi=no \
--enable-lbmethod-bybusyness=no \
--enable-lbmethod-byrequests=no \
--enable-lbmethod-bytraffic=no \
--enable-lbmethod-heartbeat=no \
--enable-ldap=no \
--enable-mime-magic \
--enable-mods-shared=most \
--enable-modules=most \
--enable-mpms-shared=all \
--enable-proxy \
--enable-proxy-ajp=no \
--enable-proxy-balancer=no \
--enable-proxy-connect=no \
--enable-proxy-express=no \
--enable-proxy-fcgi=no \
--enable-proxy-fdpass=no \
--enable-proxy-ftp=no \
--enable-proxy-http=no \
--enable-proxy-scgi=no \
--enable-rewrite \
--enable-so \
--enable-socache-dbm=no \
--enable-socache-shmcb \
--enable-ssl \
--enable-vhosts-alias
make
make install

 

Apache 환경설정
cd /apm/server/conf
vi httpd.conf

ServerRoot "/apm/server/apache/httpd"
Listen 80
# 사용할 모듈의 주석을 제거하여 활성화한다
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule dav_module modules/mod_dav.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
...
</IfModule>
# 관리자 이메일
ServerAdmin admin@my.domain
# 서버 이름
#ServerName www.my.domain:80
ServerName 127.0.0.1
# 루트 디렉토리
<Directory />
    AllowOverride none
    Require all denied
</Directory>
# 도큐먼트 루트 디렉토리
DocumentRoot "/apm/apps/docs"
<Directory "/apm/apps/docs">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
# 폴더로 접근할 때 실행하는 인덱스 파일 설정
<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php index.php3
</IfModule>
# 개발 환경 설정 참조
<Files ".ht*">
    Require all denied
</Files>
# 설정 파일 import
# Server-pool management (MPM specific)
Include /apm/server/conf/extra/httpd-mpm.conf
# Language settings
Include /apm/server/conf/extra/httpd-languages.conf
 
mkdir /apm/apps/docs

vi extra/httpd-languages.conf
 
DefaultLanguage ko


vi /apm/server/apache/httpd/bin/apachectl

 

#!/bin/sh
#
# Apache This starts and stops Apache.
#
# chkconfig: 35 20 80
# description: Apache Web Service
#
# Licensed to the Apache Software Foundation
...

 

ln -s /apm/server/apache/httpd/bin/apachectl /etc/rc.d/apache
kldload accf_data
kldload accf_http
service apache start
ln -s /apm/server/apache/httpd/bin/apachectl /usr/local/etc/rc.d/apache.sh
echo "/apm/server/apache/httpd/module" >> /etc/ld.so.conf
ldconfig
echo 'accf_data_load="YES"' >> /boot/loader.conf
echo 'accf_http_load="YES"' >> /boot/loader.conf

 

Apache 테스트

실제 브라우저를 이용하여 확인

echo "apache TEST" > /apm/apps/docs/index.html
chmod 755 /apm/apps/docs/index.html

 

php install

 

pkg install libvpx icu openldap-sasl-client mcrypt libxslt cclient
cd /usr/src
wget http://kr1.php.net/distributions/php-5.6.23.tar.gz
tar zxvf php-5.6.23.tar.gz
cd php-5.6.23
./configure \
--prefix=/apm/server/php \
--program-prefix= \
--with-layout=GNU \
--localstatedir=/var \
--with-config-file-path=/apm/server/conf \
--with-config-file-scan-dir=/apm/server/conf \
--disable-all \
--disable-cli \
--disable-cgi \
--with-apxs2=/apm/server/apache/httpd/bin/apxs \
--with-bz2 \
--with-curl \
--with-freetype-dir=/usr/local \
--with-gd \
--with-gdbm \
--with-gettext \
--with-gmp \
--with-iconv-dir=/usr/lib/ \
--with-icu-dir=/usr/local \
--with-imap \
--with-imap-ssl \
--with-jpeg-dir=/usr/local \
--with-kerberos \
--with-ldap \
--with-ldap-sasl \
--with-libdir=lib \
--with-libedit \
--with-libexpat-dir=/usr/local \
--with-libmbfl \
--with-libxml-dir=/usr/local \
--with-mcrypt \
--with-mhash \
--with-mysql-sock=/apm/server/mariadb/mysql.sock \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-onig \
--with-openssl \
--with-openssl-dir=/usr/local \
--with-pcre-dir=/usr/local \
--with-pcre-regex=/usr/local \
--with-pdo-mysql=mysqlnd \
--with-pear \
--with-pic \
--with-png-dir=/usr/local \
--with-readline \
--with-regex=php \
--with-t1lib=/usr/local \
--with-vpx-dir=/usr/local \
--with-xmlrpc \
--with-xpm-dir=/usr/local \
--with-xsl \
--with-zend-vm=CALL \
--with-zlib \
--with-zlib-dir=/usr \
--enable-bcmath \
--enable-calendar \
--enable-dba=shared \
--enable-dom \
--enable-exif \
--enable-ftp \
--enable-gd-jis-conv \
--enable-gd-native-ttf \
--enable-inline-optimization \
--enable-intl \
--enable-json \
--enable-libxml \
--enable-maintainer-zts \
--enable-mbregex \
--enable-mbstring \
--enable-mod-charset \
--enable-mysqlnd \
--enable-opcache \
--enable-pcntl \
--enable-pdo \
--enable-session \
--enable-shmop \
--enable-sigchild \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--enable-xml \
--enable-zip
make
make install

 

환경 설정

cp php.ini-production /apm/server/conf/php.ini
vi /apm/server/conf/php.ini

short_open_tag = On
asp_tags = On
date.timezone = "Asia/Seoul"
 
vi /apm/server/conf/httpd.conf

# PHP 모듈이 정상적으로 추가되었는지 확인
LoadModule php5_module modules/libphp5.so
<IfModule mime_module>
    ... 중략 ...
    AddType application/x-httpd-php .php .html
    AddType application/x-httpd-php-source .phps
</IfModule>
 

service apache stop
service apache start
ln -s /apm/server/php/bin/php /bin/php
ln -s /apm/server/php/bin/php-config /usr/local/bin/php-config
ln -s /apm/server/php/bin/phpize /usr/local/bin/phpize
echo "<?php phpinfo() ?>" > /apm/apps/docs/phpinfo.php


cd /apm/apps/docs
wget https://files.phpmyadmin.net/phpMyAdmin/4.6.2/phpMyAdmin-4.6.2-all-languages.tar.gz
tar zxvf phpMyAdmin-4.6.2-all-languages.tar.gz
mv phpMyAdmin-4.6.2-all-languages phpmyadmin

엮인글 :
List of Articles
번호 제목 글쓴이 날짜sort 조회 수
369 Windows7 OEM을 활용하여 클린설치 file [11] LynX 2010-11-06 765
368 Windows7 에서 시스템을 백업/복원하는 가장 쉬운 방법!! file LynX 2010-11-07 334
367 탐색기 메뉴에 '명령 프롬프트 열기'와 '메모장으로 열기' 추가하기 file [14] LynX 2010-11-08 591
366 인터넷 익스플로러 리플레쉬 file LynX 2011-05-02 286
365 활성 네트워크 중복으로 인한 인터넷 연결 안되는 문제 file [12] LynX 2011-05-26 971
364 32bit Driver을 64bi로 설치하기 [8] LynX 2011-06-21 325
363 설치파일(inf)에 대한 이해 [7] LynX 2011-06-22 601
362 inf 설치시 경고창 안뜨게 하기 file [10] LynX 2011-06-22 430
361 로우 포맷(Low level format, 저수준 포맷) 하기 file [11] LynX 2011-07-06 722
360 Win XP Crack file [8] LynX 2011-10-31 269
359 윈도우7 메모리 인식 문재 file [13] LynX 2011-11-30 530
358 RoundCube 첨부 용량 변경 / 한글 수정 [10] LynX 2012-01-31 836
357 윈도우7 알수없는장치 file [8] LynX 2012-03-13 270
356 디지털 서명 file [1] LynX 2012-03-15 445
355 아레한글 사용시 출력물에 음영이 나타나는 현상. file [11] LynX 2012-03-29 1154
354 Xyview DVR서버 연결 [8] LynX 2012-04-19 295
353 HP Officejet 6500A (Plus) 호환 드라이버 [8] LynX 2012-05-16 294
352 IIS에 FastCgi모듈 활성화 시키기 file [12] LynX 2012-11-21 1283
351 윈도우 2008서버에 XE 설치 절차 [9] LynX 2012-11-22 230
350 Windows Server 2012 설치 file LynX 2012-11-23 477

XE Login