• 분류 전체보기 (160)
    • 개인프로젝트 (5)
      • 시연영상모음 (4)
      • 주저리주저리.. (1)
    • 자바스크립트이야기 (69)
      • ExtJS (30)
      • ExtJS 유의사항 (3)
      • HTML5 (1)
      • jQuery (17)
      • jQuery플러그인소개 (9)
      • jQuery UI 소개 (9)
    • 스프링연동하기 (23)
      • spring3 mvc 설정 (4)
      • spring3 mybatis 설정 (4)
      • spring3 기타설정 (11)
      • ibatis and mybatis (4)
    • DB (26)
      • MySQL vs MS-SQL vs O.. (5)
      • MySQL (10)
      • MSSQL (5)
      • Oracle (6)
    • 서버에웹환경구축하기 (13)
      • 1.VirtualBox+CentOS .. (5)
      • 2.JAVA(JDK) 설치 (1)
      • 3.Apache+Tomcat 설치 (3)
      • 4,SVN Server 설치 (1)
      • 5.마리아DB(MariaDB) 설치 (2)
      • 6.몽고DB(MongoDB)설치 (1)
    • 샘플소스 (14)
      • 샘플소스(JAVA) (7)
      • 샘플소스(JSTL) (4)
      • 샘플소스(jQuery/스크립트) (3)
    • 에디터연동 (5)
      • NAVER-스마트에디터 (4)
      • DAUM-다음에디터 (1)
    • 블로그팁 (3)
    • 디지털이야기 (2)
댓글
서버에웹환경구축하기
13
/135
2014. 8. 7. 09:48
리눅스 서버에 몽고DB 설치순서부터 테스트 접속까지 진행해보자

본인은 CentOS 7 기준으로 설명 해보도록 하겠다



파일다운로드

  >  http://www.mongodb.org/downloads


위 URL 접속후 본인의 서버 환경에 맞추어 다운로드를 받도록 한다.

본인의 가상서버의 환경은 CetnOS7 (64bit) 이므로 Linux 64-bit를 받음






위와같이 페이지 전환이 되면서 다운로드 시작이 될 것이다.

(오늘기준 다운로드 버전 : mongodb-linux-x86_64-2.6.3.tgz)


다운로드 완료하였다면 실서버에 ftp 툴을 이용하여 UPLOAD응응

(본인은 /usr/local/ 디렉토리에 업로드함)


업로드 하였다면 shell에서 다음과 같이 작업 해보도록 하자


압축해제

[root@localhost ~]# cd /usr/local/
[root@localhost local]# tar -zxvf mongodb-linux-x86_64-2.6.3.tgz

디렉토리명 변경

[root@localhost local]# mv mongodb-linux-x86_64-2.6.3 mongo

서브디렉토리 생성

[root@localhost local]# cd mongo/
[root@localhost mongo]# mkdir data
[root@localhost mongo]# mkdir config
[root@localhost mongo]# mkdir log

config 파일 생성

[root@localhost mongo]# vi config/mongodb.conf

mongodb.conf 내용작성

dbpath=/usr/local/mongo
logpath=/usr/local/mongo/mongo.log
logappend=true
port=7070
verbose=true
fork=true
rest=true

몽고DB 데몬실행

[root@localhost mongo]# /usr/local/mongo/bin/mongod --config config/mongodb.conf

2014-08-07T09:39:22.849+0900 ** WARNING: --rest is specified without --httpinterface,
2014-08-07T09:39:22.849+0900 **          enabling http interface
about to fork child process, waiting until server is ready for connections.
forked process: 3152
child process started successfully, parent exiting
[root@localhost mongo]#

테스트 접속

[root@localhost mongo]# /usr/local/mongo/bin/mongod --config config/mongodb.conf   
2014-08-07T09:39:22.849+0900 ** WARNING: --rest is specified without --httpinter   face,
2014-08-07T09:39:22.849+0900 **          enabling http interface
about to fork child process, waiting until server is ready for connections.
forked process: 3152
child process started successfully, parent exiting
[root@localhost mongo]# /usr/local/mongo/bin/mongo localhost:7070
MongoDB shell version: 2.6.3
connecting to: localhost:7070/test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
Server has startup warnings:
2014-08-07T09:39:22.849+0900 ** WARNING: --rest is specified without --httpinter   face,
2014-08-07T09:39:22.849+0900 **          enabling http interface
2014-08-07T09:39:22.856+0900 [initandlisten]
2014-08-07T09:39:22.856+0900 [initandlisten] ** WARNING: Readahead for /usr/loca   l/mongo is set to 4096KB
2014-08-07T09:39:22.856+0900 [initandlisten] **          We suggest setting it t   o 256KB (512 sectors) or less
2014-08-07T09:39:22.856+0900 [initandlisten] **          http://dochub.mongodb.o   rg/core/readahead
>

위와같이 접근이 정상적으로 된다면 설치 및 접속 성공!! 참잘했어요


※ 위 과정은 테스트 형식으로 몽고DB 설치 + 접속을 위해서 간단하게 설치해본것이다. 

    아마 제대로 사용하고자 한다면 config 파일에 대한 정보를 추가적으로 알아봐야 할것이다.





저작자표시 (새창열림)
/133
2014. 8. 5. 14:04
마리아DB(MariaDB) 인코딩 설정하기(UTF-8)

지난 포스팅때 CentOS7에 마리아db를 설치 해보았었다


2014/08/05 - [서버에웹환경구축하기/5.마리아DB(MariaDB) 설치] - 마리아DB(MariaDB)를 로컬서버(리눅스)에 설치해보기


yum으로 설치한 마리아DB에서 인코딩 설정은 심플하더라... ㅎㅎ

추가로 할 내용은 없다 그냥 설명 시작!!


MariaDB [(none)]> show variables like 'c%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
| collation_connection     | utf8_general_ci            |
| collation_database       | latin1_swedish_ci          |
| collation_server         | latin1_swedish_ci          |
| completion_type          | NO_CHAIN                   |
| concurrent_insert        | AUTO                       |
| connect_timeout          | 10                         |
+--------------------------+----------------------------+
14 rows in set (0.00 sec)

몇가지가 utf8이아닌 latin1 이다흥5

대략 보니 서버쪽 부분만 latin 인코딩인대 이것을 utf8로 변경해보도록 하자


[root@localhost etc]# vi /etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character_set_server = utf8   <- 추가를 해주도록 하자:
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

character_set_server = utf8 추가해준 후 service 재시작을 해보도록 하자

[root@localhost etc]# systemctl stop  mariadb.service
[root@localhost etc]# systemctl start  mariadb.service

별 오류없이 위의 명령어가 동작되었으면 다시한 번 mysql 접속후 show variables like 'c%'; 명령어를 주어 확인해보도록 하자

MariaDB [(none)]> show variables like 'c%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
| collation_connection     | utf8_general_ci            |
| collation_database       | utf8_general_ci            |
| collation_server         | utf8_general_ci            |
| completion_type          | NO_CHAIN                   |
| concurrent_insert        | AUTO                       |
| connect_timeout          | 10                         |
+--------------------------+----------------------------+
14 rows in set (0.00 sec)

위와같이 정상적으로 UTF8설정이 변경되었다면 성공Bye

저작자표시 (새창열림)

'서버에웹환경구축하기 > 5.마리아DB(MariaDB) 설치' 카테고리의 다른 글

마리아DB(MariaDB)를 로컬서버(리눅스)에 설치해보기  (0) 2014.08.05
/132
2014. 8. 5. 13:43
마리아DB(MariaDB)를 로컬서버(리눅스)에 설치해보기

한번 리눅스서버에 마리아db를 설치해보고자 한다

마리아DB는 그냥 MySQL이다... 

이름만 틀릴뿐..


CentOS7 기준이라 기존의 MySQL설치는 조금 난해해서 그냥 마리아DB로 설치하고자 한다.


[root@localhost lib]# yum -y install mariadb-server mariadb
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.tt.co.kr
 * extras: centos.tt.co.kr
 * updates: centos.tt.co.kr
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.37-1.el7_0 will be installed
---> Package mariadb-server.x86_64 1:5.5.37-1.el7_0 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================
 Package                      Arch                 Version                           Repository             Size
=================================================================================================================
Installing:
 mariadb                      x86_64               1:5.5.37-1.el7_0                  updates               8.9 M
 mariadb-server               x86_64               1:5.5.37-1.el7_0                  updates                11 M

Transaction Summary
=================================================================================================================
Install  2 Packages

Total download size: 20 M
Installed size: 104 M
Downloading packages:
(1/2): mariadb-5.5.37-1.el7_0.x86_64.rpm                                                  | 8.9 MB  00:00:02
(2/2): mariadb-server-5.5.37-1.el7_0.x86_64.rpm                                           |  11 MB  00:00:03
-----------------------------------------------------------------------------------------------------------------
Total                                                                            5.8 MB/s |  20 MB  00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:mariadb-5.5.37-1.el7_0.x86_64                                                               1/2
  Installing : 1:mariadb-server-5.5.37-1.el7_0.x86_64                                                        2/2
  Verifying  : 1:mariadb-server-5.5.37-1.el7_0.x86_64                                                        1/2
  Verifying  : 1:mariadb-5.5.37-1.el7_0.x86_64                                                                                                                                                                                           2/2

Installed:
  mariadb.x86_64 1:5.5.37-1.el7_0                                                                                   mariadb-server.x86_64 1:5.5.37-1.el7_0

Complete!
[root@localhost lib]#

설치 완료하였으면 마리아DB 서비스를 시작해주도록 하자

[root@localhost lib]# systemctl start mariadb.service

에러가 발생하지 않는다면 일반 mysql 접속과 동일하게 접속해보도록하자

[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.37-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

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

MariaDB [(none)]>

초기 비밀번호 설정을 하지 않았다면 패스워드입력없이 엔터만 치면 다음과 같이 접속이 가능하다

root 설정을 해보도록 하자

[root@localhost~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
.
.
.
Enter current password for root (enter for none): 엔터
OK, successfully used password, moving on...
.
.
.
Set root password? [Y/n] 엔터
New password: 신규생성패스워드입력
Re-enter new password: 신규생성패스워드입력
Password updated successfully!
Reloading privilege tables..
 ... Success!
.
.
.
Remove anonymous users? [Y/n] 엔터
 ... Success!
.
.
.
Disallow root login remotely? [Y/n] 엔터
 ... Success!
.
.
.
Remove test database and access to it? [Y/n] 엔터
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
.
.
.
Reload privilege tables now? [Y/n] 엔터
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost~]#


패스워드 설정까지 마무리된 상태이다.

그럼 다시한번 MariaDB접속을 해보도록 하자


ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

패스워드 없이 접속시 위와같이 에러발생하고 패스워드 입력후 접속화면이 뜬다면 성공적으로 설치 완료!!!


방화벽(3306포트) 개방을 해준 후 

외부에서 DB툴로 접속을 해보게 되면 


Error No.1130

Host 'xxx.xx.x.xx' is not allowed to connect to this MariaDB server


라는 에러를 뿜을듯...

이럴경우 maria db를 콘솔에 접속 한 후 다음과 같이 설정을 해주도록 하자


MariaDB [(none)]> 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

MariaDB [mysql]> select host,user,password from user;
+-----------+------+-------------------------------------------+
| host      | user | password                                  |
+-----------+------+-------------------------------------------+
| localhost | root | *A4B6157319038724E3560894F7F932C8886EBFCF |
| 127.0.0.1 | root | *A4B6157319038724E3560894F7F932C8886EBFCF |
| ::1       | root | *A4B6157319038724E3560894F7F932C8886EBFCF |
+-----------+------+-------------------------------------------+
3 rows in set (0.00 sec)

위와같이 나오면 host에 외부 아이피가 등록되지 않아서이다.

본인은 전체 접근으로 권한을 설정할 것이므로 grant 설정에 관한 글은 현재 본인 블로그에는 없으므로 구글링을 통하여 적절히 사용하시길....

MariaDB [mysql]> grant all privileges on *.* to 'ROOT계정'@'%' identified by 'ROOT의비밀번호';
Query OK, 0 rows affected (0.00 sec)

위와같이 주었으면 다시한면 외부에서 접속을 해보면 잘 접속이 될것이다.


저작자표시 (새창열림)

'서버에웹환경구축하기 > 5.마리아DB(MariaDB) 설치' 카테고리의 다른 글

마리아DB(MariaDB) 인코딩 설정하기(UTF-8)  (0) 2014.08.05
/118
2014. 7. 29. 00:27
리눅스에 SVN(subversion) 설치해보기

이번에는 svn server 설치를 linux에 해보고자 한다

그냥 간단하게 yum으로 설치를 하겠다  ㅋㅋ


[root@localhost ~]# yum -y install subversion
.
.
.
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : apr-1.4.8-3.el7.x86_64                                       1/4
  Installing : apr-util-1.5.2-6.el7.x86_64                                  2/4
  Installing : subversion-libs-1.7.14-6.el7.x86_64                          3/4
  Installing : subversion-1.7.14-6.el7.x86_64                               4/4
  Verifying  : subversion-1.7.14-6.el7.x86_64                               1/4
  Verifying  : apr-1.4.8-3.el7.x86_64                                       2/4
  Verifying  : subversion-libs-1.7.14-6.el7.x86_64                          3/4
  Verifying  : apr-util-1.5.2-6.el7.x86_64                                  4/4

Installed:
  subversion.x86_64 0:1.7.14-6.el7

Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7                   apr-util.x86_64 0:1.5.2-6.el7
  subversion-libs.x86_64 0:1.7.14-6.el7

Complete!
[root@localhost ~]#


svn 설치가 서버에 완료되었으면 이어서 svn 디렉토리를 생성하도록 하자

본인은 /usr/local/svn이라고 디렉토리를 생성한후 test repository를 생성해주도록 하자


[root@localhost ~]# mkdir /usr/local/svn
[root@localhost ~]# svnadmin create --fs-type fsfs /usr/local/svn/test


svn클라이언트 계정할당을 위한 svnserve.conf를 설정해보도록 하자

[root@localhost ~]# vi /usr/local/svn/test/conf/svnserve.conf

svnserve.conf의 내용중, 다음 값의 주석 해제후, 값을 변경해주도록 하자


[변경전]

# anon-access = read
# auth-access = write
# password-db = passwd

[변경후]

anon-access = none
auth-access = write
password-db = passwd

저장 후 passwd파일에 계정추가를 하도록 하자

[root@localhost ~]# vi /usr/local/svn/test/conf/passwd

[users]하단에 본인이 사용할 아이디 = 패스워드를 정의하고 저장을 하도록 하자

[users]
test = 1234

설정이 끝났으므로 svn서버를 실행하도록 하자

[root@localhost ~]# svnserve -d -r /usr/local/svn

정상동작되는지 확인이 된다면 설치가 완료된 것이다.

[root@localhost ~]# ps -ef | grep svnserve
root      3405     1  0 00:10 ?        00:00:00 svnserve -d -r /usr/local/svn
root      3415  3196  0 00:20 pts/1    00:00:00 grep --color=auto svnserve
[root@localhost ~]# netstat -an | grep 3690
tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN



잘 되었다면 우선 3690포트를 방화벽에서 해제해주도록 하자 -_-;; 

CentOS 7 은 iptables를 안쓰고 firewalld라는게 생겨서 뭔가 번거로움..;;

해제해주었다면 이클립스에서 한번 접속해보도록 하자






URL은 svn://아이피/test 라고 접속시 하단과 같이 뜬다면 정상적으로 svn 접속이 완료 된것임





설치 완료!!


저작자표시 (새창열림)
/102
2014. 7. 15. 12:52
tomcat connector를 이용한 아파치 + 톰캣 연동하기

apache + tomcat 연동을 한번 해보도록 해보자

연동을 위해서는 Tomcat Connector가 필요하다


링크를 통해서 파일을 다운받도록 하자


다운로드 페이지 : http://tomcat.apache.org/download-connectors.cgi





파일질라고 /usr/local/ 디렉토리에 다운로드받은 파일 업로드!!  흥5

압축 해제!! 

[root@localhost local]# tar -zxvf tomcat-connectors-1.2.40-src.tar.gz

이제는 apxs라는 파일과 연결을 하여 설치파일을 만들어 주어야 한다.

아파치를 설치하였다면 /아파치경로/bin/apxs라는 파일이 존재할 것이다.


그렇다면 

[root@localhost local]# cd /usr/local/tomcat-connectors-1.2.40-src/native/
[root@localhost native]# ./configure --with-apxs=/usr/local/apache/bin/apxs
 .
 .
 .
no netscape given
configure: creating ./config.status
config.status: creating Makefile
config.status: creating apache-1.3/Makefile
config.status: creating apache-1.3/Makefile.apxs
config.status: creating apache-2.0/Makefile
config.status: creating apache-2.0/Makefile.apxs
config.status: creating common/Makefile
config.status: creating common/list.mk
config.status: creating common/jk_types.h
config.status: creating common/config.h
config.status: executing depfiles commands
[root@localhost native]# make && make install
 .
 .
 .
Please be sure to arrange /usr/local/apache/conf/httpd.conf...

make[1]: Leaving directory `/usr/local/tomcat-connectors-1.2.40-src/native/apache-2.0'
make[1]: Entering directory `/usr/local/tomcat-connectors-1.2.40-src/native'
make[2]: Entering directory `/usr/local/tomcat-connectors-1.2.40-src/native'
make[2]: `install-exec-am'를 위해 할 일이 없습니다
make[2]: `install-data-am'를 위해 할 일이 없습니다
make[2]: Leaving directory `/usr/local/tomcat-connectors-1.2.40-src/native'
make[1]: Leaving directory `/usr/local/tomcat-connectors-1.2.40-src/native'
[root@localhost native]#

설치완료!!


이어서 파일추가후 각 설정을 잡아주어야 한다.

vi 명령어를 이용하여 /아파치경로/conf/ 디렉토리에 2개의 파일을 생성하여 다음과 같이 

작성해주도록 하자


1. mod_jk.conf

<IfModule mod_jk.c>
        JkWorkersFile "/usr/local/apache/conf/workers.properties"
        JkLogFile "/usr/local/apache-tomcat-7.0.54/logs/mod_jk.log"
        JkLogLevel info
        JkAutoAlias "/usr/local/apache-tomcat-7.0.54/webapps"
        JkMount /* ajp13
        JkMount /*.jsp ajp13
        JkMount /servlet/* ajp13
        JkMount /examples/*.jsp ajp13
        JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
        JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
        JkRequestLogFormat "%w %V %T"
</IfModule>


2. workers.properties

workers.tomcat_home="/usr/local/apache-tomcat-7.0.54"
workers.java_home="/usr/java/jdk1.7.0_60"
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13

다음으로 httpd.conf에 다음 내용을 추가하도록 하자 

httpd.conf는 신규생성한 workers.properties 파일과 같은 디렉토리에 존재한다.

vi 명령어로 httpd.conf를 확인해보면 LoadModule <<< 에대한 목록들이 있는 위치가 있는데

LoadModule 맨 마지막 라인에 다음을 추가하도록 하자

LoadModule jk_module modules/mod_jk.so




마지막으로 httpd.conf에 mod_jk.so의 경로를 include해주도록 하자  

include위치는 맨 끝라인이다.

* mod_jk.so 의 경로는 /usr/local/apache/modules/mod_jk.so 이다.

  해당 파일이 없다면 아파치 컴파일시 잘못 설치를 한것이므로 재설치를 해보도록 하자



맨마지막 라인에 추가할 내용


include conf/mod_jk.conf



자, 그럼 저장후 아파치서버와 톰캣 서버를 둘다 올린 후, http://서버아이피 로접속을 해보도록 

하자. 접속전 서버에 방화벽 8080은 필요가 없다. 80포트만 해제되어있으면됨.






다음과 같이 8080이 아닌 일반 아이피 접속으로만으로도 고양이가 떳다면 

아파치 - 톰캣 연동 완료된거임 

홧팅2




저작자표시 (새창열림)

'서버에웹환경구축하기 > 3.Apache+Tomcat 설치' 카테고리의 다른 글

리눅스 서버에 apache(80포트) 를 설치해보도록 하자 - apache  (0) 2014.07.15
리눅스 서버에 톰캣 설치를 진행해보도록 하자  (0) 2014.07.15
이전 1 2 3 다음

티스토리툴바