전체 글(84)
-
[CentOS] port open
vi /etc/sysconfig/iptables 3306 DB포트를 열어준다고 치면 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT 추가 service iptables restart 로 재시작
2013.06.26 -
db 생성 계정 생성
MySQL 접속 $ mysql -u root -p root 암호 초기화 mysql> UPDATE user SET password=password('new_password') WHERE user='root'; mysql> FLUSH privileges; 데이터베이스 선택 및 보기 mysql> USE mysql; mysql> SELECT Host, User, Password FROM user; 사용자 추가 - 서버 주소의 경우 localhost, %, 127.0.0.1 도 같이 처리해 줍니다. - 외부 접속은 'localhost' 대신에 '%' 를 사용합니다. mysql> INSERT INTO user (Host, User, Password) VALUES ('localhost', '유저명', password..
2013.06.26 -
[Linux] svn commit 시 자동 배포(checkout or update)하기
#수정파일 svnadmin로 만든 폴더에 hooks라는 폴더가있는데 그안에 post-commit.tmpl 라는 파일을 편집한다. commit할때 작동하는 스크립트당. 일단 파일명을 없앤다. /home/svn/shop/hooks/post-commit.tmpl mv post-commit.tmpl post-commit chmod 777 post-comimt 수정하고 파일을 열고 아래처럼 수정 그래도 쓰면 안됨. 경로가 다 저마다 틀리니까 알아서 수정하세요. #이건 잘 모르겠음. 기본으로 써있었던거;; REPOS="$1" REV="$2" #일단 소스파일과 svn경로를 변수로 선언. 그래야 편함;; SOURCE_PATH="/usr/local/apache/htdocs/shop" SVN_PATH="/home/svn/..
2013.06.26 -
CodeIgniter .htaccess 설정 예제
mod_rewrite 설치 AllowOverride None -> AllowOverride All RewriteEngine On RewriteBase / RewriteCond $1 !^(index\.php|images|captcha|data|include|uploads|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L]
2013.06.26 -
[Linux] 리눅스 서버 상태 파악하기
서버의 cpu 부하 상태 확인 - 서버의 반응이 늦을 때 프로세스 상태 점검 - 부하 원인 발견 네트워크 상태 점검 - 부정한 엑세스 감시, 설정 확인 네트워크 카드 점검 - 이더넷의 상태, 카드 설정 확인 디스크 상태 - 용량 확인 로그 - 서버 작동에 문제가 있을 시 확인 ### 서버의 cpu 부하 확인 명령어 – w / top / uptime uptime 12:47pm up 3 days, 12:22, 3 users, load average: 1.21, 0.86, 0.44 부하 점검 1.21(최근 1분간의 평균) 0.86(최근 5분간의 평균) 0.44(최근 15분간의 평균) 리눅스에서 cpu의 부하는 이 load average라는수치를 표준으로 한다. 이는 cpu를 필요로 하고 있는(ps명령어로 ST..
2013.06.26 -
[Linux] svn hook post-commit
Warning : COMMIT_FILENAME_NO_TRUNK !!!!!!!!!!!!!!!!! ===================================================== if [ $# != 2 ]; then echo "Usage: $0 " exit 1 fi REPOS="$1" REV="$2" WEB_DIR="/home/lod/" GUID="lod:lod" RESULT_TMP=$(svnlook changed -r ${REV} ${REPOS} | awk '{print $1$2}') echo $RESULT_TMP >> /tmp/tmp_file if [ -z $RESULT_TMP ]; then exit 1 fi for RESULT in $RESULT_TMP do COMMIT_STATUS=$..
2013.06.26