레이블이 CentOS6.5인 게시물을 표시합니다. 모든 게시물 표시
레이블이 CentOS6.5인 게시물을 표시합니다. 모든 게시물 표시

2017년 6월 20일 화요일

[Oracle] Listener Start Error - CentOS 6.5 / Oracle 11gR2


Listener starts when it starts,


but listener was not starting when command "status" input.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=xxxx)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused



"hosts" File localhost add (Red Color Markup)

[oracle@ora11g admin]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1        localhost.localdomain localhost
::1                localhost6.localdomain6 localhost6

192.168.10.11   oracle

My Case

[oracle@ora11g admin]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.

192.168.10.11   oracle


But what you can not understand is why you do not know why. It is now running.

2017년 5월 23일 화요일

[Oracle] APEX(Applcation Express) Install on CentOS 6.5

1. Oracle Web Site apex install  : File Download
[root@oracle ~] wget http://download.oracle.com/otn/java/appexpress/apex_5.1.1.zip

2. unzip
[root@oracle ~] unzip apex_5.1.1.zip

create folder apex by this command

3. sql file execute
[root@oracle ~] cd apex

# sqlplus sys dba login
[root@oracle apex] sqlplus '/as sysdba'

SQL> !pwd
/home/oracle/apex

/*
Create Table Space

CREATE SMALLFILE TABLESPACE TBS_APEX
    DATAFILE
        '/home/oracle/app/oradata/TSUN/TBS_APEX' SIZE 1073741824 AUTOEXTEND ON NEXT 16384 MAXSIZE 34359721984
    BLOCKSIZE 8192
    DEFAULT NOCOMPRESS
    ONLINE
    SEGMENT SPACE MANAGEMENT AUTO
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

*/

/*@apexins.sql tablespace_apex tablespace_files tablespace_temp images */
SQL> @apexins.sql TBS_APEX TBS_APEX TEMP /images/
.......

** Command Result - Create Schema
APEX_PUBLIC_USER
APEX_050000
FLOWS_FILES

SQL> @apxchpwd.sql
==========================================================
This script can be used to change the password of an Application Express
instance administrator. If the user does not yet exist, a user record will be
created.
==========================================================
Enter the administrator's username [ADMIN]
User "ADMIN" does not yet exist and will be created.
Elapsed: 00:00:00.00
Enter ADMIN's email [ADMIN]
Enter ADMIN's password []
Created instance administrator ADMIN
Elapsed: 00:00:00.23

/* User Modify */
SQL> alter user APEX_PUBLIC_USER account unlock;
SQL> alter user APEX_PUBLIC_USER identified by "apex password";
SQL> alter profile DEFAULT limit PASSWORD_FILE_TIME unlimited;


/* APEX RESTful Service Database Schema Install */
SQL> @apex_rest_config.sql


4. Oracle REST Data Service (ORDS) Install - Stanalone Mode - File Download

[root@oracle ~] wget http://download.oracle.com/otn/java/ords/ords.3.0.9.348.07.16.zip

[root@oracle ~] unzip ords.3.0.9.348.07.16.zip

/* ords install & Setting */
[root@oracle ~]  java -jar ords.war install advanced

이 Oracle REST Data Services 인스턴스는 아직 구성되지 않았습니다.
다음 프롬프트에 값을 입력하십시오.
구성 데이터를 저장할 위치를 입력하십시오.: /home/public_html/dbtool/
데이터베이스 서버의 이름을 입력하십시오. [localhost]: ***.***.***.*** 
데이터베이스 수신 포트를 입력하십시오. [1521]: ****
데이터베이스 서비스 이름을 지정하려면 1을 입력하고, 데이터베이스 SID를 지정하려면 2를 입력하십시오. [1]:2
데이터베이스 SID를 입력하십시오. [xe]: ORATEST

Oracle REST Data Services 스키마를 확인/설치하려면 1을 입력하고, 이 단계를 건너 뛰려면 2를 입력하십시오. [1]:1
ORDS_PUBLIC_USER에 대한 데이터베이스 비밀번호를 입력하십시오.: New Password
비밀번호 확인:
Oracle REST Data Services 스키마를 확인하려면 SYSDBA 권한으로 로그인하십시오. 설치해야 할 수 있습니다.
설치를 확인하려면 SYSDBA 권한을 보유한 사용자 이름을 입력하십시오. [SYS]:
SYS에 대한 데이터베이스 비밀번호를 입력하십시오.:
비밀번호 확인:

Oracle REST Data Services 스키마가 존재하지 않으므로 생성됩니다.
ORDS_METADATA에 대한 기본 테이블스페이스을(를) 입력하십시오. [SYSAUX]:TBS_APEX
ORDS_METADATA에 대한 임시 테이블스페이스을(를) 입력하십시오. [TEMP]:
ORDS_PUBLIC_USER에 대한 기본 테이블스페이스을(를) 입력하십시오. [USERS]:TBS_APEX
ORDS_PUBLIC_USER에 대한 임시 테이블스페이스을(를) 입력하십시오. [TEMP]:

PL/SQL 게이트웨이를 사용하려면 1을 입력하고, 이 단계를 건너 뛰려면 2를 입력하십시오. [1]:2
Application Express RESTful Services 데이터베이스 사용자(APEX_LISTENER, APEX_REST_PUBLIC_USER)에 대한 비밀번호를 지정하려면 1을 입력하고, 이 단계를 건너 뛰려면 2를 입력하십시오. [1]:
APEX_LISTENER에 대한 데이터베이스 비밀번호를 입력하십시오.:
비밀번호 확인:
APEX_REST_PUBLIC_USER에 대한 데이터베이스 비밀번호를 입력하십시오.:
비밀번호 확인:

독립형 모드를 시작하려면 1을 입력하고, 종료하려면 2를 입력하십시오. [1]:1
HTTP 포트를 입력하십시오. [8080]: 8081


5. image Folder copy or move
[root@oracle ~] mv /home/oracle/apex/images /home/oracle/dbtool//home/oracle/dbtool/ords/standalone/doc_root/

or comment
example ords folder

/home/oracle/dbtool/
/home/oracle/dbtool/ords/
/home/oracle/dbtool/ords/conf/
/home/oracle/dbtool/ords/standalone/
/home/oracle/dbtool/ords/standalone/doc_root/
/home/oracle/dbtool/ords/standalone/doc_root/images

2016년 10월 13일 목요일

[Oracle] UTL_HTTP 패키지를 활용한 웹서비스 호출 또는 URL CALL

웹/앱 리뉴얼 프로젝트를 진행 중에 내부에서 처리해야할 프로세스상 로직이 있었는데 오라클(데이터베이스) 단계에서 처리가 곤란하게 되어 외부서비스(웹)의 특정 URL/URI를 호출해야 되는 경우가 생겼다. 구글링으로 검색을 해도 상세히 설명 된 곳이 별로 없다. 잠깐 보게 되면 남겨져 있는 대부분 같은 질문과 대답만 있을 뿐이었다.

#별것도 아닌 것으로 하루 시간을 보낸걸 생각하니 화가 치밀어 오르기도 하면서 나와 같은 사람이 분명 있을 꺼라 생각을 하고 정보를 공유하니 도움이 되시길 바란다. 이보다 여러가지 형태의 호출/호출 후 응답 데이터 활용 등이 있을 수 있으나 해당 포스팅에서는 웹서비스 호출을 하기 위한 준비 정도까지만 공유 하고자 한다.

#설정 후 그 이후 단은 적용하고자 하는 도메인과 요구사항에 따라 달라질 수 있으니 해당 내용에서는 제외 한다.

1. 자 일단 Oracle 에서는 웹서비스 호출 및 메일보내기(?) 등을 사용하기 위해 몇몇의 기본 패키지들을 제공하고 있다.

UTL_URL : URL의 인코딩/디코딩 하는 것을 지원
UTL_TCP : TCP/IP를 사용하여 외부 웹서버와 통신할 수 있는 기능을 제공
 - 참고 : "뇌를 자극하는 오라클 프로그래밍" p576  참고 하시길
UTL_SMTP - 메일보내기

이 포스팅에서 소개할 내용과 실사 내용 보고는 아래의 UTL_HTTP 이다.

UTL_HTTP : Oracle에서 web service 호출을 위한 기능 제공
 - Oracle Help Center : 바로가기


1) UTL_HTTP 패키지를 사용하기 위해서는 우선 ACL(Access Control List - 접근제어목록) 에 사용할 데이터베이스 사용자에게 권한을 부여해야 한다. 아래의 3가지 예제를 통하여 우선 진행 해보자.

 * Example Source
1-1) ACL에 사용하고자 하는 것을 추가 한다.

BEGIN
    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (
              acl => 'my_test_utl_http.xml',
              description => '테스트용 ACL 입니다. ',
              principal => 'ORACLE_USER',  -- ORACLE_USER란 사용자에게 권한 할당
              is_grant => true,
              privilege => 'connect');

      COMMIT;
END;

1-2) ORACLE_USER에게 권한을 할당 .
BEGIN
    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE (
              acl => 'my_test_utl_http.xml',
              principal => 'ORACLE_USER',  -- ORACLE_USER란 사용자에게 권한 할당
              is_grant => true,
              privilege => 'connect');

      COMMIT;
END;

1-3) 접속할 HOST 정보를 추가
BEGIN
   DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
                         acl          => 'my_test_utl_http.xml',              
                         host         => 'www.oracle.com',
                         lower_port => 80,
                         upper_port => 80);
   COMMIT;
END;

2) 추가된 접속 정보가 잘들어 갔는지 SYS AS SYSDBA 권한으로 조회를 확인

select * from DBA_NETWORK_ACLS;
select * from DBA_NETWORK_ACL_PRIVILEGES ;

정상적으로 조회가 된다면 사전 준비가 된것 이다.
이제 간단하게 확인을 해보자.


* Example Source

DECLARE
  req   UTL_HTTP.REQ;
  resp  UTL_HTTP.RESP;
  value VARCHAR2(1024);

BEGIN

  req := UTL_HTTP.BEGIN_REQUEST('http://www.oracle.com');
  UTL_HTTP.SET_HEADER(req, 'User-Agent', 'Mozilla/4.0');
  resp := UTL_HTTP.GET_RESPONSE(req);

  LOOP
    UTL_HTTP.READ_LINE(resp, value, TRUE);
    DBMS_OUTPUT.PUT_LINE(value);
  END LOOP;
  UTL_HTTP.END_RESPONSE(resp);

EXCEPTION WHEN UTL_HTTP.END_OF_BODY THEN
    UTL_HTTP.END_RESPONSE(resp);
END;

결과적으로 해당 웹사이트에 대한 응답에 결과를 출력하게 되므로 HTML 소스의 응답부분을 출력하게 될 것이다. 여러가지 오류사항이 나타날 수 있다. 나 역시 그런 오류들이 당황스럽게 만들기도 하였으니 몇 가지만 공유 하면 다음과 같다.


** 자주보게 되는 오류
* ORA-24247: network access denied by access control list (ACL)
- ACL 설정에 대한 문제 : 사전 준비과정에서 ACL 정보가 잘못들어 간 곳은 없는지 확인하는게 좋다. 가끔 오타가 있는경우가 많을 것이다.

사전 준비 과정에서의 ACL 값을 다 지우고 다시 하고 싶다면 아래의 프로시저를 사용 하면 된다.

exec DBMS_NETWORK_ACL_ADMIN.DROP_ACL(acl => 'my_test_utl_http.xml');

해당 ACL명칭을 사용된 이름을 확인하여 삭제 하면 된다.

* ORA-29273: HTTP request failed
* ORA-06512: at "SYS.UTL_HTTP", line 1130
* ORA-12541: TNS:no listener
* ORA-06512: at line 1

나 처럼 네트워크 라우팅문제 이거나 DNS 문제로 인하여 발생하는 어처구니 없는 상황일 수 있다. 네트워크 담당자에게 확인하거나 본이이 직접 해결하던가 필요 하다. 어찌 되었든 지속적인 접근에 응답이 없어서 그러한 것이다.

왜 안되지 안되지 하면서 허송세월 보내다가 CENTOS 서버 쉘에서

LINUX #] curl -v www.oracle.com

으로 실행해 보니 접속 내역을 보면서 확인 할 수 있다. 확인하다 보니 해당 도메인을 찾지 못하거나 IP정보의 네트워크 상의 라우팅 문제일 수 있으니 말이다. 모두가 쉽게 해결 되길. 좀더 상세한 각 패키지의 기능은 오라클 Help Center 를 활용하시길..


2016년 3월 25일 금요일

[Linux] JDK Install

1. Linux JDK Download and Install

1-1. Linux 용 JDK 설치 패키지에는 다음과 같이 두 가지 종류가 있다.

- example RPM
  RPM 기반 Linux 플랫폼에서 시스템 디렉터리에 설치하기 위해 RPM (파일명. rpm)을 사용한다. 설치를 위해서는 root 계정으로 진행 해야 한다.

1-2. Oracle JDK 다운로드
oracle.com사이트에서 JDK 최신 버전을 다운로드 받는다. 시스템의 환경에 따라 32/64비트 구분하여 다운로드 받는다.

2. 기존 JDK 제거 - 필수는 아님
[root@test ~]# yum remove jdk

3. RPM JDK Install
[root@test ~]#  rpm -ivh jdk-7u45-linux-x64.rpm

4.   java alternative Set
[root@test ~]#  alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000
[root@test ~]#  alternatives --config java

There are 3 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
+ 3           /usr/java/latest/bin/java

Enter to keep the current selection[+], or type selection number: 3

[root@test ~]#  java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

6. 사용자 기본 Shell에서 Java 에 대한 설정

①     .bashrc
[root@test ~]#  vi ~/.bashrc

## 아래 내용을 추가 후 저장/닫기
## added by jboss
export PATH=$PATH:/usr/java/latest/bin

②     PATH Check
[root@test ~]# source ~/.bashrc
[root@test ~]# echo $PATH

2016년 3월 24일 목요일

[Linux] Using NTFS(USB) by CentOS

NTFS(USB) 리눅스에 마운트 하기 



CentOS에서 윈도우에서 파일을 가져다 쓰는 경우가 종종 있는데 자동으로 마운트가 안되어 당황한 하였나.. 어쩌지 하다가 누군가 만들어 왔을 것이야 그렇지 않아 하고 검새하니 

" ntfs-3g " 가 해결책이다. 


기본적 원리는 NTFS 파일로 쓸때나 리눅스에 쓸때나  아무나 쓰고 읽을수 있는 권한 777이 주어진다. 여기서 주의해야 할 사항은 공개된 서버에 NTFS파일을 쓸때는 권한에 신경써야 한다.


소스파일 최신버전을 다운 http://www.tuxera.com/community/ntfs-3g-download/


  # tar -xzf ********.taz

  # su - root 
  # ./configure
  # make
  # make install





 마운트 하기 전에
# fdisk -l  // 마운트할 HDD 위치를 확인


# mount -t ntfs-3g /dev/sdb1 /mnt

2016년 1월 22일 금요일

[HTTP Server] Apache log file Management

Learn about the access_log, error_log file to reduce file size.


# Reduce the file size without rebooting the Apache daemon
[root@www01 ]# cat /dev/null > error_log
[root@www01 ]# cat /dev/null > access_log

# If you have to restart the Apache daemon
[root@www01 ]# rm -rf error_log
[root@www01 ]# rm -rf aceess_log

* Return the capacity was in use, only you need to restart Apache daemon on your system.



2015년 8월 10일 월요일

[Linux] DocumentRoot Directory error case by Apache 2.2 & CentOS 6.5

[root@localhost ~]# vi httpd.conf
................
#DocumentRoot  = "/var/www/html"
DocumentRoot = "/var/www/newDiretory"

DocumentRoot 설정 위치에서 변경 후 재시작 하는 경우 Directory 에러 날 때는 다음과 같이 내용을 추가적으로 수정

[root@localhost ~]# chcon -R -t httpd_user_content_t /var/www/newDiretory

#selinux 의 기능을 OFF

[root@localhost ~]# vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
#SELINUX=enforcing
SELINUX=disabled  # 기능 작동을 중단합니다

# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted


2015년 4월 13일 월요일

[Linux] Basic Command - tar


[root@test /]> tar cvf  FileNames.tar FolderNames[root@test /]> tar cvfz FileNames.tar.gz FolderNames[root@test /]> tar cvfz FileNames.tar FolderNames

[root@test /]> tar xvfz FileNames.tar.gz
[root@test /]> tar xvf FileNames.tar

2014년 8월 7일 목요일

[CentOS] CentOS 6.5 - MySQL and Apache2 and PHP Configuration

Installing MySQL 5
To install MySQL, we do this:

[root@~]# yum -y install mysql mysql-server

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:

chkconfig --levels 235 mysqld on
[root@~]# /etc/init.d/mysqld start

Set passwords for the MySQL root account:

mysql_secure_installation

[root@~]#  mysql_secure_installation

Installing Apache2
Apache2 is available as a CentOS package, therefore we can install it like this:

[root@~]# yum -y install httpd

Now configure your system to start Apache at boot time...

chkconfig --levels 235 httpd on

... and start Apache:

[root@~]# /etc/init.d/httpd start

Now direct your browser to http://192.168.0.100, and you should see the Apache2 placeholder page:


Apache's default document root is /var/www/html on CentOS, and the configuration file is /etc/httpd/conf/httpd.conf. Additional configurations are stored in the /etc/httpd/conf.d/ directory.



[root@~]# vi /etc/sysconfig/iptables

cofig files input
......
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT


[root@~]# service iptables restart


 Installing PHP5
We can install PHP5 and the Apache PHP5 module as follows:

[root@~]# yum -y install php


We must restart Apache afterwards:

[root@~]# /etc/init.d/httpd restart

5 Testing PHP5 / Getting Details About Your PHP5 Installation
The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

[root@~]# vi /var/www/html/info.php

<?php
phpinfo();
?>

Now we call that file in a browser (e.g. http://192.168.0.100/info.php):


As you see, PHP5 is working, and it's working through the Apache 2.0 Handler, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don't have MySQL support in PHP5 yet.



6 Getting MySQL Support In PHP5
To get MySQL support in PHP, we can install the php-mysql package. It's a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:

[root@~]# yum search php

Pick the ones you need and install them like this:

[root@~]# yum -y install php-mysql

In the next step I will install some common PHP modules that are required by CMS Systems like Wordpress, Joomla and Drupal:

[root@~]# yum -y install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy curl curl-devel

APC is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It's similar to other PHP opcode cachers, such as eAccelerator and Xcache. It is strongly recommended to have one of these installed to speed up your PHP page.

APC can be installed as follows:

[root@~]# yum -y install php-pecl-apc

Now restart Apache2:

[root@~]# /etc/init.d/httpd restart

Now reload http://localhost/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the APC module:


phpMyAdmin
phpMyAdmin is a web interface through which you can manage your MySQL databases.

First we enable the RPMforge repository on our CentOS system as phpMyAdmin is not available in the official CentOS 6.5 repositories:

Import the RPMforge GPG key:

[root@~]# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

On x86_64 systems:

[root@~]# yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

On i386 systems:

[root@~]# yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm

phpMyAdmin can now be installed as follows:

[root@~]# yum -y install phpmyadmin

Now we configure phpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the <Directory "/usr/share/phpmyadmin"> stanza):

[root@~]# vi /etc/httpd/conf.d/phpmyadmin.conf

#
#  Web application to manage MySQL
#

#<Directory "/usr/share/phpmyadmin">
#  Order Deny,Allow
#  Deny from all
#  Allow from 127.0.0.1
#</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
Next we change the authentication in phpMyAdmin from cookie to http:

[root@~]# vi /usr/share/phpmyadmin/config.inc.php

[...]

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

or

$cfg['Servers'][$i]['auth_type'] = 'cookie';

[...]
Restart Apache:

[root@~]# /etc/init.d/httpd restart

Afterwards, you can access phpMyAdmin under http://localhost/phpmyadmin/:





[CentOS] SSH Config - PermitRootLogin


## CentOS 6.5 64Bit Version


OpenSSH Configuration Files
[root@dev]# vi /etc/ssh/sshd_config
[root@dev]# /etc/rc.d/init.d/sshd restart

# LoginGraceTime 2m
설정한 시간내에 로그인 하지 않으면 자동으로 접속을 끊도록 설정 한다. 값을 0으로 하면 무제한 이다.

# PermitRootLogin no
기본값은 주석처리 되어 있어 기본으로 값은 'yes' 이다. 공격자가 임의의 주소에 root 계정으로 접속이 가능한지 여부를 알아 낼 수 있다. 따라서 위와 같이 root 계정의 접근을 막고 일반 유저로 접속한 다음 root 계정으로 전환 하는 것이 일반적이다.

# MaxAuthTries 6
접속당 최대 인증 시도 횟수. 기본값 6, 3회이상 인증 실패시 로그가 기록

2014년 5월 8일 목요일

[Linux] How to install Oralce 11g R2 Database server on Centos 6.5

** 설치전 작업
[root@~] # yum -y groupinstall "X Window System"

1. Oracle을 설치하고 운영할 사용자 계정을 만든다.
Before installation, Oracle user account that you want to install and make operational.

[root@~] # groupadd oinstall
[root@~] # groupadd dba
[root@~] # useradd -m -g oinstall -G dba oracle
[root@~] # passwd oracle


2. Install Packages Check's
http://docs.oracle.com/cd/E11882_01/install.112/e24323/toc.htm#CEGHFFGG

binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2

## Install/Update & Check
[root@~] #yum -y install compat-libstdc++-33.x86_64 binutils elfutils-libelf elfutils-libelf-devel
[root@~] #yum -y install glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel
[root@~] #yum -y install libaio libgcc libstdc++ libstdc++ make sysstat unixODBC unixODBC-devel
[root@~] #yum -y install unzip



3. Environment Configuration

[root@~] # su - root
[root@~] # cd /etc/yum.repos.d
[root@~] # wget --no-check-certificate https://public-yum.oracle.com/public-yum-ol6.repo
[root@~] # wget --no-check-certificate https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

[root@~] # yum install oracle-rdbms-server-11gR2-preinstall

[root@~] # mkdir -p /home/oracle//app/oracle/product/11.2.0/dbhome_1
[root@~] # chown -R oracle.oinstall /home/oracle/app
[root@~] # chmod -R 775 /home/oracle/app

##SELINUX 설정 해제
[root@~] # vi /etc/selinux/config
SELINUX=disabled

##Hostname 변경
[root@~] # vi /etc/sysconfig/network
HOSTNAME=oracle

[root@~] # vi /etc/hosts
127.0.0.1   oracle


## Oracle 계정으로 변경
[root@~] # su - oracle

[oracle@~] # vi .bash_profile

if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=ora.saf.com;
export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G;
export ORACLE_UNQNAME
ORACLE_BASE=/home/oracle/app;
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1;
export ORACLE_HOME
ORACLE_SID=ORCL;
export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH;
export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH
export PATH


[oracle@~] # source .bash_profile


3. Oracle Download and install

* Oracle Database Download URL - Down(must Login)

[oracle@~] # uzip *****.zip
[oracle@~] # ./runInstaller 


-- 설치 모드 화면에서 한글이 깨지는 경우는 아래와 같이 설정 한다. Font Error case 
[oracle@~] # export LANG=C


.... 중간 설치 화면은 생략 한다.


Configuration scripts need to be executed as the “root” user.
Go to the path given in the screen and execute the scripts one by one. Click on ‘OK‘ once scripts is executed.

[oracle@~] # su - root
[root@~] # cd /home/oracle/app/oraInventory
[root@ oraInventory ] # ./orainstRoot.sh

[root@~] # cd /home/oracle/app/product/11.2.0/dbhome_1
[root@ oraInventory ] # ./root.sh


2014년 4월 30일 수요일

[Linux] CentOS 6.5 - Samba Server Configuration

* Samba는 주로 윈도우즈 사용자와 함께 파일서버 형태로 구성하는 경우 많이 사용을 하게 된다. 팀내 공유문서 및 파일 구성을 위해서 7년만에 CentOS를 접하면서 새로 설정 하는 것들을 찾다가 이것 저것 함께 정리 하게 되었다.

원문주소
" Easy Samba server installation on CentOS 6.5 " 

Samba is a client/server system that implements network resource sharing for Linux and other UNIX computers. With Samba, UNIX files and printers can be shared with Windows clients and vice versa. Samba supports the Session Message Block (SMB) protocol. Nearly all Windows computers include SMB support with their internal network subsystems (NetBIOS in particular).

With an appropriately-configured Samba server on Linux, Windows clients can map drives to the Linux filesystems. Likewise, the Samba client on UNIX can connect to Windows shares by their UNC name. Although differences among various operating systems (such as filesystem naming conventions, end-of-line conventions, and authentication) can limit interoperability, Samba offers a generally serviceable mechanism for resource sharing on a heterogenous network.


* 설치를 위해서 체크 및 버전을 확인 한다.

1. [root@orabackup ~]# yum install samba samba-client samba-common

2. [root@orabackup ~]# smbd --version



* 서비스를 자동으로 올려주기 위해서 아래의 문장을 처리 한다. 그러나 보통 한글판 CentOS6.5 버전을 설치 할때 보통의 특별한 체크를 하지 않았다면 "Basic Server" 버전 이상의 설치 체크에선 이미 등록되어 있다. 다만 자동 시작의 레벨 체크가 되어 있지 않으므로 그부분에 대한 설정 변경만 한다면 자동 실행을 큰 무리 없을 것이다.

여하튼 그것이 있든 없든 사용할 수 있는 구문 임

1. [root@orabackup ~]# chkconfig smb on
2. [root@orabackup ~]# chkconfig nmb on


* 방화벽 설정이 보통은 열려 있지 않으므로 방화벽 설정

1. [root@orabackup ~]# iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
2. [root@orabackup ~]# iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
3. [root@orabackup ~]# iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
4. [root@orabackup ~]# service iptables save

또는 설정파일을 직접 열어서 VI로 수정하여 서비스를 재시작 하여도 동일한 결과를 얻을 수 있다.



1. [root@orabackup ~]# vi /etc/sysconfig/iptables

* 아래내용 추가
-A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT

2. [root@orabackup ~]# service iptables restart


3. [root@orabackup ~]# cat /etc/sysconfig/iptables



* 윈도우에서 네트워크 드라이브로 접속(인증)할 사용자/그룹 정보와 폴더를 생성한다.

1. [root@orabackup ~]# useradd its
2. [root@orabackup ~]# groupadd smbgrp
3. [root@orabackup ~]# usermod -a -G smbgrp its
4. [root@orabackup ~]# smbpasswd -a its
5. [root@orabackup ~]# cd /home/its
6. [root@orabackup ~]# mkdir its_files
7. [root@orabackup ~]# chown -R its:smbgrp its_files/
8. [root@orabackup ~]# chmod -R 0770 its_files/


* Samba 설정 파일을 아래와 같이 변경하여 마무리 한다.



* 마무리한 서비스를 재시작 한다.

1. [root@orabackup ~]# service smb restart
2. [root@orabackup ~]# service nmb restart


* 네트워크 드라이브 연결은 윈도우에 처리 하며 별도의 설명을 붙이지 않겠음

1. \\서버해당아이피\its_files
2. 상위에서 만든 아이디/패스워드로 접속하여 연결 완료



언제 부터 였던가 생각해보니 아르바이트 겸 외부 컨설팅을 의뢰 받고 맥북 프로를 처음 써봤을 때 부터 였던 것 같다. 지금은 거의 대부분의 작업을 맥으로 작업을 하다 보니 윈도우에서만 실행되는 일부 프로그램들 때문과 회사 내부 ERP프로그램이 윈도우 ...