2014. 12. 9. 16:33

맥에서 JDK가 설치 되어 있지만 Android Studio가 JVM을 찾을 수 없다고 나올 때는 버전을 체크해보세요. 

현재 배포되는 Android Studio는 JVM1.6x를 지원하도록 되어 있네요.


Android Studio가 설치되어 있는 디렉토리에 Contents 밑에 Info.plist라는 파일을 살펴보시면 JVMVersion이라는 Key가 있습니다. 

/Applications/Android Studio.app/Contents



http://stackoverflow.com/questions/27369269/android-studio-was-unable-to-find-a-valid-jvm-related-to-mac-os

<key>JVMVersion</key>
<string>1.6*</string>

위를 아래와 같이 고치시면 됩니다.

<key>JVMVersion</key>
<string>1.8*</string>


'Tip > OSX' 카테고리의 다른 글

OSX 메일 어플의 폰트 문제  (0) 2015.01.16
Pages 저장 방법  (0) 2015.01.14
tar.bz2, tar.gz, tgz 압축풀기  (0) 2014.10.10
Midnight Commander를 OSX 에서 사용하자  (0) 2014.09.25
화면 캡쳐 - 스크린샷  (0) 2014.09.14
Posted by 모바일헌터
2014. 11. 19. 10:10


Database

- 데이터베이스 보기

 mysql> show databases;


- 데이터베이스 생성

 mysql> create database {databases-name};

예) create database openfire;

- 데이터베이서 삭제

 mysql> drop database {databases-name};

예) drop database openfire;

Table
- 테이블 보기

 mysql> show tables;


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

mac의 terminal에서 ssh로 Ubuntu로 접속시에 한글 깨짐현상  (0) 2015.11.19
Ununbu에 vsftpd 설치하기  (0) 2015.04.14
MySQL 원격접속 허용하기  (0) 2014.11.19
MySQL 접속  (0) 2014.11.19
Openfire (XMPP) 설치  (1) 2014.11.19
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. 19. 00:40
Ubuntu에서 OpenFire를 설치해 보자!

1. Openfire를 다운로드 받기 [다운로드 사이트]
- openfire_src_{version}.tar.gz 를 다운로드 받으세요.자 

2. Java (JDK)가 설치가 되어 있어야만 합니다. 자신의 머신에 맞게 JDK를 설치해주세요.

3. Ant 빌드 툴 설치
ant를 ubuntu에 설치해봅시다. (굳이 ant를 설치하지 않아도 포함하고 있습니다.)

4. 컴파일 & 설치 & 실행
$ tar xvfz openfire_src_3_9_3.tar.gz
$ cd openfire_src/build
$ ant
$ mv ../target/openfire /opt/.
$ cd /opt/openfire/bin
$ sudo ./openfire.sh or $ sudo ./openfirectl

5. 설정
http://localhost:9090 or http://{domain-name}:9090
브라우져에서 서버가 설치된 컴퓨터의 9090포트로 접속을 하여 설정을 진행하자.

5.1 Choose Language
  - English 선택 (안타깝게도 아직 한국어는 지원하지 않는다)

5.2 Server Settings: 
  - 도메인 명만 분명히 입력해주시면 됩니다. (같은 컴퓨터에서 진행할 경우 localhost를 다른 컴퓨터를 사용할 경우 적당한 도메인 명을 입력해주면되며 /etc/hosts 파일을 수정하여 테스트를 진행할 수도 있다.)
  - 접속 포트를 수정해줄 수 있다.

5.3 Database Settings
  - Standard Database Connection

5.4 Database Settings - Standard Connection
  - jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true
  - mysql에 database와 user를 미리 Openfire 서버로부터 사용할 수 있는 권한을 주어야 한다.
    (참조 
http://www.mobilehunter.net/105)
예) mysql > create user 'openfire'@'localhost' identified by 'openfire-password';
     mysql > create database openfire;
     mysql > grant all privileges on openfire.* to 'openfire'@'localhost' identified by 'openfire-password';

5.5 Profile Settings
  - Default를 설정하자.

5.6 Administrator Account
  - email과 password를 설정하자

6. admin 접속
username은 admin이다. 
(Administrator Account설정시 email을 입력하였다고 해서 email을 입력하면 안된다. 하지만 password는 Administrator Account 설정 시 입력한 password이다.)

7. openfirectl 설정

### BEGIN INIT INFO
# Provides:          openfire
# Required-Start:    $local_fs $remote_fs $network
# Required-Stop:     $local_fs $remote_fs $network
# Should-Start:      $named
# Should-Stop:       $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start openfire
# Description:       Start the openfire engine.
### END INIT INFO
...
[ -z "$OPENFIRE_USER" ] && OPENFIRE_USER="root"
...
start() {
        # Start daemons.
        echo "Starting openfire: "
        PID=`su - $OPENFIRE_USER -c "nohup $OPENFIRE_RUN_CMD > $OPENFIRE_LOGDIR/nohup.out 2>&1 &"`
        RETVAL=$?

        OPENFIRE_PID=`ps -U $OPENFIRE_USER  -o pid,cmd --no-heading | grep 'DopenfireHome' | grep -v "grep"  | cut -d " " -f 2`
        echo $OPENFIRE_PID >  $OPENFIRE_PIDFILE

        [ $OPENFIRE_PID -gt 0 -a -d /var/lock/subsys ] && touch /var/lock/subsys/openfire

        sleep 1 # allows prompt to return
}

약간의 수정을 하셔야만 Ubuntu에서 정상동작 합니다.
$ sudo cp /opt/openfire/bin/openfirectl /etc/init.d/.
sudo update-rc.d openfirectl defaults




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

MySQL 원격접속 허용하기  (0) 2014.11.19
MySQL 접속  (0) 2014.11.19
ant를 ubuntu에 설치해봅시다.  (0) 2014.11.18
MySQL 유저관리  (0) 2014.11.12
Ubuntu의 명령라인에서 패키지 관리  (0) 2014.11.11
Posted by 모바일헌터
2014. 11. 18. 22:51
0. 간단한 설치
$ sudo apt-get install ant


1. Ant 다운로드
Ant Apache 사이트에서 소스를 다운로드 해주세요.
apache-ant-{version}-src.tar.gz

$ wget http://www.webhostingjams.com/mirror/apache//ant/source/apache-ant-1.9.4-src.tar.gz


2. md5 확인

$ md5sum apache-ant-1.9.4-src.tar.gz
5beb7949f8c4eff84b20b55c795de0a4  apache-ant-1.9.4-src.tar.gz

5beb7949f8c4eff84b20b55c795de0a4


3. ant 설치

$ tar xvfz apache-ant-1.9.4-src.tar.gz
$ cd  apache-ant-1.9.4 
$ sudo sh build.sh -Ddist.dir=/usr/share/ant dist 


4. link 설치
sudo update-alternatives --install /usr/bin/ant ant /usr/share/ant/bin/ant 1 \
--slave /usr/bin/ant-bins ant-bins /usr/share/ant/bin/ant-bins

► 참고
- JUnit 사이트를 방문하여 hamcrest-core.jar 다운로드 받아서 "lib/optional” 에 카피해준다.
$ cd lib/optional
$ wget -O hamcrest-core-1.3.jar http://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar







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

MySQL 접속  (0) 2014.11.19
Openfire (XMPP) 설치  (1) 2014.11.19
MySQL 유저관리  (0) 2014.11.12
Ubuntu의 명령라인에서 패키지 관리  (0) 2014.11.11
Ubuntu Server에 tomcat 설치  (0) 2014.11.10
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. 11. 11. 23:35

- 설치 가능한 패키지들의 리스트 갱신: $ sudo apt-get update

- 레파지토리로 부터 패키지 설치: $ sudo apt-get install [package_name]
- 파일 부터 패키지 설치: $ sudo apt-get install [package.deb]
- 패키지 제거: $ sudo apt-get remove [pakcage_name]
- 패키지 제거(설정파일 포함): $ sudo apt-get purge [package_name] 

Ubuntu에서 서비스를 관리하는 방법
- 서비스를 시작 $ sudo service {service-name} start   $ sudo invoke-rc.d {service-name} start    $ sudo /etc/init.d/{service-name} start
- 서비스를 종료 $ sudo service {service-name}stop   $ sudo invoke-rc.d {service-name} stop    $ sudo /etc/init.d/{service-name} stop

- 부팅시 서비스를 자동 시작 Enabling $ sudo update-rc.d {service-name} defaults
- 부팅시 서비스를 자동 시작 Disabling $ sudo update-rc.d {service-name} remove

◎ chkconfig, sysv-rc-conf, sysvconfig를 설치하고 설정하는 방법도 있으나 "update-rc.d”를 이용하시길 권한다.

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

ant를 ubuntu에 설치해봅시다.  (0) 2014.11.18
MySQL 유저관리  (0) 2014.11.12
Ubuntu Server에 tomcat 설치  (0) 2014.11.10
Ubuntu Server에 Apache httpd 설치하기  (0) 2014.11.10
Ubuntu Server에 GNU GCC컴파일러 설치  (0) 2014.11.10
Posted by 모바일헌터
2014. 11. 11. 22:27

$ sudo hostname {your-new-hostname}

$ sudo vi /etc/hostname
{your-new-hostname}

$ sudo vi /etc/hosts
127.0.1.1    {your-new-hostname}

$ sudo /etc/init.d/hostname.sh restart


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

1. tomcat 다운로드
 tomcat.apache.org로 이동하여 좌측의 Download에서 적당한 버전을 선택하고 Binary Distributions에서 Core: tar.gz를 다운로드 받는다.

2. 다운로드한 파일을 압축해제한 후 /opt밑으로 이동한다.
$ tar xvfz apache-tomcat-8.0.14.tar.gz
$ sudo mv 
apache-tomcat-8.0.14  /opt/tomcat8

3. tomcat의 버전정보와 시스템 정보를 확인해보자
$ cd /opt/tomcat8/bin
$ ./version.sh

Using CATALINA_BASE:   /opt/tomcat8
Using CATALINA_HOME:   /opt/tomcat8
Using CATALINA_TMPDIR: /opt/tomcat8/temp
Using JRE_HOME:        /usr/lib/jvm/jdk1.8.0/jre
Using CLASSPATH:       /opt/tomcat8/bin/bootstrap.jar:/opt/tomcat8/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.0.14
Server built:   Sep 24 2014 09:01:51
Server number:  8.0.14.0
OS Name:        Linux
OS Version:     3.16.0-24-generic
Architecture:   amd64
JVM Version:    1.8.0_25-b17
JVM Vendor:     Oracle Corporation 

4. 시스템 설정을 검토해 보자
$ ./configtest.sh
◎ 만약 tomcat을 이미 실행했다면 종료를 한 후에 test를 진행해야 한다.

5. 사용자를 추가해봅시다.
$ sudo vi /opt/tomcat8/bin/
tomcat-users.xml 

...

  <role rolename="manager-gui"/>
  <role rolename="admin-gui"/>
  <user username="username" password="password" roles="manager-gui,admin-gui"/>
</tomcat-users>

username/password를 알맞게 설정해주세요.

6. 실행 및 종료
$ ./startup.sh         # 실행
$ ./shutdown.sh     # 종료

7. 실행/종료를 위한 스크립트를 init.d에 생성하자.
$ sudo vi /etc/init.d/tomcat8

#!/bin/sh
### BEGIN INIT INFO
# Provides:          tomcat8
# Required-Start:    $local_fs $remote_fs $network
# Required-Stop:     $local_fs $remote_fs $network
# Should-Start:      $named
# Should-Stop:       $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start Tomcat.
# Description:       Start the Tomcat servlet engine.
### END INIT INFO 
if [ `id -u` -ne 0 ]; then
    echo "You need root privileges to run this script"
    exit 1
fi
# Make sure tomcat is started with system locale
if [ -r /etc/default/locale ]; then
    . /etc/default/locale
    export LANG
fi
if [ -r /etc/default/rcS ]; then
    . /etc/default/rcS
fi
. /lib/lsb/init-functions

export CATALINA_HOME=/opt/tomcat8
PATH=/sbin:/bin:/usr/sbin:/usr/bin
start() {
 sh $CATALINA_HOME/bin/startup.sh
}
stop() {
 sh $CATALINA_HOME/bin/shutdown.sh
}
case $1 in
  start|stop) $1;;
  restart) stop; start;;
  *) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac

$ sudo chmod 755 /etc/init.d/tomcat8

8. tomcat이 부팅시  자동 실행될 수 있도록 등록해줍시다.
$ sudo update-rc.d tomcat8 defaults

자동 실행을 해제
$ sudo update-rc.d tomcat8 remove

OSX의 Terminal에서 ssh로 로그인을 해서 작업중이라면 Perl locale error가 발생할 수 있다. [해결방법]
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8”).

9. tomcat을 실행하고 Server Status를 확인해봅시다.
$ sudo /etc/init.d/tomcat8 start

http://localhost:8080을 오픈하여 보세요.
"Server Status" 버튼을 눌러서 5.에서 설정한 username과 password를 입력하여 Server Status를 확인해보세요.



참고) Apache + Tomcat + MySQL 설치 (우분투)


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

MySQL 유저관리  (0) 2014.11.12
Ubuntu의 명령라인에서 패키지 관리  (0) 2014.11.11
Ubuntu Server에 Apache httpd 설치하기  (0) 2014.11.10
Ubuntu Server에 GNU GCC컴파일러 설치  (0) 2014.11.10
Ubuntu에 SSH Server 설치하기  (0) 2014.11.10
Posted by 모바일헌터