- 저장소 받아오기(Clone)
git clone "URL" - 최신 HEAD 내용 가져오기
git pull - 로컬 저장소 최신(HEAD)로 되돌리기
git reset --hard HEAD
2015년 9월 30일 수요일
GIT 사용법
2015년 9월 25일 금요일
2015년 9월 23일 수요일
MySQL - MySQL WorkBench 사용법
- SQL Query 시 delete, insert, update 안되는 경우에는 아래와 같은 처리 필요
- Query 문 가장 앞에 Safe_Updates 비활성화 필요
- SET SQL_SAFE_UPDATES = 0;
아마존 웹 서비스 구축시 참고사항
- EC2 instance 생성 + EC2용 Security Group 생성 및 instance의 attach
- RDS instance 생성 + RDS용 Security Group 생성 및 instance의 attach
- 외부에서 접속할려면 Security Group의 InBound의 anywhere로 설정 필요
- EC2의 LAMP 설치. 이때 RDS를 사용하면 MySQL은 설치안해도 되었습니다.
- https (SSL) 설치
- 자습서: SSL/TLS를 사용하여 Amazon Linux에서 Apache 웹 서버 구성 (아마존 제공)
- 인증서 만들기
- 인증서 구성
- Configuring SSL on Single Instances of PHP 5.3, PHP 5.4, and PHP 5.5
- Installing SSL on AWS EC2
- 시간 변경
- /etc/php.ini 열기
- timezone 변경
[date]
date.timezone="Asia/Seoul" - Linux OS 시간 동기화
- 참고
- 파일 쓰기 : 해당 폴더에 권한 설정 필수
- 쓰기 권한 QnA
- 웹서비스를 위한 퍼미션 문제
- 아파치가 접속시 사용되는 유저와 그룹 위치
httpd.conf
--------------------------------
User nobody
Group nobody
-------------------------------- - 암화 모듈
- mcrypt : 추가 설치 필요
- 설치
- 자습서: Amazon LinuxLAMP 웹 서버 설치 : 전 여기서 MySQL은 미설치
- 아마존 웹서비스 – 서버 구축
- 아마존 웹서비스 : 여기 잘되어 있음. 많은 도움이 되었음
- RDS 연결
2015년 9월 19일 토요일
2015년 9월 18일 금요일
리눅스 웹 서버 설치
- Ubuntu
- 우분투 14.04 서버 세팅하기 (Virtual Box)
- Ubuntu 서버 14.04에 LEMP 스택 설치하기 (Nginx, MySQL, PHP)
- Azure에서 Linux 가상 컴퓨터에 LAMP 스택 설치
여러 OS에서 설치 방법을 간략하게 설명되어 있습니다. - CentOS
- VirtualBox에서 centos7 설치
- 네트워크 활성화 : root 계정으로 해야함
- ip a // 네트워크 아답터 보기
- ping 168.126.63.1 // ping 테스트
- cd /etc // etc 폴더로 이동
- find -type f -name "*enp0s3" // 아답터 파일 찾기
- cd /etc/sysconfig/network-scripts // 아답터 파일 위치로 이동
- vi ifcfg-enp0s3 // 아답터 파일 편집
- ONBOOT=no // yes로 변경
- service network stop // 네트워크 서비스 재시작
- service network start
- ping 168.126.63.1 // pint 테스트
- 3번째 아답터도 위와 동일하게 변경
- 네트워크 수동 설정
- OS update
- yum update
- 개발 도구 설치(설치 항목)
- yum groupinstall "development tools"
- VirtualBox Guest Plugin 설치 : VirtualBox에서 실행에 느린 부분을 속도를 높여주는 기능
- 현재 실행된 VirtualBox 메뉴 -> 장치 -> "게스트 확장 CD 삽입" 선택
- mkdir cdrom // 이곳에 게스트 확장 CD를 mount 할것입니다.
- mount /dev/sr0 cdrom
- cd cdrom
- ./VBoxLinuxAdditions.run // 확장 설치 실행
- yum install kernel-devel-3.10.0-123.el7.x86_64 // 위 설치시 커널을 변경하므로 개발커널을 추가해야 한다는 Failed 문구가 있음. 버전별로 틀리니 failed 문구에서 요구하는 커널 설치
- ./VBoxLinuxAdditions.run // 다시 활장 설치 실행
- putty ssh 설정
- putty 설치 후 접속 가능
- LAMP 설치
- Install Apache, PHP And MySQL On CentOS 7 (LAMP)
- Installing VirtualBox In CentOS 7 Headless Server With Support for phpVirtualBox
- MySQL 만 설치
- 최신 버전의 MySQL 설치
- 초기 mysql root 패스워드 설정 및 비번 변경과 root 비번 잃어버렸을 경우
- [CentOS7] MySQL 설치 및 설정
- 설치 오류
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) : 저는 서비스로 다시 실행하면 해결되었습니다.
- 외부 MySQL 사용 설정
- 리눅스 : setsebool -P httpd_can_network_connect 1
- 참고
- CentOS 7 방화벽
- 네트워크 수동 설정
- CentOS에서 실행중인 아파치에서 DB로 연결이 안될때
그리고 가급적 mysql*() 보다는 PDO를 이용하는게 보안 및 호환성에도 좋다
PHP 7에서는 mysql*() 없어짐. mysqli*()는 사용 가능함 - 시간 동기화
- SSH
- 참고
- 파일 쓰기 : 해당 폴더에 권한 설정 필수
- 쓰기 권한 QnA
- 웹서비스를 위한 퍼미션 문제
- 아파치가 접속시 사용되는 유저와 그룹 위치
httpd.conf
--------------------------------
User nobody
Group nobody
-------------------------------- - 암화 모듈
- mcrypt : 추가 설치 필요
- cache 서버
- Redis 사용
- Redis install on CentOS 7/6
- RHEL/CentOS 에서 PHP 로 redis 연계 하기
# webtatic 저장소에서 PHP-5.4를 설치할 경우yuminstallphp54w-pecl-redis --enablerepo=webtatic## PHP 5.5yuminstallphp55w-pecl-redis --enablerepo=webtatic
- Apache2 restart 오류시 해결 방법
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message. new version of apache2 you just following command like this:
sudo nano /etc/apache2/apache2.conf
Add the following new line end of file: ServerName localhost
Then restart apache2: sudo nano service apache restart
It's done.
2015년 9월 16일 수요일
PHP 암호화/복호화
- 참고
- MySQL의 Aes_encrypt / Aes_decrypt와 호환되는 Python/ Php 구현
- 64진수로 암호화하는 base64 함수
- PHP에서 AES-256과 HMAC을 사용하여 문자열을 암호화하고 위변조를 방지하는 법
- 암호화 사용시 뒤에 쓰레기값이 찍는 문제 발생했음(2015-09-16). 내가 뭘 잘못했나??
- mcrypt_encrypt
2015년 9월 14일 월요일
Apache Server SSL 설정
Apache 설정을 아래와 같이 수정합니다.
파일은 httpd.conf 입니다.
파일은 httpd.conf 입니다.
- 참고
- 리눅스 개인서명 SSL 인증서 생성 : Linux + Apache 환경에서 Self-Signed 인증서 생성하고 SSL 구성하기
- 아파치 환경에서의 SSL 구성하기
- openssl CA 및 인증서 생성하기
- SSL/TLS 기본
- 테스트 페이지
웹서버 openssl로 인증서 만들기
c:/openssl/bin>openssl req -config d:\apache\server\conf\openssl.cnf -new -out server.csr -keyout server.pem
Loading 'screen' into random state - done
Generating a 1024 bit RSA private key
...............++++++
................++++++
writing new private key to 'server.pem'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
phrase is too short, needs to be at least 4 chars
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]:Seoul
Locality Name (eg, city) []:Seoul
Organization Name (eg, company) [Internet Widgits Pty Ltd]:jyblues
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:jyblues.blogspot.kr
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
c:/openssl/bin>openssl rsa -in server.pem -out server.key
Enter pass phrase for server.pem:
writing RSA key
c:/openssl/bin>openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
Loading 'screen' into random state - done
Signature ok
subject=/C=KR/ST=Seoul/L=Seoul/O=jyblues/CN=jyblues.blogspot.kr
Getting Private key
unable to write 'random state'
Loading 'screen' into random state - done
Generating a 1024 bit RSA private key
...............++++++
................++++++
writing new private key to 'server.pem'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
phrase is too short, needs to be at least 4 chars
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]:Seoul
Locality Name (eg, city) []:Seoul
Organization Name (eg, company) [Internet Widgits Pty Ltd]:jyblues
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:jyblues.blogspot.kr
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
c:/openssl/bin>openssl rsa -in server.pem -out server.key
Enter pass phrase for server.pem:
writing RSA key
c:/openssl/bin>openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
Loading 'screen' into random state - done
Signature ok
subject=/C=KR/ST=Seoul/L=Seoul/O=jyblues/CN=jyblues.blogspot.kr
Getting Private key
unable to write 'random state'
2015년 9월 9일 수요일
2015년 9월 8일 화요일
2015년 9월 7일 월요일
김용환 블로그 :: R 개발 후기
R과 일래스틱서치를 이용하여 데이터의 검색 랭킹 시스템을 구현해보았다.
R 공부를 책으로 하지 않고, 그냥 부딪히면서 (HEAD FIRST R Language) 개발 후기 경험담을 적는다...
... (생략) ...
김용환 블로그 :: R 개발 후기
2015년 9월 4일 금요일
피드 구독하기:
덧글 (Atom)
사람의 마음을 얻는 심리학 5가지 원칙 – 인간관계가 좋아지는 과학적인 방법
사람과 사람 사이의 관계는 단순해 보이지만 실제로는 매우 섬세하고 복잡합니다. 우리는 누구나 좋은 인간관계를 원합니다. 직장에서는 협력적인 관계를 만들고 싶고, 일상에서는 신뢰할 수 있는 사람들과 가까워지고 싶어 합니다. 그래서 많...
-
원본으로 이동 소요유 (2002-09-26 09:02:19) 흠~ 그 동네에서도 나오는 모양이군요. 입체각을 이해하기 위해서는 빛을 예로드는 것이 편리합니다. 랜턴을 안개낀 날 밤에 비추면 빛의 세기는 거리에 따라 제곱분에 일로 ...
-
이번에 웹 프로젝트 진행하면 느끼는건 웹 최적화는 상당히 중요한것 같다. 아래는 웹 최적화 정리를 잘 해 놓은 블로그이다. https://black7375.tistory.com/72
-
[NDC 16] 로그 조회가 불가능하다? 넥슨의 중국게임 운영툴 연동기