You cannot see this page without javascript.

FreeBSD APM Source Compile

Linux 조회 수 2145 추천 수 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 Xpress Engine xe 모든 변수값 출력해 보기 LynX 2014-07-14 93753
368 Linux systemd unit 등록 옵션 LynX 2014-07-22 20455
367 Linux Install PHP 5.5.13 modules LynX 2014-06-27 11866
366 아래아 한글 웹 한글 뷰어 소스 LynX 2014-06-11 9426
365 Internet Explorer KT 인터넷 접속제한 공유기 설정 LynX 2014-01-13 9228
364 Linux lineage1 server [6] LynX 2016-01-11 9049
363 CentOS CentOS7 Mail Server Setting file [13] LynX 2015-06-13 7906
362 Server Apache HTTP Server와 Tomcat의 연동 file LynX 2014-05-20 6112
361 Windows 7 외부 윈도우 클라이언트에서 삼바서버 접속하기 LynX 2014-03-06 6030
360 CentOS7 ▒ Doly의 CentOS7 강좌13 4. 원격접속 - 3.Telnet file [8] LynX 2014-10-23 5922
359 CentOS7 ▒ Doly의 CentOS7 강좌27 10. 디스크관리 6 XFS 쿼타 file [15] LynX 2015-06-09 5732
358 CentOS7 ▒ Doly의 CentOS7 강좌29 12. 네트워크 보안설정 12.1 firewalld (2/2) [21] LynX 2015-06-09 5282
357 CentOS APM 소스설치 정리 file [18] LynX 2015-06-17 4628
356 Network VLAN 설정 ① Access mode file [27] LynX 2015-04-29 4270
355 Programing meadco print LynX 2013-12-12 4267
354 Programing Sublime Text License Keys LynX 2016-03-24 4182
353 CentOS7 ▒ Doly의 CentOS7 강좌19 6. CentOS 네트워크 5-관련 명령어 LynX 2014-10-23 4070
352 Linux musescore LynX 2015-03-28 3779
351 Linux imap-php 설치 [7] LynX 2014-09-02 3727
350 CentOS7 ▒ Doly의 CentOS7 강좌18 6. CentOS 네트워크 4-네트워크 본딩(bonding) file [10] LynX 2014-10-23 3659

XE Login