2016. 5. 10. 11:29

교육자료 다운로드


공통컴포넌트 중에서 게시판을 어떻게 관리하는지 실습해보자!


물론, 공통 컴포넌트(Common Component)는 기능위주로 250종(공통기술 141종/유틸리티 109종)이 있다.

어떤 것들이 있는지 한 번 쭉 읽어보는 것이 필요하다.


요소기술서비스(유틸리티)에는 꽤 유용한 것들이 많으므로 자신들이 직접 뭔가를 만드는 것보다는 뭐가 있는지 기억했다가 잘 찾아서 사용하는 것이 더 효율적이다.


필요한 기능을 설치하여 둘러보고 기본적인 로직(Logic)으로 사용해보는 것이 좋다.


[/textbook/05.공통컴포넌트/02.공통컴포넌트_실습교재.pdf]


"공통컴포넌트 중 게시판 컴포넌트 적용"


[Page 2] eGovFrame Web Project를 신규로 생성


- 에고!! 그런데 개발환경(Eclipse)의 메뉴에 왜 "eGovFrame"이 없는거지?

- Window > Perspective > Open Perspective > Other... 을 선택하시고 "eGovFrame"을 추가해주세요.

- Target Runtime을 나중에 선택하셔도 되지만 이미 만들어 놓으신 것이 있으시다면 선택하셔도 됩니다.


[Page 3] 웹 프로젝트에 공통 컴포넌트( 게시판)을 생성

만약 New > eGovFrame Common Component라는 메뉴가 없다면 다음과 같이 Other...에서 직접 선택해주세요.




[Page 4] Table 생성"생성하지 않음(기본설치)"을 선택하라고 하는데요.

"생성하지 않음(기본설치)"를 선택하고 테이블 생성 및 기본 자료 데이터 입력을 따로 수행하라고 하는데요. 


"사용자 DB에 생성(사용자지정)"을 통해서 직접 생성해주시거나
참고)  eGovFrame 전자정부 프레임워크 실습 [lab102-code-generation]


[Page 5]에 sql파일들을 사용하여 직접 생성해주서야 합니다.
(- MySQL에서 텍스트 파일의 SQL문 실행시키기 )


<전자정부프레임워크>

공통컴포넌트 v3 가이드 >> 에서 "게시판"을 참조하세요.







Posted by 모바일헌터
2016. 5. 9. 16:24

교육자료 다운로드


1. 

공통 컴포넌트는 MySql, Oracle, Tibero, Altibase, Cubrid 기준으로 제공됩니다.

따라서, lab104를 시작하기 전에 DB를 설치하고 진행을 하셔야 합니다.


- Windows에서 MySQL은 다운로드 받으신 bin폴더에 있으므로 그냥 실행하시면 됩니다. 

(참조: Windows에서 MySQL 5.6.14 설치하기)


/textbook/02.개발환경/04.[참고]개발환경_실습교재.pdf (Page 4)에 

실습용 Database의 정보가 나와있네요.


항목

정보 

Database

com

Username

com

Password

com01

Port

3306 


항목

정보 

Database

hyb

Username

hyb

Password

hyb01

Port

3306 


항목

정보 

Database

mobile

Username

mobile

Password

mobile01

Port

3306 


딱히 다른 에러는 없네요.

Posted by 모바일헌터
2016. 5. 9. 15:15

교육자료 다운로드


 [lab103-egovgettingstarted.zip]

문제가 없으면 안되는 것일까?


HelloWorldServiceTest.java

package egovframework.guide.helloworld;


import static org.junit.Assert.assertEquals;

import javax.annotation.Resource;


import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


@RunWith(SpringJUnit4ClassRunner.class)

@ContextConfiguration(locations = { "/context-helloworld.xml" })


public class HelloWorldServiceTest {

private HelloWorldService helloworld;


@Resource(name = "helloworld")

public void setHelloWorld(HelloWorldService hello) {

this.helloworld = hello;

}


@Test

public void SayHello() {

assertEquals("Hello eGovFrame!!!", helloworld.sayHello());

}

}


1. 

다음과 같은 에러를 만나셨다면?

Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet.
lab103 Unknown Faceted Project Problem (Java Version Mismatch)

>> 프로젝트의 Properties에서 Project Facets와 Java Compiler에서 Compiler compliance level을 맞춰 주세요.

2. 

다음과 같은 메시지가 Console에 표기된다면?

INFO [org.springframework.test.context.TestContextManager] Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [javax/servlet/ServletContext]


>> ㅠㅠ 잘 모르겠네요. 전자정부프레임워크에 질의를 해놨는데요. (너무 무식한 질문을 한 듯 하네요.)

(솔직히 제대로 실행이 된것인지? 아닌지?)


<> JUnit(Unit Testing)에 대해서 대해서 좀 더 살펴보고 업데이트 할 수 있도록 하겠습니다.





Posted by 모바일헌터
2014. 11. 19. 10:10

- MySQL 설정변경
 $ sudo vi /etc/mysql/my.cnf
# bind-address=127.0.0.1
 $ sudo /etc/init.d/mysql restart
mysql은 기본적으로 127.0.0.1 (localhost)에서만 접속을 허용하며 client의 default port는 3306이다.
보안을 위해서 포트를 변경하고 bind-address라인을 #을 넣어 원격접속을 허용하고 mysql을 재 시작 해줘야 한다.

- root로 로그인하기
 $ mysql -u root -p mysql
+--------+-----------+
| user   | host      |
+--------+-----------+
| root   | 127.0.0.1 |
| root   | ::1       |
|        | localhost |
| com    | localhost |
| hyb    | localhost |
| mobile | localhost |
| root   | localhost |
+--------+-----------+
8 rows in set (0.00 sec)

mysql> insert into user (host, user, password, ssl_cipher, x509_issuer, x509_subject) values ('%','root',password('password'),'','','');

- 사용자 확인

mysql> select user, host from user;



- 사용자 권한 설정

mysql> GRANT all privileges on {database-name}.* to '{user-id}' identified by 'password';

mysql> GRANT all privileges on {database-name}.* to '{user-id}'@'localhostidentified by 'password';

예) grant all privileges on openfire.* to 'openfire'@'openfire-server' identified by 'openfire-password';

모든 데이터베이스에 대해서 권한을 부여하려고 할 경우 *를 사용한다. 특정 IP('111.112.113.114')를 지정할 수 있으며 만약 모든 IP를 허용하고 싶다면 '%', '111.112'로 시작하는 아이피를 허용하고 싶다면 '111.112.%'로  대체하면 된다.  hostname을 명시하지 않으면 '%'과 동일하며 localhost에서도 동작하기 위해서는 꼭 'localhost'를 따로 명시해주어야 한다.

select와 insert만 허용하는 경우 다음과 같이 설정할 수 있다.

mysql> GRANT select, insert on {database-name}.* to '{user-id}'@'localhostidentified by 'password';


- 사용자 권한 삭제

mysql> revoke all privileges on *.* from '{user-id}'@'{hostname}'


이제 원격에서 접속해보자.
$ mysql -h 111.111.111.111 -u root -p

접속 허용을 삭제해보자.

mysql>  delete from mysql.user where host='192.168.70.102' and user='root';
Query OK, 1 row affected (0.00 sec)



'Tip > 우분투' 카테고리의 다른 글

Ununbu에 vsftpd 설치하기  (0) 2015.04.14
MySQL 기본적인 사용  (0) 2014.11.19
MySQL 접속  (0) 2014.11.19
Openfire (XMPP) 설치  (1) 2014.11.19
ant를 ubuntu에 설치해봅시다.  (0) 2014.11.18
Posted by 모바일헌터
2014. 11. 19. 10:07
- MySQL 기본적인 사용



► mysql에 접속한 상태에서 mysql 데이터베이스를 사용하기 위하여 다음의 명령어를 사용합니다.

mysql -u root -p 

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.5.40-0ubuntu1 (Ubuntu)

Copyright (c) 2000, 2014, 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 mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

❉ 위의 두가지 명령을 "mysql -u root -p mysql"이라고 입력하여 한번에 처리도 가능합니다.


 변경 내용을 반영하기 위해서는 다음의 명령을 실행해야 합니다.

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



'Tip > 우분투' 카테고리의 다른 글

MySQL 기본적인 사용  (0) 2014.11.19
MySQL 원격접속 허용하기  (0) 2014.11.19
Openfire (XMPP) 설치  (1) 2014.11.19
ant를 ubuntu에 설치해봅시다.  (0) 2014.11.18
MySQL 유저관리  (0) 2014.11.12
Posted by 모바일헌터
2014. 11. 12. 13:10


유저 관리

- create user 문 사용 (유저추가-1)

 mysql> create user '{user-id}'@'{hostname}' identified by '{user-password}';

예) create user 'openfire'@'openfire-server' identified by 'openfire-password';
⦿ '{hostname}'은 'localhost' 로컬접근을 허용하고 '%' 모든 외부접근을 허용하며 특정 IP에서만 접속을 할 수 있도록 지정할 수 있다. 

- insert 문 사용 (유저추가-2)

 mysql> insert into user(host, user, password) values('{hostname}', '{user-id}', password('{new-password}'));


- drop user 문 사용  (유저삭제-1)

 mysql> drop user '{user-id}';  혹은  mysql> drop user '{user-id}'@'{hostname}';

⦿ 같은 user-id로 여러 개의 hostname이 등록될 수 있으므로 각

- delete
 문 사용 
(유저삭제-2)

 mysql> delete from user where user = '{user-id}';
혹은 
 
mysql> delete from user where user = '
{user-id}', host = '{hostname}';


- mysqladmin 이용 (패스워드 변경-1)
 $ mysqladmin -u {user-id} -p password {new-password}
Enter password: {old-password}

- update문 이용  (패스워드 변경-2)
 mysql> update user set password = password('{new-password}') where user = {user-id};

- set password문 이용  (패스워드 변경-3)

 mysql> set password for {user-id} = password('{new-password}') ;






'Tip > 우분투' 카테고리의 다른 글

Openfire (XMPP) 설치  (1) 2014.11.19
ant를 ubuntu에 설치해봅시다.  (0) 2014.11.18
Ubuntu의 명령라인에서 패키지 관리  (0) 2014.11.11
Ubuntu Server에 tomcat 설치  (0) 2014.11.10
Ubuntu Server에 Apache httpd 설치하기  (0) 2014.11.10
Posted by 모바일헌터
2014. 10. 24. 16:34
아파치 설치

 $ sudo apt-get install apache2

>> 브라우저에서 "http://localhost"를 확인해보세요

- 소스를 빌드하여 설치하기: Ubuntu Server에 Apache httpd 설치하기


Tomcat 설치

 $ sudo apt-get install tomcat7


◎ 선택적으로 tomcat7-docs, tomcat7-examples, tomcat7-admin도 설치해주세요.

 $ sudo apt-get install tomcat7 tomcat7-docs tomcat7-examples tomcat7-admin


 다음의 파일에서 JDK의 폴더를 찾지 못하는 경우가 있습니다. 
$ vi /etc/init.d/tomcat7
JDK_DIRS=“/usr/lib/jvm/jdk1.8.0"

Open JDK보다 Oracle JDK를 사용하기 원하신다면 다음 링크를 참조하세요.

>> 브라우저에서 "http://localhost:8080"를 확인해보세요
default Tomcat home page: /var/lib/tomcat7/webapps/ROO/index.html
CATALINA_HOME: /usr/share/tomcat7
CATALINA_BASE: /var/lib/tomcat7

위와 같이 자동으로 설치 되었을 경우, 약간의 설정에 문제가 있으므로 다음의 글을 참조하여 설치하기를 권장한다. Ubuntu Server에 tomcat 설치

MySQL 설치

 $ sudo apt-get install mysql-server


동작확인하기

 $ sudo netstat -tap | grep mysql




'개발 거들기' 카테고리의 다른 글

소스를 블로그에 올릴 때  (0) 2016.05.12
ATOM에서 TODO관리하기  (0) 2015.12.21
git 로컬 저장소 생성(.git 폴더)  (0) 2015.01.14
git 수정사항 확인  (0) 2015.01.14
형상관리 툴 - (1) git  (0) 2014.09.20
Posted by 모바일헌터