프로그램 사용/wiki2017. 1. 9. 14:55

미디어위키 db구조 보려고 하는데

어라 설치중이라 로고가 다른가? ㅋ


아무튼 설치하려는데 개체 캐싱을 활성화 못하다는 에러와

유니코드 정규화 어쩌구 하길래 삽질을 해보니

두개 패키지를 설치하면 되는 듯 하다.

$ sudo apt-get install xcache php5-intl  



+

Xcache의 영향인가..


LocalSetting.php 에서 CACHE_ACCEL을 CACHE_ANYTHING로 바꾸어주면 로그인은 된다..

다만, 로그인 이미되어 있다고 이상 작동을 할뿐?

 69 ## Shared memory settings

 70 #$wgMainCacheType = CACHE_ACCEL;

 71 $wgMainCacheType = CACHE_ANYTHING;

 72 $wgMemCachedServers = [];

[링크 : https://www.mediawiki.org/wiki/Manual:$wgSessionCacheType]

  [링크 : http://stackoverflow.com/.../cant-log-in-to-mediawiki-canceled-as-a-precaution-against-session-hijacking]


+ 테이블 전부가 UTF-8 encoding이라는데. 그거 영향인가?

[링크 : https://www.mediawiki.org/wiki/Manual:$wgDBmysql5]


일단 테이블 자체는 binary 정렬방식이고 user_name은 varbinary(255)


user_name은.. 16진수로 써있지만 Minimonk 로 첫자가 대문자로 입력되어 있다.


---

$ sudo apt-cache search xcache

php-horde-cache - Horde Caching API

php5-xcache - Fast, stable PHP opcode cacher 


$ sudo apt-get install php5-intl 

[링크 : https://ibeblog.com/2013/01/21/installing-pecl-intl-ubuntu-12-04/]


$ sudo apt-cache search pecl | grep -i pecl

dh-make-php - Creates Debian source packages for PHP PEAR and PECL extensions

dh-php5 - debhelper add-on to handle PHP PECL extensions

libghc-byteable-dev - typeclass for byte sequences

libghc-byteable-doc - typeclass for byte sequences; documentation

libghc-byteable-prof - typeclass for byte sequences; profiling libraries

libghc-chunked-data-dev - typeclasses for dealing with various chunked data representations

libghc-chunked-data-doc - typeclasses for dealing with various chunked data representations; documentation

libghc-chunked-data-prof - typeclasses for dealing with various chunked data representations; profiling libraries

libghc-classy-prelude-dev - typeclass-based prelude

libghc-classy-prelude-doc - typeclass-based prelude; documentation

libghc-classy-prelude-prof - typeclass-based prelude; profiling libraries

libghc-convertible-dev - Typeclasses and instances for converting between types, GHC package

libghc-convertible-doc - Typeclasses and instances for converting between types, documentation

libghc-convertible-prof - Typeclasses and instances for converting between types, GHC profiling package

libghc-convertible-text-doc - typeclasses and instances for converting between types; documentation

libghc-mono-traversable-dev - typeclasses for mapping/folding/traversing monomorphic containers

libghc-mono-traversable-doc - typeclasses for mapping/folding/traversing monomorphic containers; documentation

libghc-mono-traversable-prof - typeclasses for mapping/folding/traversing monomorphic containers; profiling libraries

libghc-newtype-dev - A typeclass for working with newtypes

libghc-newtype-doc - A typeclass for working with newtypes; documentation

libghc-newtype-prof - A typeclass for working with newtypes; profiling libraries

libtarantool-php - PECL PHP driver for Tarantool/Box

php5-pecl-http - pecl_http module for PHP 5 Extended HTTP Support

php5-pecl-http-dev - pecl_http module for PHP 5 Extended HTTP Support development headers

php5-radius - PECL radius module for PHP 5

php5-remctl - PECL module for Kerberos-authenticated command execution 


$ sudo apt-get install php5-pecl-http php5-xcache

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

  php-pear php5-propro php5-raphf

Suggested packages:

  php5-dev

The following NEW packages will be installed:

  php-pear php5-pecl-http php5-propro php5-raphf php5-xcache

0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.

Need to get 486 kB of archives.

After this operation, 2,712 kB of additional disk space will be used.

Do you want to continue? [Y/n] 


[링크 : https://www.liquidweb.com/kb/how-to-install-xcache-on-ubuntu-14-04-lts/]

Posted by 구차니
Programming/php2017. 1. 9. 11:28


PHP 5.6.29 / 라즈베리 

echo의 short form인데.. 

short_open_tag 가 off되어도 작동이 되네.. 신기해라...


<?=$var?>

<?php echo$var?>

[링크 : http://php.net/manual/en/function.echo.php]

'Programming > php' 카테고리의 다른 글

php sprintf  (0) 2017.01.15
php array to table  (0) 2017.01.14
PHP 최적화 관련  (0) 2017.01.09
php 로그인 관련 - 세션  (0) 2017.01.06
php pack / unpack  (0) 2017.01.04
Posted by 구차니
Programming/php2017. 1. 9. 11:10

echo랑 print의 차이점 찾다가 여기까지 흘러옴 .. ㄷㄷㄷ

[링크 : http://php.net/manual/kr/function.print.php]

[링크 : http://php.net/manual/kr/function.echo.php]


[링크 : http://blog.bloodcat.com/186]

'Programming > php' 카테고리의 다른 글

php array to table  (0) 2017.01.14
php <?=$var>  (0) 2017.01.09
php 로그인 관련 - 세션  (0) 2017.01.06
php pack / unpack  (0) 2017.01.04
php foreach / array  (0) 2017.01.03
Posted by 구차니
개소리 왈왈2017. 1. 7. 20:45

먼저 떠나거 버린 대학교 후배

문득 생각이 나서 찾아 봤더니 벌써 11년이 구나


왔어.

왔어?


두개의 울림을 한번에 들려주었던 녀석.

그때 들었던 그 소리는 나만의 환청이었을까?


[링크 : http://www.dnc.go.kr/html/kr/part/part_0207.html]


그리고 영화를 보면서도 펑펑 울었었는데..

[링크 : http://movie.daum.net/moviedb/main?movieId=45413]

'개소리 왈왈' 카테고리의 다른 글

19대 대선 유권자 수  (0) 2017.05.09
잘 지내고 있냐 후배야  (2) 2017.04.06
경기가 안좋긴 하나보네  (0) 2016.12.10
이상하다 꿈을 꾼건가..  (0) 2016.05.14
딥마인드 - 알파고에 대한 생각  (0) 2016.03.09
Posted by 구차니

올 오랫만에 신작!!

맨날 초 고전만 주더니 조금은 신작을 주네



Posted by 구차니
Programming/php2017. 1. 6. 08:59

예제를 찾아보니 session_start()는 당연한건데..

$_SESSION 에서 사용하는 로그인 플래그 등을 없애는 식으로 로그아웃을 구현한것들도 보인다.

그냥 세션정보 자체를 파괴해버리면 간단하지 않을려나? 무슨 이유가 있을까?


[링크 : http://php.net/manual/kr/function.session-start.php]

[링크 : http://php.net/manual/kr/function.session-destroy.php]

'Programming > php' 카테고리의 다른 글

php <?=$var>  (0) 2017.01.09
PHP 최적화 관련  (0) 2017.01.09
php pack / unpack  (0) 2017.01.04
php foreach / array  (0) 2017.01.03
php "str"과 'str' 차이점  (2) 2017.01.03
Posted by 구차니

여기 문서를 참고해서 일단

가입 - 인증서 설치 - 로그인 - domain 인증 - 사이트 인증서 발급 함

[링크 : https://www.xetown.com/slope/135905]


발급과정에서 개인키 생성해서 웹에붙여 주어야 하는데 yourname.csr을 사용하고

개인키에 암호를 삭제한 yourname.nokey 파일을 생성

$ openssl req -newkey rsa:2048 -keyout yourname.key -out yourname.csr

Generating a 2048 bit RSA private key

.+++

.....................+++

writing new private key to 'yourname.key'

Enter PEM pass phrase:

Verifying - Enter PEM pass phrase:

-----

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) []:

Organization Name (eg, company) [Internet Widgits Pty Ltd]:

Organizational Unit Name (eg, section) []:

Common Name (e.g. server FQDN or YOUR name) []:

Email Address []:


Please enter the following 'extra' attributes

to be sent with your certificate request

A challenge password []:

An optional company name []:


그리고는 키를 없애고 키 저장소로 복사!

$ openssl rsa -in yourname.key -out yourname.nokey

Enter pass phrase for yourname.key:

writing RSA key

$ sudo cp yourname.nokey /etc/ssl/private/yourname.nokey 

[링크 : http://blog.acu.pe.kr/55]


그러면 zip파일로 다운받을 수 있는데

apache를 쓰고 있으니 해당 파일을 압축 풀어 /etc/ssl/certs 에 넣어 주었다.

$ unzip minimonk.net.zip

$ unzip ApacheServer.zip

$ sudo cp *.crt /etc/ssl/certs


일단 공식사이트에서는 이렇게 하라는데

SSLCertificateFile "/usr/local/apache2/conf/2_your_domain.crt"

SSLCertificateKeyFile "/usr/local/apache2/conf/private.key"

SSLCertificateChainFile "/usr/local/apache2/conf/1_root_bundle.crt" 

[링크 : https://www.startssl.com/Support?v=21]


나의 경우에는 이런식으로 설정

$ sudo vi /etc/apache2/sites-available/default-ssl.conf 

                SSLCertificateFile /etc/ssl/certs/2_your_domain.crt

                SSLCertificateKeyFile /etc/ssl/private/yourname.nokey

                SSLCertificateChainFile /etc/ssl/certs/1_root_bundle.crt


아무튼 라즈베리 키로 할때는 안전하지 않음이라고 크롬에서 뜨는데

starssl 에서 적용하니 이제 안전함! 우오오옹

class 1이라 그런가

은행권 처럼 녹색으로 줄이 쫙! 그이진 않네


---

처음 하라는대로 해보니 되긴한데 암호 넣으라고 한다. ㅠㅠ

그래서 키삭제 하는게 서비스 유지에는 편리!

$ sudo service apache2 restart

Enter passphrase for SSL/TLS keys for 127.0.1.1:443 (RSA): ******** 



어? 아이패드에서 (ios 10.2) 접속 자체를 안하는것 같다?!?!
[링크 : https://discussions.apple.com/thread/7791706?start=0&tstart=0]


Posted by 구차니

라즈베리 파이에서 매일매일 logrotate 하도록 하고

webalizer는 access.log.1 을 보도록 되어 있어서

logrotate를 안돌리면 webalizer 쪽이 갱신되지 않는 문제가 있다.


아무튼 몇일되는 바람에 .3 까지 생겨서

이렇게 하나로 묶어주고 실행해서 업데이트!

$ sudo su -

# cd /var/log/apache2

# cat access.log.3 access.log.2 access.log.1 access.log > access.log.all 

# rm access.log

# mv access.log.all access.log

# vi /etc/webalizer/webalizer.conf

LogFile /var/log/apache2/access.log

# webalizer


Posted by 구차니

예전 db 수업 시간에 들은거 같은데

결론은.. 다대다 관계를 지원하더라도 되도록이면 DB정규화를 통해

1:N이나 N:1으로 다대다 관계를 풀어서 쓰도록


[링크 : http://loopypapa.tistory.com/entry/SQL-일대일-일대다-다대다-관계]

[링크 : http://www.taeyo.net/Forum/Content.aspx?SEQ=22495&TBL=SQL&PGN=1330]

Posted by 구차니
Linux/Ubuntu2017. 1. 4. 15:11

일단.. crontab 파일이 바뀌면 자동으로 읽어 들이지만..

logrotate의 경우 는 crontab 파일에 있는게 아니니.. 다시 읽어 들이지 않으려나?

아니면 내가 설정을 잘못해서 apache 로그가 daily에서 monthly로 바꾼게 적용되지 않았던 걸까?


[링크 : http://stackoverflow.com/questions/10193788/restarting-cron-after-changing-crontab-file]

[링크 : http://unix.stackexchange.com/questions/116136/how-to-make-log-rotate-change-take-effect]


생각해 보니까.. /etc/cron.daily에 있으니 맨날 실행되겠...지? 설정이 monthly라도?

[링크 : http://blueskai.tistory.com/101]

Posted by 구차니