블로그 이미지
박공명

카테고리

분류 전체보기 (99)
된장 (7)
Dev (60)
꼐..꼐임 (6)
식탐 (18)
우리 (0)
Etc (8)
개인자료 (0)
Total
Today
Yesterday

일단 설치를 한다

 

apt-get install mysql-server mysql-client

 

설치중에 비밀번호를 입력한다.

설치후에 접속해서 기초적인 설정을 한다.

 

mysql -p

 

암호치고 

 

디비와 유저를 생성해준다.

 

mysql> create database gmproject;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| gmproject          |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.01 sec)

mysql> grant select,insert,update,delete,create,drop,alter on gmproject.* to 'pgmman'@'%' identified by '비밀';
Query OK, 0 rows affected (0.01 sec)

mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

 

exit로 종료하고

생성한 아뒤로 접속하면된다.

 

root@raspberrypi:/usr/local/apache-tomcat-6.0.37/webapps/web# mysql -u pgmman -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 51
Server version: 5.5.33-0+wheezy1 (Debian)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use gmproject
Database changed

 

자 나는 한단계 더가서

기존 사용하던 디비의 정보를 새로 설치한 서버에 옮기고싶다.

기존 윈도우 시스템에서 백업을 수행한다.

 

E:\APPLICATION\mysql-5.1.48\bin>mysqldump -uroot -p gmproject > gmproject.sql
Enter password: *******

E:\APPLICATION\mysql-5.1.48\bin>dir *.sql
 E 드라이브의 볼륨: MAIN_APP
 볼륨 일련 번호: F862-C7B4

 E:\APPLICATION\mysql-5.1.48\bin 디렉터리

2014-01-22  오후 03:51            13,906 gmproject.sql
               1개 파일              13,906 바이트
               0개 디렉터리  17,593,155,584 바이트 남음

E:\APPLICATION\mysql-5.1.48\bin>

 

전에 설치한 ftp서버를 통하여 백업파일을 업로드한다.

그담에 복원명령어 치면 끝

 

root@raspberrypi:/home/pi# mysql -u root -p gmproject < ./gmproject.sql
Enter password:
root@raspberrypi:/home/pi# mysql -upgmman -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 54
Server version: 5.5.33-0+wheezy1 (Debian)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use gmproject
Database changed
mysql> show tables;
+---------------------+
| Tables_in_gmproject |
+---------------------+
| board               |
| developer           |
| menu                |
| uploadfiles         |
| user                |
+---------------------+
5 rows in set (0.01 sec)

mysql>

정상적으로 들어왔다.
 

Posted by 박공명
, |

java를 설치한다.

 

apt-get install openjdk-7-jdk

 

설치됬다.

 

환경변수를 등록해준다.

 

root@raspberrypi:/usr/lib/jvm# nano /etc/profile

아래 라인을 추가

 

export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-armhf"

그리고 등록 후 확인한다.

 

root@raspberrypi:/usr/lib/jvm# source /etc/profile
root@raspberrypi:/usr/lib/jvm# echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-armhf

이제 톰캣을 받는다.


root@raspberrypi:/usr/local# wget http://apache.mirror.cdnetworks.com/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.tar.gz
--2014-01-21 11:12:39--  http://apache.mirror.cdnetworks.com/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.tar.gz
Resolving apache.mirror.cdnetworks.com (apache.mirror.cdnetworks.com)... 61.110.198.174
Connecting to apache.mirror.cdnetworks.com (apache.mirror.cdnetworks.com)|61.110.198.174|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6885442 (6.6M) [application/x-gzip]
Saving to: `apache-tomcat-6.0.37.tar.gz'

100%[=====================================================================>] 6,885,442   2.06M/s   in 3.2s

2014-01-21 11:12:42 (2.02 MB/s) - `apache-tomcat-6.0.37.tar.gz' saved [6885442/6885442]

 

이제 다운로드받은 톰캣을 압축을 푼다.

 

tar -zxvf apa~(tab누르면 자동완성된다)

 

자동실행되게한다.

 

nano /etc/rc.local

 

아래처럼

 

/usr/local/apache-tomcat-6.0.37/bin/startup.sh

 

이제 아파치를 설치한다.

 

apt-get install apache2

 

apt-get install libapache2-mod-jk

 

환경설정파일을 편집해서 jk module을 사용하도록 추가한다.

 

root@raspberrypi:/etc/apache2# nano apache2.conf

#JK_MODULE
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.s

 

jk module사용하여 넘길 패턴을 설정할수있도록 해당 파일을 수정한다.


root@raspberrypi:/etc/apache2# cd sites-enabled/
root@raspberrypi:/etc/apache2/sites-enabled# ls
000-default
root@raspberrypi:/etc/apache2/sites-enabled# nano 000-default

해당 내용을 추가해 넣는다. 무식하게 똑같이 따라넣는건 아니다.


JkMount /*.jsp ajp13_worker
JkMount /*.gm ajp13_worker

 

로컬호스트에 접속했을떄 It work! 뭐 이런말 뜨면 apache가 정상작동 하고있는상황

로컬호스트/index.jsp 로 접속시 톰캣이 뜨면 연동성공한거다.

요렇게

 

 

 

 

어? 끝!

Posted by 박공명
, |

이왕이면 업데이트부터 한다.

 

apt-get update

apt-get upgrade

 

어... 생각보다 오래걸렸음.

 

ftp를 설치한다.

 

root@raspberrypi:~# apt-get install vsftpd

환경설정파일을 편집한다.

 

root@raspberrypi:~# nano /etc/vsftpd.conf

참고할내용.

# FTP서버 와 외부 접속 허용여부

listen=YES

# 익명 로그인 설정

anonymous_enable=NO

# 로컬 접속 여부설정

local_enable=YES

# 쓰기(업로드)기능설정

write_enable=YES

# 업로드 후, 폴더권한 자동설정(777=자동설정)

local_umask=022

# 본인 외 계정폴더 접속 설정

chroot_list_enable=YES

# chroot_list 파일경로 지정

chroot_list_file=/etc/vsftpd.chroot_list

# passwd 파일에 등록된 대로 chroot를 실행여부

passwd_chroot_enable=YES

# chroot를 위해 root디렉토리를 설정

local_root=/home/

환경설정후 재시작해준다
root@raspberrypi:~# service vsftpd restart
Stopping FTP server: vsftpd.
Starting FTP server: vsftpd.

 

Posted by 박공명
, |

8기가 메모리에 라즈베리파이를 설치했는데

 

알고보니 2기가만 쓰고있었다는 사실.

 

root@raspberrypi:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          1.8G  1.7G     0 100% /
/dev/root       1.8G  1.7G     0 100% /
devtmpfs        116M     0  116M   0% /dev
tmpfs            25M  244K   25M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            50M     0   50M   0% /run/shm
/dev/mmcblk0p1   56M   19M   38M  33% /boot
tmpfs            50M     0   50M   0% /tmp

파티션 리스트를 확인하고

 

root@raspberrypi:/# fdisk -l

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c7b31

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880     3788799     1832960   83  Linux

fdisk를 실행한다.

 

root@raspberrypi:/# fdisk -u -c /dev/mmcblk0

delete - 파티션2 - new - primary - 파티션2 - 시작섹터~종료섹터 순서로 입력한다.

 

Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-15523839, default 2048): 122880
Last sector, +sectors or +size{K,M,G} (122880-15523839, default 15523839): 15523839

 

그냥 enter 치면 default로 자동세팅된다.

 

저장하고 종료

 

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

그리고 재부팅.

 

파티션 재인식후 확인.

 

root@raspberrypi:~# resize2fs /dev/mmcblk0p2
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 1925120 blocks long.

root@raspberrypi:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          7.3G  1.7G  5.3G  25% /
/dev/root       7.3G  1.7G  5.3G  25% /
devtmpfs        116M     0  116M   0% /dev
tmpfs            25M  240K   25M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            50M     0   50M   0% /run/shm
/dev/mmcblk0p1   56M   19M   38M  33% /boot
tmpfs            50M     0   50M   0% /tmp

끝.


 

'Dev > linux' 카테고리의 다른 글

라즈베리파이 리눅스 아파치 톰캣 설치  (0) 2014.01.21
라즈베리파이 리눅스 ftp서버 설치  (0) 2014.01.21
라즈베리파이 라즈비안 xbmc  (6) 2013.07.16
nslookup option , 사용법  (2) 2011.06.15
linux favorite command  (0) 2011.03.08
Posted by 박공명
, |

nslookup option , 사용법

Dev/linux / 2011. 6. 15. 12:12


이름그대로 네임서버를 확인하는 프로그램입니다.

너무 널리사용하는놈이라 대부분의 플랫폼에서 다있는 명령어죠.

DNS에서 호스트에대한 정보를 얻어오게됩니다.

NAME
       nslookup - query Internet name servers interactively

SYNOPSIS
       nslookup [-option] [name | -] [server]

기본적인 사용법
gm.park@ubuntuServer:~$ nslookup -q=host 213.165.65.50
unknown query type: host
Server:         165.243.137.23
Address:        165.243.137.23#53

Non-authoritative answer:
50.65.165.213.in-addr.arpa      name = gmx.net.

Authoritative answers can be found from:
65.165.213.in-addr.arpa nameserver = ns.schlund.de.
65.165.213.in-addr.arpa nameserver = dns.gmx.net.
ns.schlund.de   internet address = 195.20.224.97
dns.gmx.net     internet address = 213.165.64.1

--------------------------------------------------------------
gm.park@ubuntuServer:~$ nslookup -querytype=mx gmx.de
Server:         165.243.137.23
Address:        165.243.137.23#53

Non-authoritative answer:
gmx.de  mail exchanger = 10 mx1.gmx.net.
gmx.de  mail exchanger = 10 mx0.gmx.net.

Authoritative answers can be found from:
gmx.de  nameserver = ns-gmx.ui-dns.de.
gmx.de  nameserver = ns-gmx.ui-dns.biz.
gmx.de  nameserver = ns.schlund.de.
gmx.de  nameserver = dns.gmx.net.
ns.schlund.de   internet address = 195.20.224.97
dns.gmx.net     internet address = 213.165.64.1
ns-gmx.ui-dns.de        internet address = 217.160.80.199
ns-gmx.ui-dns.biz       internet address = 217.160.81.199

옵션은 어차피 쓰는거만 쓰게된다
상세한 옵션은 자체메뉴얼을 보면서 확보하자

NS
 도메인의 네임서버 정보
MX
 도메인의 MX(Mail Exchanger) 서버
A
 호스트의 IP주소
CNAME
 별칭으로 부여된 canonical name
SOA
 도메인의 start-of-authority정보
HINFO
 호스트의 CPU 정보와 운영체제 정보
MINFO
 메일박스와 메일 리스트 정보
PTR
 IP주소에 대한 호스트명
TXT
 호스트에 대한 텍스트 정보
UNIFO
 사용자 정보
ANY
 호스트에 관련된 모든 레코드들의 정보

Posted by 박공명
, |

linux favorite command

Dev/linux / 2011. 3. 8. 17:23

사용자가 bash를 사용할때 읽어오는 파일들
.profile : basic infomation
.bashrc : bash infomation
.bash_history : have bash command history
.bash_logout : when logout, system execute this command.(clear tmp,make history)
file :
if no have home directory, system use /etc/profile file.
% Order of execution
execute shell -> bash_profile  -> bashrc | bash_logout(when logout)

~ : $HOME
- : previous directory
export : 지정된 환경보기

와일드카드
* : 모든문자
? : 한개의문자
[abc] : a,b,c중한개
[a-z] : a-z까지의 모든문자
[:alnum:] : 알파벳과숫자 
[:alpha:] : 알파벳
[:digit:] :숫자
[:upper:] : 알파벳대문자
[:lower:] : 알파벳소문자

brace expansion
$echo a{1,2,3}
a1 a2 a3
$ echo a{1{1,2,3},2{1,2,3},3{1,2,3}}
a11 a12 a13 a21 a22 a23 a31 a32 a33

I/O redirection
> out : out으로 출력
< in : in으로부터 입력
>> out : out으로 이어붙임
2> :  표준에러의 출력방향
1> : 표준출력
2>&1 : 에러를 표준출력과같이 출력
1>&2 : 표준출력을 에러와같이 출력

pipeline
$ls | more
is
ls > tmp -> more < tmp

background job
find . -name "findname" 2>&1 > output &
find의결과물중 에러를 표준출력과 합치며 표준출력은 output파일로전달하며 백그라운드로작업
nohup
&는 일반적으로 터미널이 기동중에서만 프로세서를 잡고있게되는데
nohup는 터미널이 종료해도(hang up signal) 잡고있게된다.
특정 flag를 통하여 &를 nohup과 동일하게 쓸수있다.
$shopt | grep huponexit
huponexit       off

emacs 편집기능
^b : previous cursor
^f : next cursor
del : delete left character
^d : delete right character
^a : move front
^e : move end
^k : delete from this position to end
^p : move previous command
^n : move next command


테스트했던 예제
echo num of the parameter : $#
echo parameter string     : $@
echo param1 : $1 param2 : $2 param3 : $3
if [ $# > 1 ]; then
 param=$1
 echo param1 substring1to3 : ${param:0:3}
fi
for arg in "$@"
do
 echo ${arg}
done
echo "if test"
BUILD_USERMODE="true"
RESULTMY=if [ "$BUILD_USERMODE" == "qqqq" ];
echo "RESULTMY = $RESULTMY"
if [ "$BUILD_USERMODE" == "true" ]; then
 echo "it's true"
 echo "return is $?"
else
 echo "it's false"
 echo "return is $?"
fi
echo "result = $RESULT"

:= 이건가보다.



Posted by 박공명
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함