Ubuntu 20.04 : PHP5 설치

Programming/Apache, PHP 2020. 11. 25. 00:43 Posted by 파란크리스마스

출처

필요 라이브러리 설치

bluesanta@Kubuntu:~$ sudo apt install libc-client2007e-dev libgdbm-dev libgmp-dev libkrb5-dev

libmcrypt 설치

bluesanta@Kubuntu:~$ wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
bluesanta@Kubuntu:~$ tar xvfz libmcrypt-2.5.8.tar.gz
bluesanta@Kubuntu:~$ cd libmcrypt-2.5.8/
bluesanta@Kubuntu:~/libmcrypt-2.5.8$ ./configure
bluesanta@Kubuntu:~/libmcrypt-2.5.8$ make
bluesanta@Kubuntu:~/libmcrypt-2.5.8$ sudo make install

mhash 설치

bluesanta@Kubuntu:~$ wget https://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
bluesanta@Kubuntu:~$ tar xvfz mhash-0.9.9.9.tar.gz
bluesanta@Kubuntu:~$ cd mhash-0.9.9.9/
bluesanta@Kubuntu:~/mhash-0.9.9.9$ ./configure
bluesanta@Kubuntu:~/mhash-0.9.9.9$ make
bluesanta@Kubuntu:~/mhash-0.9.9.9$ sudo make install

FreeTDS 설치

bluesanta@Kubuntu:~$ wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-patched.tar.gz
bluesanta@Kubuntu:~$ tar xvfz freetds-patched.tar.gz
bluesanta@Kubuntu:~$ cd freetds-1.2.12/
bluesanta@Kubuntu:~/freetds-1.2.12$ ./configure -prefix=/usr/local/freetds --disable-odbc --disable-debug --enable-msdblib
bluesanta@Kubuntu:~/freetds-1.2.12$ make
bluesanta@Kubuntu:~/freetds-1.2.12$ sudo make install

freetype2 설치

bluesanta@Kubuntu:~$ wget https://downloads.sourceforge.net/freetype/freetype-2.10.4.tar.xz
bluesanta@Kubuntu:~$ tar xvf freetype-2.10.4.tar.xz
bluesanta@Kubuntu:~$ cd freetype-2.10.4/
bluesanta@Kubuntu:~/freetype-2.10.4$ ./configure --prefix=/usr --enable-freetype-config 
bluesanta@Kubuntu:~/freetype-2.10.4$ make -j4
bluesanta@Kubuntu:~/freetype-2.10.4$ sudo make install

openssl 설치

bluesanta@Kubuntu:~$ wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz
bluesanta@Kubuntu:~$ tar xvfz openssl-1.0.2u.tar.gz
bluesanta@Kubuntu:~$ cd openssl-1.0.2u
bluesanta@Kubuntu:~/openssl-1.0.2u$ ./config -fPIC shared --prefix=/opt/openssl-1.0.2u
bluesanta@Kubuntu:~/openssl-1.0.2u$ make -j4
bluesanta@Kubuntu:~/openssl-1.0.2u$ sudo make install
bluesanta@Kubuntu:~/openssl-1.0.2u$/opt/openssl-1.0.2u/bin/openssl version
OpenSSL 1.0.2u  20 Dec 2019

libcurl 설치

bluesanta@Kubuntu:~$ wget https://curl.haxx.se/download/curl-7.73.0.tar.gz
bluesanta@Kubuntu:~$ tar xvfz curl-7.73.0.tar.gz 
bluesanta@Kubuntu:~$ cd curl-7.73
bluesanta@Kubuntu:~/curl-7.73.0$ env PKG_CONFIG_PATH=/opt/openssl-1.0.2u/lib/pkgconfig ./configure --prefix=/opt/curl-7.73.0 --with-openssl
... 생략 ...
  SSL:              enabled (OpenSSL)
... 생략 ...
bluesanta@Kubuntu:~/curl-7.73.0$ make
bluesanta@Kubuntu:~/curl-7.73.0$ sudo make install
bluesanta@Kubuntu:~/curl-7.73.0$ sudo ln -s /opt/openssl-1.0.2u/lib/libssl.so.1.0.0 /usr/lib/libssl.so.1.0.0
bluesanta@Kubuntu:~/curl-7.73.0$ sudo ln -s /opt/openssl-1.0.2u/lib/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.1.0.0
bluesanta@Kubuntu:~/curl-7.73.0$ /opt/curl-7.73.0/bin/curl --version
curl 7.73.0 (x86_64-pc-linux-gnu) libcurl/7.73.0 OpenSSL/1.0.2u zlib/1.2.11
Release-Date: 2020-10-14
Protocols: dict file ftp ftps gopher http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets

PHP5 설치

1. PHP5 컴파일 오류 수정

오류 메시지

configure: error: Unable to locate gmp.h

해결방법

bluesanta@Kubuntu:~$ sudo ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h

2. PHP5 컴파일 오류 수정

오류 메시지

configure: error: wrong mysql library version or lib not found. Check config.log for more information.

해결방법

bluesanta@Kubuntu:~/php-5.6.40$ sudo ln -s /bluesanta/mysql-5.7.23/lib/libmysqlclient.so /bluesanta/mysql-5.7.23/lib/libmysqlclient_r.so

2. PHP5 컴파일 오류 회피

오류 메시지

/bin/bash: line 1: 3884732 세그멘테이션 오류 (core dumped) ` if test -x "/home/bluesanta/php-5.6.40/sapi/cli/php"; then /home/bluesanta/php-5.6.40/build/shtool echo -n -- "/home/bluesanta/php-5.6.40/sapi/cli/php -n"; if test "x" != "x"; then /home/bluesanta/php-5.6.40/build/shtool echo -n -- " -d extension_dir=/home/bluesanta/php-5.6.40/modules"; for i in bz2 zlib phar; do if test -f "/home/bluesanta/php-5.6.40/modules/$i.la"; then . /home/bluesanta/php-5.6.40/modules/$i.la; /home/bluesanta/php-5.6.40/build/shtool echo -n -- " -d extension=$dlname"; fi; done; fi; else /home/bluesanta/php-5.6.40/build/shtool echo -n -- "/home/bluesanta/php-5.6.40/sapi/cli/php"; fi;` -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0' /home/bluesanta/php-5.6.40/ext/phar/build_precommand.php > ext/phar/phar.php
make: *** [Makefile:381: ext/phar/phar.php] 오류 139
make: *** 끝나지 않은 작업을 기다리고 있습니다....

configure 해당 옵션 제거

--with-imap=/usr/local/imap-2007f \
--with-imap-ssl \

PHP5 컴파일

bluesanta@Kubuntu:~$ wget https://www.php.net/distributions/php-5.6.40.tar.gz
bluesanta@Kubuntu:~$ tar xvfz php-5.6.40.tar.gz
bluesanta@Kubuntu:~$ bluesanta@Kubuntu:~$ cd php-5.6.40/
bluesanta@Kubuntu:~/php-5.6.40$ env PKG_CONFIG_PATH=/opt/openssl-1.0.2u/lib/pkgconfig \
./configure --prefix=/bluesanta/apps/php-5.6.40 \
--enable-fpm \
--with-apxs2=/bluesanta/apps/apache24_php5/bin/apxs \
--with-libdir=/lib \
--with-gettext \
--with-gmp \
--with-gd \
--with-jpeg-dir=/usr/local/jpeg \
--with-png-dir=/usr/local/lib \
--with-mcrypt=/usr/local/lib \
--with-iconv \
--with-freetype-dir=/usr/local/freetype \
--with-config-file-path=/usr/local/lib \
--enable-gd-native-ttf \
--enable-bcmath \
--enable-exif \
--with-mcrypt \
--with-zlib \
--with-bz2 \
--enable-mbstring \
--enable-opcache \
--with-openssl=/opt/openssl-1.0.2u \
--with-curl=/opt/curl-7.73.0/bin/curl \
--with-mysql-sock=/bluesanta/mysql-5.7.23/mysql.sock \
--with-mysqli=/bluesanta/mysql-5.7.23/bin/mysql_config \
--with-pdo-mysql=/bluesanta/mysql-5.7.23 \
--with-mysql \
--with-mssql=/usr/local/freetds \
--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
bluesanta@Kubuntu:~/php-5.6.40$ make -j4
 
... 생략 ...
 
/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/local/freetds/lib/libsybdb.so, may conflict with libssl.so.1.0.0
/usr/bin/ld: warning: libcrypto.so.1.1, needed by /usr/local/freetds/lib/libsybdb.so, may conflict with libcrypto.so.1.0.0
/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/local/freetds/lib/libsybdb.so, may conflict with libssl.so.1.0.0
/usr/bin/ld: warning: libcrypto.so.1.1, needed by /usr/local/freetds/lib/libsybdb.so, may conflict with libcrypto.so.1.0.0
Generating phar.php
Generating phar.phar
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
directorytreeiterator.inc
clicommand.inc
directorygraphiterator.inc
invertedregexiterator.inc
pharcommand.inc
phar.inc
/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/local/freetds/lib/libsybdb.so, may conflict with libssl.so.1.0.0
/usr/bin/ld: warning: libcrypto.so.1.1, needed by /usr/local/freetds/lib/libsybdb.so, may conflict with libcrypto.so.1.0.0
bluesanta@Kubuntu:~/php-5.6.40$ make test

PHP5 설치

bluesanta@Kubuntu:~/php-5.6.40$ make install
/bin/bash /home/bluesanta/php-5.6.40/libtool --silent --preserve-dup-deps --mode=install cp ext/opcache/opcache.la /home/bluesanta/php-5.6.40/modules
Installing PHP SAPI module:       apache2handler
/bluesanta/apps/apache24/build/instdso.sh SH_LIBTOOL='/bluesanta/apps/apache24/build/libtool' libphp5.la /bluesanta/apps/apache24/modules
/bluesanta/apps/apache24/build/libtool --mode=install install libphp5.la /bluesanta/apps/apache24/modules/
libtool: install: install .libs/libphp5.so /bluesanta/apps/apache24/modules/libphp5.so
libtool: install: install .libs/libphp5.lai /bluesanta/apps/apache24/modules/libphp5.la
libtool: warning: remember to run 'libtool --finish /home/bluesanta/php-5.6.40/libs'
chmod 755 /bluesanta/apps/apache24/modules/libphp5.so
[activating module `php5' in /bluesanta/apps/apache24/conf/httpd.conf]
Installing shared extensions:     /bluesanta/apps/php-5.6.40/lib/php/extensions/no-debug-zts-20131226/
Installing PHP CLI binary:        /bluesanta/apps/php-5.6.40/bin/
Installing PHP CLI man page:      /bluesanta/apps/php-5.6.40/php/man/man1/
Installing PHP FPM binary:        /bluesanta/apps/php-5.6.40/sbin/
Installing PHP FPM config:        /bluesanta/apps/php-5.6.40/etc/
Installing PHP FPM man page:      /bluesanta/apps/php-5.6.40/php/man/man8/
Installing PHP FPM status page:   /bluesanta/apps/php-5.6.40/php/php/fpm/
Installing PHP CGI binary:        /bluesanta/apps/php-5.6.40/bin/
Installing PHP CGI man page:      /bluesanta/apps/php-5.6.40/php/man/man1/
Installing build environment:     /bluesanta/apps/php-5.6.40/lib/php/build/
Installing header files:           /bluesanta/apps/php-5.6.40/include/php/
Installing helper programs:       /bluesanta/apps/php-5.6.40/bin/
  program: phpize
  program: php-config
Installing man pages:             /bluesanta/apps/php-5.6.40/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /bluesanta/apps/php-5.6.40/lib/php/
[PEAR] Archive_Tar    - already installed: 1.4.4
[PEAR] Console_Getopt - already installed: 1.4.1
[PEAR] Structures_Graph- already installed: 1.1.1
[PEAR] XML_Util       - already installed: 1.4.3
[PEAR] PEAR           - already installed: 1.10.7
Wrote PEAR system config file at: /bluesanta/apps/php-5.6.40/etc/pear.conf
You may want to add: /bluesanta/apps/php-5.6.40/lib/php to your php.ini include_path
/home/bluesanta/php-5.6.40/build/shtool install -c ext/phar/phar.phar /bluesanta/apps/php-5.6.40/bin
ln -s -f phar.phar /bluesanta/apps/php-5.6.40/bin/phar
Installing PDO headers:           /bluesanta/apps/php-5.6.40/include/php/ext/pdo/




php.ini 복사

bluesanta@Kubuntu:~/php-5.6.40$ cp php.ini-production /bluesanta/apps/php-5.6.40/php.ini

libphp5.so 복사

bluesanta@Kubuntu:~/php-5.6.40$ cp /bluesanta/apps/apache24/modules/libphp5.so /bluesanta/apps/apache24_php5/modules/libphp5.so

/bluesanta/apps/apache24_php5/conf/httpd.conf 내용 추가

bluesanta@Kubuntu:~/php-5.6.40$ vi /bluesanta/apps/apache24_php5/conf/httpd.conf

#Listen 12.34.56.78:80
Listen 5050

# php 
LoadModule php5_module        modules/libphp5.so
PHPIniDir "/bluesanta/apps/php-5.6.40"

... 생략 ...

    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
    AddHandler application/x-httpd-php .php4 .php .phtml .ph .inc

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
    AddType application/x-httpd-php .php4 .php .phtml .ph .inc

</IfModule>

서비스 등록 파일 apache2_php5.service 생성

bluesanta@Kubuntu:~$ cd /bluesanta/apps/apache24_php5/bin/
bluesanta@Kubuntu:/bluesanta/apps/apache24_php5/bin$ vi apache2_php5.service

apache2_php5.service 내용

[Unit]
Description=The Apache HTTP Server(PHP5)
After=network.target remote-fs.target nss-lookup.target
Documentation=https://httpd.apache.org/docs/2.4/

[Service]
Type=forking
Environment=APACHE_STARTED_BY_SYSTEMD=true
ExecStart=/bluesanta/apps/apache24_php5/bin/apachectl start
ExecStop=/bluesanta/apps/apache24_php5/bin/apachectl stop
ExecReload=/bluesanta/apps/apache24_php5/bin/apachectl graceful
PrivateTmp=true
Restart=on-abort

[Install]
WantedBy=multi-user.target

apache2_php5.service 파일 /etc/systemd/system 디렉토리에 복사

bluesanta@Kubuntu:/bluesanta/apps/apache24_php5/bin$ chmod +x apache2_php5.service
bluesanta@Kubuntu:/bluesanta/apps/apache24_php5/bin$ sudo cp apache2_php5.service /etc/systemd/system

Apache 서비스 등록

bluesanta@Kubuntu:/bluesanta/apps/apache24_php5/bin$ sudo systemctl enable apache2_php5
Created symlink /etc/systemd/system/multi-user.target.wants/apache2_php5.service → /etc/systemd/system/apache2_php5.service.

Apache 서비스 실행

pi@Kubuntu:/bluesanta/apps/apache24/bin$ sudo systemctl start apache2_php5

Apache 서비스 상태 확인

bluesanta@Kubuntu:/bluesanta/apps/apache24_php5/bin$ sudo systemctl status apache2_php5
● apache2_php5.service - The Apache HTTP Server(PHP5)
     Loaded: loaded (/etc/systemd/system/apache2_php5.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Thu 2020-11-26 01:05:49 KST; 13s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 4178335 ExecStart=/bluesanta/apps/apache24_php5/bin/apachectl start (code=exited, status=0/SUCCESS)
    Process: 4178350 ExecStop=/bluesanta/apps/apache24_php5/bin/apachectl stop (code=exited, status=0/SUCCESS)
 
11월 26 01:05:48 Kubuntu systemd[1]: Starting The Apache HTTP Server(PHP5)...
11월 26 01:05:49 Kubuntu apachectl[4178337]: httpd (pid 1179212) already running
11월 26 01:05:49 Kubuntu systemd[1]: apache2_php5.service: Succeeded.
11월 26 01:05:49 Kubuntu systemd[1]: Started The Apache HTTP Server(PHP5).

댓글을 달아 주세요

Ubuntu 20.04 : Apache 웹서버 컴파일 설치

Programming/Apache, PHP 2020. 11. 18. 22:48 Posted by 파란크리스마스

출처

필수 라이브러리 설치

$ sudo apt install libexpat1-dev

PCRE 설치

pi@Kubuntu:/bluesanta/apps$ wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
pi@Kubuntu:/bluesanta/apps$ tar xvfz pcre-8.44.tar.gz
pi@Kubuntu:/bluesanta/apps$ cd pcre-8.44/
pi@Kubuntu:/bluesanta/apps/pcre-8.44$ ./configure --prefix=/usr/local/pcre-8.44
pi@Kubuntu:/bluesanta/apps/pcre-8.44$ make
pi@Kubuntu:/bluesanta/apps/pcre-8.44$ sudo make install

Apache 웹서버 컴파일 & 설치

pi@Kubuntu:~$ cd /bluesanta/apps
pi@Kubuntu:/bluesanta/apps$ wget https://downloads.apache.org//httpd/httpd-2.4.46.tar.gz
pi@Kubuntu:/bluesanta/apps$ tar xvfz httpd-2.4.46.tar.gz
pi@Kubuntu:/bluesanta/apps$ cd httpd-2.4.46/
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46$ cd srclib
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ wget https://archive.apache.org/dist/apr/apr-1.7.0.tar.gz
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ tar xvfz apr-1.7.0.tar.gz
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ mv apr-1.7.0 apr
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ wget https://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ tar xvfz apr-util-1.6.1.tar.gz
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ mv apr-util-1.6.1 apr-util
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ tar xvfz pcre-8.44.tar.gz
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46/srclib$ mv pcre-8.44 pcre
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46$ cd ..
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46$ ./configure --prefix=/bluesanta/apps/apache24 --with-pcre=/usr/local/pcre-8.44 --enable-cgi --enable-info --enable-deflate --enable-ssl --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-ftp --enable-expires --enable-headers --enable-rewrite --enable-so --with-included-apr --with-included-apr-util --with-included-pcre
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46$ make
pi@Kubuntu:/bluesanta/apps/httpd-2.4.46$ make install

Apache 웹서버 환경 설정

pi@Kubuntu:/bluesanta/apps/apache24$ cd conf
pi@Kubuntu:/bluesanta/apps/apache24/conf$ vi httpd.conf

ServerName 주석을 풀고 localhost로 설정

#ServerName www.example.com:80
ServerName localhost

서비스 등록 파일 apache2.service 생성

pi@Kubuntu:~$ cd /bluesanta/apps/apache24/bin/
pi@Kubuntu:/bluesanta/apps/apache24/bin$ vi apache2.service

apache2.service 내용

[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=https://httpd.apache.org/docs/2.4/

[Service]
Type=forking
Environment=APACHE_STARTED_BY_SYSTEMD=true
ExecStart=/bluesanta/apps/apache24/bin/apachectl start
ExecStop=/bluesanta/apps/apache24/bin/apachectl stop
ExecReload=/bluesanta/apps/apache24/bin/apachectl graceful
PrivateTmp=true
Restart=on-abort

[Install]
WantedBy=multi-user.target

apache2.service 파일 /etc/systemd/system 디렉토리에 복사

pi@Kubuntu:/bluesanta/apps/apache24/bin$ chmod +x apache2.service
pi@Kubuntu:/bluesanta/apps$ sudo cp apache2.service /etc/systemd/system

Apache 서비스 등록

pi@Kubuntu:/bluesanta/apps/apache24/bin$ sudo systemctl enable apache2
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /etc/systemd/system/apache2.service.

Apache 서비스 실행

pi@Kubuntu:/bluesanta/apps/apache24/bin$ sudo systemctl start apache2

Apache 서비스 상태 확인

$ sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/etc/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2020-11-19 00:06:39 KST; 3s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 154499 ExecStart=/bluesanta/apps/apache24/bin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 154519 (httpd)
      Tasks: 82 (limit: 18693)
     Memory: 6.9M
     CGroup: /system.slice/apache2.service
             ├─154519 /bluesanta/apps/apache24/bin/httpd -k start
             ├─154520 /bluesanta/apps/apache24/bin/httpd -k start
             ├─154521 /bluesanta/apps/apache24/bin/httpd -k start
             └─154522 /bluesanta/apps/apache24/bin/httpd -k start
 
11월 19 00:06:39 Kubuntu systemd[1]: Starting The Apache HTTP Server...
11월 19 00:06:39 Kubuntu systemd[1]: Started The Apache HTTP Server.



Apache 웹서버 컴파일 참조 라이브러리 설치

srclib 디렉토리 사용전에 사용했던 것으로 불필요 - 나중에 참고용으로 남겨둠

apr 라이브러리 설치

pi@Kubuntu:/bluesanta/apps$ wget https://archive.apache.org/dist/apr/apr-1.7.0.tar.gz
pi@Kubuntu:/bluesanta/apps$ tar xvfz apr-1.7.0.tar.gz
pi@Kubuntu:/bluesanta/apps$ cd apr-1.7.0/
pi@Kubuntu:/bluesanta/apps/apr-1.7.0$ ./configure
pi@Kubuntu:/bluesanta/apps/apr-1.7.0$ make
pi@Kubuntu:/bluesanta/apps/apr-1.7.0$ sudo make install
 
... 생략 ...
 
----------------------------------------------------------------------
/usr/bin/install -c -m 644 apr.exp /usr/local/apr/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /usr/local/apr/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \
    if test -f ${f}; then /usr/bin/install -c -m 755 ${f} /usr/local/apr/build-1; fi; \
done
/usr/bin/install -c -m 755 /bluesanta/apps/apr-1.7.0/build/mkdir.sh /usr/local/apr/build-1
for f in make_exports.awk make_var_export.awk; do \
    /usr/bin/install -c -m 644 /bluesanta/apps/apr-1.7.0/build/${f} /usr/local/apr/build-1; \
done
/usr/bin/install -c -m 644 build/apr_rules.out /usr/local/apr/build-1/apr_rules.mk
/usr/bin/install -c -m 755 apr-config.out /usr/local/apr/bin/apr-1-config

apr-util 라이브러리 설치

pi@Kubuntu:/bluesanta/apps$ wget https://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz
pi@Kubuntu:/bluesanta/apps$ tar xvfz apr-util-1.6.1.tar.gz
pi@Kubuntu:/bluesanta/apps$ cd apr-util-1.6.1/
pi@Kubuntu:/bluesanta/apps/apr-util-1.6.1$ ./configure -with-apr=/usr/local/apr
pi@Kubuntu:/bluesanta/apps/apr-util-1.6.1$ make
pi@Kubuntu:/bluesanta/apps/apr-util-1.6.1$ sudo make install
 
... 생략 ...
 
----------------------------------------------------------------------
/usr/bin/install -c -m 644 aprutil.exp /usr/local/apr/lib
/usr/bin/install -c -m 755 apu-config.out /usr/local/apr/bin/apu-1-config

댓글을 달아 주세요

Ubuntu 20.04 : Tomcat 서비스 등록

Programming/Java 2020. 11. 14. 13:25 Posted by 파란크리스마스

출처

tomcat 설치

pi@Kubuntu:~$ cd /bluesanta/apps
pi@Kubuntu:/bluesanta/apps$ wget https://downloads.apache.org/tomcat/tomcat-8/v8.5.59/bin/apache-tomcat-8.5.59.tar.gz
pi@Kubuntu:/bluesanta/apps$ tar xvfz apache-tomcat-8.5.59.tar.gz

tomcat /opt 디렉토리에 소프트 링크 걸기

pi@Kubuntu:/bluesanta/apps$ sudo ln -s /bluesanta/apps/apache-tomcat-8.5.59 /opt/apache-tomcat-8.5.59

서비스 등록 파일 tomcat.service 생성

pi@Kubuntu:/bluesanta/apps$ cd /etc/systemd/system
pi@Kubuntu:/etc/systemd/system$ sudo vi /etc/systemd/system/tomcat.service

tomcat.service 내용

[Unit]
Description=tomcat 8
After=network.target syslog.target

[Service]
Type=forking
Environment="JAVA_HOME=/opt/jdk1.8.0_271"
User=root
Group=root
ExecStart=/opt/apache-tomcat-8.5.59/bin/startup.sh
ExecStop=/opt/apache-tomcat-8.5.59/bin/shutdown.sh

[Install]
WantedBy=multi-user.target

tomcat 서비스 등록

pi@Kubuntu:/etc/systemd/system$ sudo systemctl enable tomcat.service
Created symlink /etc/systemd/system/multi-user.target.wants/tomcat.service → /etc/systemd/system/tomcat.service.

tomcat 서비스 실행

pi@Kubuntu:/etc/systemd/system$ sudo systemctl start tomcat.service

tomcat 서비스 상태 확인

pi@Kubuntu:/etc/systemd/system$ sudo systemctl status tomcat.service
● tomcat.service - tomcat 8
     Loaded: loaded (/etc/systemd/system/tomcat.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2020-11-14 14:27:13 KST; 39s ago
    Process: 103228 ExecStart=/opt/apache-tomcat-8.5.59/bin/startup.sh (code=exited, status=0/SUCCESS)
   Main PID: 103256 (java)
      Tasks: 33 (limit: 18694)
     Memory: 119.5M
     CGroup: /system.slice/tomcat.service
             └─103256 /usr/bin/java -Djava.util.logging.config.file=/opt/apache-tomcat-8.5.59/conf/logging.properties -Djava.util.logging.manager=org.ap>

11월 14 14:27:13 Kubuntu systemd[1]: Starting tomcat 8...
11월 14 14:27:13 Kubuntu startup.sh[103228]: Tomcat started.
11월 14 14:27:13 Kubuntu systemd[1]: Started tomcat 8.

댓글을 달아 주세요

Apache 2.4 : phpMyAdmin 설치

Programming/Apache, PHP 2020. 11. 11. 02:19 Posted by 파란크리스마스

출처

1. 다운로드

phpMyAdmin에서 phpMyAdmin-5.0.4-all-languages.zip 파일 다운로드

2. 압축풀기

phpMyAdmin-5.0.4-all-languages.zip 압축파일을 C:\usr\local\phpMyAdmin-5.0.4-all-languages 폴더에 압축 해제

3. config.inc.php 파일 생성

C:\usr\local\phpMyAdmin-5.0.4-all-languages\config.sample.inc.php 파일을 config.inc.php로 복사

4. 환경파일 수정(config.inc.php)

/**
 * This is needed for cookie based authentication to encrypt password in
 * cookie. Needs to be 32 chars long.
 */
$cfg['blowfish_secret'] = 'gNsWq$%#%$#%EDFSsffsegbVp6LCJw6w'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/**
 * Servers configuration
 */
$i = 0;

/**
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
// $cfg['Servers'][$i]['user'] = 'root';

5. httpd.conf 가상폴더 추가

Tomcat 연동이 없는 경우

Alias /mysql "C:/usr/local/phpMyAdmin-5.0.4-all-languages"

<Directory "C:/usr/local/phpMyAdmin-5.0.4-all-languages">
    Options FollowSymLinks
    DirectoryIndex index.html index.htm index.php *.jsp *.php
    Order allow,deny
    Allow from all
</Directory>

Tomcat 연동의 경우

# Tomcat 연동
<IfModule jk_module>
    JkWorkersFile    conf/workers.properties
    JkLogFile        logs/mod_jk.log
    JkLogLevel       info
    JkMount /* 	load_balancer
</IfModule>

AddDefaultCharset Off 

# phpMyAdmin
<VirtualHost *:80>
    ServerAdmin admin@phpmyadmin.abc.kr
    DocumentRoot "C:/usr/local/phpMyAdmin-5.0.4-all-languages"
    ServerName localhost
#    ServerAlias /mysql
#    DirectoryIndex index.php
    Alias /mysql "C:/usr/local/phpMyAdmin-5.0.4-all-languages"

    <Directory "C:/usr/local/phpMyAdmin-5.0.4-all-languages">
        AllowOverride ALL
        Options FollowSymLinks MultiViews
        DirectoryIndex index.html index.htm index.php *.jsp *.php
        Require all granted
    </Directory>
    
</VirtualHost>

6. php.ini 수정

; When the extension library to load is not located in the default extension
; directory, You may specify an absolute path to the library file:
;
;   extension=/path/to/extension/mysqli.so
extension=php_mysqli.dll
;extension=mbstring
extension=php_mbstring.dll
;extension=pdo_mysql
extension=php_pdo_mysql.dll

댓글을 달아 주세요

출처

RSA 개인키를 생성

$ openssl genrsa -out private.key 2048
Generating RSA private key, 2048 bit long modulus
....................................+++++
..........+++++
e is 65537 (0x10001)

RSA 개인키를 이용해서 RSA 공개키를 생성

$ openssl rsa -in private.key -pubout -out public.key
writing RSA key

CSR(인증요청서) 생성

$ openssl req -new -key private.key -out private.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:KR
State or Province Name (full name) [Some-State]:_
Locality Name (eg, city) []:Seoul
Organization Name (eg, company) [Internet Widgits Pty Ltd]:bluexmas
Organizational Unit Name (eg, section) []:root CA
Common Name (e.g. server FQDN or YOUR name) []:test.iptime.org
Email Address []:test@test.com
 
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:test
An optional company name []:test

CRT(인증서)만들기

CA 역할을 할 CA 대칭키 생성

$ openssl genrsa -aes256 -out rootCA.key 2048
Generating RSA private key, 2048 bit long modulus
..................................................+++++
....................+++++
e is 65537 (0x10001)
Enter pass phrase for rootCA.key:test
Verifying - Enter pass phrase for rootCA.key:test

rootCA.key를 이용해서 rootCA.pem 생성

$ openssl req -x509 -new -nodes -key rootCA.key -days 2650 -out rootCA.pem
Enter pass phrase for rootCA.key:test
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:KR
State or Province Name (full name) [Some-State]:_
Locality Name (eg, city) []:Seoul
Organization Name (eg, company) [Internet Widgits Pty Ltd]:bluexmas
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:test
Email Address []:test

웹서버에 HTTPS적용을 위해 필요한 CRT 인증서를 생성

$ openssl x509 -req -in private.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out private.crt -days 3650        Signature ok
subject=/C=KR/ST=_/L=Seoul/O=bluexmas/OU=root CA/CN=lastxmas.iptime.org/emailAddress=test@test.com
Getting CA Private Key
Enter pass phrase for rootCA.key:test

C:\usr\local\Apache24\conf\httpd.conf

# Secure (SSL/TLS) connections
Include conf/httpd-ssl.conf

LoadModule rewrite_module modules/mod_rewrite.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so

C:\usr\local\Apache24\conf\httpd-ssl.conf

#
# When we also provide SSL we have to listen to the 
# standard HTTP port (see above) and to the HTTPS port
#
Listen 443

#   Pass Phrase Dialog:
#   Configure the pass phrase gathering process.
#   The filtering dialog program (`builtin' is an internal
#   terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog  builtin

#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism 
#   to use and second the expiring timeout (in seconds).
#SSLSessionCache         "dbm:c:/Apache24/logs/ssl_scache"
SSLSessionCache        "shmcb:C:/usr/local/Apache24/logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300

##
## SSL Virtual Host Context
##

<virtualhost _default_:443="">

#   General setup for the virtual host
# DocumentRoot "C:/usr/local/Apache24/htdocs"
DocumentRoot "C:/usr/local/Apache24/public_html"
ServerName www.example.com:443
ServerAdmin admin@example.com
ErrorLog "C:/usr/local/Apache24/logs/error.log"
TransferLog "C:/usr/local/Apache24/logs/access.log"

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#   Server Certificate:
#   Point SSLCertificateFile at a PEM encoded certificate.  If
#   the certificate is encrypted, then you will be prompted for a
#   pass phrase.  Note that a kill -HUP will prompt again.  Keep
#   in mind that if you have both an RSA and a DSA certificate you
#   can configure both in parallel (to also allow the use of DSA
#   ciphers, etc.)
#   Some ECC cipher suites (http://www.ietf.org/rfc/rfc4492.txt)
#   require an ECC certificate which can also be configured in
#   parallel.
SSLCertificateFile "C:/usr/local/Apache24/conf/private.crt"

#   Server Private Key:
#   If the key is not combined with the certificate, use this
#   directive to point at the key file.  Keep in mind that if
#   you've both a RSA and a DSA private key you can configure
#   both in parallel (to also allow the use of DSA ciphers, etc.)
#   ECC keys, when in use, can also be configured in parallel
SSLCertificateKeyFile "C:/usr/local/Apache24/conf/private.key"

댓글을 달아 주세요

Jenkins - Svn, Ant, Tomcat 원격 배포

Programming/Java 2020. 10. 29. 01:50 Posted by 파란크리스마스

출처

Subversion 플로그인 설치

Deploy to container 플로그인 설치

프로젝트 생성

[새로운 Item] 메뉴 선택

item name(프로젝트 이름) 설정, Freestyle project, [OK] 버튼 선택

Subversion 선택, URL 주소 설정, Svn 접속 계정 추가 

Svn 계정 설정, [Add] 버튼 선택

추가 Svn 주소가 있는 경우, [Add module] 버튼 선택

Subversion 선택, URL 주소 설정

Build에서 [Invoke Ant] 설정

Ant - Target과 빌드 파일 설정

빌드 후 조치(배포), [Deploy war/ear to a container] 선택

베포 웹서버 설정 

댓글을 달아 주세요

Tomcat 관리자 페이지 설정

Programming/Java 2020. 10. 29. 00:08 Posted by 파란크리스마스

출처

%TOMCAT_HOME%/conf/tomcat-users.xml

관리자 페이지는 manager-gui 권한의 활성화와 계정 정보가 설정되어야 사용이 가능하므로 %TOMCAT_HOME%/conf/tomcat-users.xml 파일을 열어서 아래와 같이 manager-gui 권한을 추가합니다.

<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
  <user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
  <user username="role1" password="<must-be-changed>" roles="role1"/>
-->
	
	<!-- manager-gui 권한 추가 -->
	<role rolename="manager-gui"/>
	<role rolename="manager-script"/>
	<role rolename="manager-status"/>
	<user username="admin" password="admin" roles="manager-gui,manager-script,manager-status"/>
</tomcat-users>

관리자 페이지 접속

관리자 암호를 설정하고 [로그인] 버튼 선택

관리자 페이지

댓글을 달아 주세요

Jenkins 설치

Programming/Java 2020. 10. 13. 01:11 Posted by 파란크리스마스

출처

Jenkins war 다운로드

Jenkins 사이트의 war 파일 다운로드

Jenkins war 복사

%TOMCAT_HOME%/warapps 폴더에 jenkins.war 파일 복사

Jenkins 접속

웹브라우져에서 https://localhost:8080/jenkins 접속

Unlock Jenkins

아래 경로에 비밀번호가 적힌 파일(initialAdminPassword)에 적힌 비밀번호를 확인 후 비밀번호를 입력하고, [Continue] 버튼 선택

플로그인 설치

[Install suggested plugins] 선택하고 설치 - 나중에 플러그인을 추가, 삭제 가능

플러그인 설치 과정

사용자 추가

Jenkins URL 정의

Jenkins 실행

Jenkins 설치 관료후 메인 화면

댓글을 달아 주세요

Swift4 tip 2

Programming/Swift 2019. 12. 17. 13:49 Posted by 파란크리스마스

출처

UITableView 초기화

class MainViewController: UIViewController {
    
    override func loadView() {
        super.loadView();
        
        self.initWebView(activityIndicator: self.activityIndicator1)
        self.setUrl(hostUrl: MainViewController.url_archim_host, baseUrl: MainViewController.url_archim_base, appUrl: url_archim)
        
        let appDelegate = UIApplication.shared.delegate as! AppDelegate
        //appDelegate.viewController = self
        
        //current_orientation = UIInterfaceOrientationMask.Portrait
        
        // 배경색
        self.navigationController?.navigationBar.barTintColor = UIColor.white
        /*
        // 중앙타이틀
        self.navigationController?.navigationBar.topItem?.title = "중앙타이틀"
        // 좌우 글자색
        self.navigationController?.navigationBar.tintColor = UIColor.red
        // 왼쪽 타이틀
        self.navigationItem.leftBarButtonItem?.title = "왼쪽메뉴"
        */
        
        /*
        // titleView로 사용할 Label을 생성
        var frame = CGRect(x: 0, y: 0, width: 200, height: 21)
        let label = UILabel(frame: frame)
        label.text = "이것을 타이틀로 사용합니다"
        // viewController의 titleView를 생성한 Label로 셋업
        self.navigationController?.navigationBar.topItem?.titleView = label
        */
        
        // 중앙
        // let logo = UIImage(named: "main_logo.png")
        let logo = Utiltiy.resizeImage(image: UIImage(named: "main_logo.png")!, targetSize: CGSize(width: 140, height: 32))
        let imageView = UIImageView(image: logo)
        self.navigationItem.titleView = imageView
        
        //
        let leftBarItemImage = Utiltiy.resizeImage(image: UIImage(named: "main_gnb.png")!, targetSize: CGSize(width: 50, height: 50))
        self.navigationItem.leftBarButtonItem?.tintColor = UIColor(rgb: 0x636363)
        self.navigationItem.leftBarButtonItem?.image = leftBarItemImage;
        self.navigationItem.leftBarButtonItem?.imageInsets = UIEdgeInsets(top: 0, left: -18, bottom: 0, right: 0)
        
        //
        let rightBarItemImage = Utiltiy.resizeImage(image: UIImage(named: "main_list.png")!, targetSize: CGSize(width: 50, height: 50))
        self.navigationItem.rightBarButtonItem?.tintColor = UIColor(rgb: 0x636363)
        self.navigationItem.rightBarButtonItem?.image = rightBarItemImage;
        self.navigationItem.rightBarButtonItem?.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: -18)
 
        /*
        // setTitlePositionAdjustment 함수 호출
        self.navigationItem.leftBarButtonItem?.setTitlePositionAdjustment(UIOffset(horizontal: 30, vertical: 30), for: UIBarMetrics.compact)
        */
        
        /*
        // UIBarButtonItem 추가
        // http://mtsparrow.blogspot.com/2016/01/blog-post.html
        let leftTarget = self.navigationItem.leftBarButtonItem?.target
        let leftAction = self.navigationItem.leftBarButtonItem?.action
        let leftButton = UIBarButtonItem(image: UIImage (named: "main_gnb.png"), style: UIBarButtonItem.Style.plain, target: leftTarget, action: leftAction)
        let negativeSpacer = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
        negativeSpacer.width = -16
        //self.navigationItem.leftBarButtonItem = logo2
        self.navigationItem.setLeftBarButtonItems([negativeSpacer, leftButton], animated: false)
        */
    }

UITableViewController - Row 선택

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        // 선택된 index 순서 출력
        // print(indexPath.row)
        
        let cell = super.tableView(tableView, cellForRowAt: indexPath) as! UITableViewVibrantCell
        
        if case cell.reuseIdentifier = "menu_quality" {
            let storyboard = UIStoryboard(name : "MainStoryboard_iPhone", bundle : nil)
            let nextViewController = storyboard.instantiateViewController(withIdentifier: "TabBarController") as! NiaspMainViewController
            self.present(nextViewController, animated: true, completion: nil)
        }
    }

uitableview에서 cell클릭시 다음 view로 데이터 넘기기

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        let vc = segue.destination as! infoPUBG_kind
        //vc.value2 = value
        let cell = sender as! UITableViewCell
        let indexPath = tableView.indexPath(for: cell)
        vc.kindTitle = infoList[(indexPath?.row)!]//내가누른 cell의 text
        vc.kindRow = (indexPath?.row)!//내가누른 cell의 row값
    }

SideMenu

SideMenuNavigationController.swift

@objcMembers
open class SideMenuNavigationController: UINavigationController {

SideMenuManager

@objcMembers public class SideMenuManager : NSObject {

    @objc public enum PresentDirection : Int {

        case left

        case right
    }

    /// Default instance of SideMenuManager.
    public static let `default`: SideMenu.SideMenuManager

    /// Default instance of SideMenuManager (objective-C).
    public class var defaultManager: SideMenu.SideMenuManager { get }

    /// The left menu.
    open var leftMenuNavigationController: SideMenu.SideMenuNavigationController?

    /// The right menu.
    open var rightMenuNavigationController: SideMenu.SideMenuNavigationController?

    /**
         Adds screen edge gestures for both left and right sides to a view to present a menu.
    
         - Parameter toView: The view to add gestures to.
    
         - Returns: The array of screen edge gestures added to `toView`.
         */
    public func addScreenEdgePanGesturesToPresent(toView view: UIView) -> [UIScreenEdgePanGestureRecognizer]

    /**
        Adds screen edge gestures to a view to present a menu.
        
        - Parameter toView: The view to add gestures to.
        - Parameter forMenu: The menu (left or right) you want to add a gesture for.
    
        - Returns: The screen edge gestures added to `toView`.
        */
    public func addScreenEdgePanGesturesToPresent(toView view: UIView, forMenu side: SideMenu.SideMenuManager.PresentDirection) -> UIScreenEdgePanGestureRecognizer

    /**
     Adds a pan edge gesture to a view to present menus.
     
     - Parameter toView: The view to add a pan gesture to.
     
     - Returns: The pan gesture added to `toView`.
     */
    public func addPanGestureToPresent(toView view: UIView) -> UIPanGestureRecognizer
}

extension SideMenuManager {

    @available(*, deprecated, renamed: "leftMenuNavigationController")
    open var menuLeftNavigationController: SideMenu.SideMenuNavigationController?

    @available(*, deprecated, renamed: "rightMenuNavigationController")
    open var menuRightNavigationController: SideMenu.SideMenuNavigationController?

SideMenu 버튼 클릭 이벤트

import SideMenu

class SideMenuTableViewController: UITableViewController {

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        print(indexPath.row)
        
        if case indexPath.row = 3 {
            //SettingsMainViewController *comChange = [[SettingsMainViewController alloc] init];
            //[self.navigationController pushViewController:comChange animated:NO];
            //var comChange : SettingsMainViewController
            
            /*
            let storyboard : UIStoryboard = self.storyboard!
            let nextView = storyboard.instantiateViewController(identifier: "MainStoryboard_iPhone")
            self.present(nextView, animated: true, completion: nil)
            */
            
            let storyboard = UIStoryboard(name : "MainStoryboard_iPhone", bundle : nil)
            let nextView = storyboard.instantiateInitialViewController()
            self.present(nextView!, animated: true, completion: nil)
        }
    }

SideMenuNavigationControllerDelegate

extension MainViewController: SideMenuNavigationControllerDelegate {
    
    func sideMenuWillAppear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Appearing! (animated: \(animated))")
    }
    
    func sideMenuDidAppear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Appeared! (animated: \(animated))")
    }
    
    func sideMenuWillDisappear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Disappearing! (animated: \(animated))")
    }
    
    func sideMenuDidDisappear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Disappeared! (animated: \(animated))")
    }
}

activeDelegate (SideMenuNavigationController.swift)

@objcMembers
open class SideMenuNavigationController: UINavigationController {

    /// Delegate for receiving appear and disappear related events. If `nil` the visible view controller that displays a `SideMenuNavigationController` automatically receives these events.
    public weak var sideMenuDelegate: SideMenuNavigationControllerDelegate?

... 생략 ...

private extension SideMenuNavigationController {

    weak var activeDelegate: SideMenuNavigationControllerDelegate? {
        guard !view.isHidden else { return nil }
        if let sideMenuDelegate = sideMenuDelegate { return sideMenuDelegate }
        return findViewController as? SideMenuNavigationControllerDelegate
    }

    var findViewController: UIViewController? {
        foundViewController = foundViewController ?? presentingViewController?.activeViewController
        return foundViewController
    }



댓글을 달아 주세요

Unity : 안드로이드 환경 설정

Programming/Unity3D 2019. 10. 22. 16:35 Posted by 파란크리스마스

안드로이드 환경 설정

메뉴 [Edit] > [Preferences...] 선택

Preferences 창의 [External Tools]에서 JDK, Android SDK, Android NDK 경로 설정 

안드로이드 빌드

메뉴 [File] > [Build Settings...] 선택

Scenes In Build 창의 [Android]에서 버튼[Build And Run] 선택해서 빌드및 설치

댓글을 달아 주세요

Docker 설치

Programming 2019. 10. 19. 05:27 Posted by 파란크리스마스

출처

Docker for Windows 다운로드

https://docs.docker.com/docker-for-windows/install/#download-docker-for-windows

Docker for Windows 설치

Docker for Windows 설치 프로그램 실행

[Install Update]버튼 선택

설치가 완료 되면 hosts 파일이 변경 됩니다.

Windows 하단 오른쪽 작업표시줄에서 Docker 아이콘을 오늘쪽 마우스를 눌러 팝업 메뉴에서 [Kitematic] 메뉴 선택

Kitematic가 설치 되어 있지 않으면 아래와 같이 다운로드 창에서 [Download] 버늩 선택

다운로드 받은 파일 Kitematic-Windows.zip 압축을 풀어서 C:\Program Files\Docker\Kitematic에 복사

다시 Kitematic를 실행해서 기존에 아이디가 있으면 로그인은 하거나 아이디가 없으면 [Sign Up]을 선택해서 계정을 생성

[ubuntu-upstart] 이미지의 [Create] 버튼을 선택해서 Ubuntu 생성

[EXEC] 버튼을 선택해서 Shell 실행




이미지 다운로드

docker run -it -p 6006:6006 -p 2222:22 -v "pwd":/Japanese-Character-Recognition -w /Japanese-Character-Recognition tensorflow/tensorflow:1.1.0 bash

Docker 파일 복사

PC에서 Host로 파일 복사

docker container cp D:/Data.OCR/ETL/ETL1.zip compassionate_perlman:/ETL1.zip

Host에서 PC로 파일 복사

docker container cp compassionate_perlman:/Japanese-Character-Recognition/Japanese-Character-Recognition/model.pb D:/Data.OCR/ETL/

댓글을 달아 주세요

[허교수의 ARM Mbed 프로그래밍 입문 리뷰] Mbed 책 리뷰

Programming 2019. 10. 13. 13:21 Posted by 파란크리스마스

[허교수의 ARM Mbed 프로그래밍 입문 리뷰] 이벤트로 도서를 받았습니다.


마이크로비트 오프라인 컴파일로 처음 Mbed를 접하게 되면서,

기초부터 배우고 싶었는데, 이 도서의 출판과 이벤트에 당첨되어 리뷰를 작성합니다.

Mbed의 기초(실행방법부터 컴파일, 설치까지)부터 각종 통신방법(디지탈I/O, 아두이노I/O, UART, I2C)과 각종 센서의 동작 원리와 작동 방법까지 자세히 설명되어 있어 기초부터 실정에 필요한 내용이 이 책하나에 다 있습니다.

기초부터 시작하시는 처음 배우시는 분도, 기존에 하셨분들도 필요한 부분만 찾아서 보셔도 챕터별로 정리가 잘되서 있어 좋은 책인것 같습니다.

이 책은 4단계로 나누어져서 설명이 되어 있는데,

1단계는 "Mbed소개"로 ARM프로세서의 소개 및 역사, Mbed가 지원하는 보드의 소개, Mbed의 컴파일과 누클레오 보드에 설치하는 방법이 나와있습니다.

2단계는 "기본 프로그래밍"에서는 MbedAPI, 디지털 I/O, UART 시리얼 통신, 아나로그, PWM 출력, SPI 통신, I2C 통신 방법이 원리부터 설명이 되어 있고,

3단계는 "주변장치 프로그래밍"에서는 블루투스, 로터리 인코더, 온습도 센서, 초음파 거리센서, 릴레이, 텍스트 LCD, RTC, DC모터 서보모터제어가,

4단계는 "고급 프로그래밍"에서는 RTOS-멀티스레드, 누클레오-우두이노 UART 통신이 설명 되어 있습니다.  

이 책에서 사용하는 누클레오 보드는 국내 쇼핑몰의 경우 외국에서 배송되는 것이라서 배송이 일주일정도 걸려서, 중고나라에서 1만원 주고 구입했습니다.

댓글을 달아 주세요