Jun 26 2009

SSL 생성하기

분류: Apache2최 태현 @ 5:14 오후

Configuring SSL

First we need to generate a self signed certificate that Apache can use. Since it is self signed, browsers will give a warning that forces you to do some extra clicks the first time the certificate is loaded.

We will need openssl to be able to generate the certificate so install it if it’s not already on the server by doing:

apt-get install openssl

After openssl is installed enter the /etc/ssl/private/ directory and run the following command to create a private key for Apache (you may use a different name for the key file):

cd /etc/ssl/private
openssl genrsa -des3 -out debby.key 1024

You are asked to enter a passphrase for the key. We will remove this passphrase later on, so just enter whatever you like (just don’t forget it). Now we can make a certificate based on this key. Enter the /etc/ssl/certs/ directory and run the following command:

cd /etc/ssl/certs
openssl req -new -x509 -days 365 -key ../private/debby.key -out debby.crt

First you are asked to enter the passphrase you used when creating the key. After that you are prompted for some more information like State, City and so forth. It’s important to write something when you are asked for “Common Name”. If you don’t do this you will have problems checking out the code from the Subversion repositories later on.

When done you will have a file called debby.crt (or whatever name you chose).

Now we need to get rid of the passphrase from the key file or else Apache will ask you for the passphrase every time you restart it. To do that run the following commands:

cd /etc/ssl/private
cp debby.key debby.key.org
openssl rsa -in debby.key.org -out debby.key
chmod 400 debby.key debby.key.org

And thats that! The key no longer has a passphrase and it is only readable by the root user. Now we need to configure Apache so that SSL is enabled and that it uses the certificate we have just created.

On Debian the SSL module for Apache is installed together with the apache2 package, but not enabled. If your distro does not include the SSL module you will need to install it first.Now, let’s enable it and make some changes to the default configuration.

Enter the /etc/apache2/mods-enabled/ directory and make a couple of symlinks:

cd /etc/apache2/mods-enabled/
ln -s ../mods-available/ssl.load
ln -s ../mods-available/ssl.conf

The next time Apache restarts it will load the SSL module and use the configuration from the ssl.conf file in the mods-enabled directory.

Now we want Apache to listen to port 443 instead of 80. This can be done by editing the ports.conf file in the /etc/apache2/ directory. Simply put in 443 instead of 80 and save the file.

We need to configure the SSL module to use the certificate we just created. Instead of editing the default configuration file we will create a file called ssl.conf in /etc/apache2/conf.d/ together with trac.conf and subversion.conf and make it look like this:

<VirtualHost _default_>
    DocumentRoot "/services/apache/debby/html"
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/debby.crt
    SSLCertificateKeyFile /etc/ssl/private/debby.key
</VirtualHost>

SSL is now enabled on the default virtual host on our Apache server and will use the certificate and key we just created. As you can see I have set the DocumentRoot of the default virtual host to a directory that does not yet exist. Create it by running the following command:

mkdir -p /services/apache/debby/html

Now we can restart Apache and we should have SSL support. I can now make a request to https://debby/trac and get the project listing. http will no longer work since the server only listens on port 443. The first time you request something from https you will get a warning about the certificate. In Firefox you can just make an exception in the rules and it will no longer nag about the certificate. You get this warning because the certificate is not signed by a Certifying Authority. The certificate will work just fine, except for the annoying warning the first time your browser loads it.

Now that we have SSL we can go ahead and configure authentication for our Trac and the Subversion repositories.

Tags:


Jun 19 2009

Trac에서 한글설정

분류: CDE, How to, Trac최 태현 @ 9:26 오전

Trac과 Subversion을 연동하여 설치하고 기존 프로그램 Source를 옮겼는데 한글이 깨져나와서 찾아 봤습니다.

  • cd  /data1/u-service.kr/trac/lavendar/conf
  • sudo vi trac.ini
  • 다음 부문을 하단부의 [trac] 부문에 추가

default_charset = euc-kr

utf8을 선호한다면 이부분을 euc-kr를 utf8로 바꾸면 됩니다.

크득~크득~ 잘 나옵니다. 이런 기분때문에 삽질하는게 아닐까요?????

Tags:


Jun 18 2009

버젼관리(Subverion 위주) 관련 용어집

분류: CDE최 태현 @ 11:15 오전

버젼관리 도구를 사용하려고 이리저리 작업을 하고 있습니다. 아무래도 용어는 정리해놔야 될것 같아서 틈틈이 관리하고자 합니다.

  • repository : 버젼관리도구로 작업하는 소스, 문서 등 작업용 파일이 저장되는 공간
  • module : CVS는 저정소 하나에 모듈을 여러개 둘 수 있었는데 Subversion은 모듈이란 개념이 없다. 대신 모듈보다 디렉토리를 사용한다.

Continue reading “버젼관리(Subverion 위주) 관련 용어집”


Jun 17 2009

GD Library 설정하기

분류: Apache2, Server, Ubuntu, Web Server최 태현 @ 2:08 오후

# sudo apt-get install php5-gd

Tags: ,


Jun 16 2009

깜찍이 땡깡공주

분류: Family, Ubuntu최 태현 @ 4:20 오후

우리 둘째 공주님이 이렇게 컸네요.
아빠의 무관심으로 사진을 많이 못찍어줘서 미안한 마음입니다. 가끔은 땡깡공주로 악명을 떨치지만 아빠는 마냥 이쁘기만 합니다. 아랫잎술을 위로 올리고 푸~푸~ 거리면 삐진겁니다. 이때는 가급적 건드리지 말아 주세요. 어린이집 선생님의 말씀이랍니다.

말은 너무 잘 해서 깜짝 깜짝 놀랍니다. 아빠 담배피운다고 엄마한테 이르고 악어물총에 물 넣어가지고 와서는 뿌려대는데 워찌 할까요? 담배를 끊어야 할까요? 콜라 마시면 또 엄마한테 일러대는 배신자 윤형이~~~!

엄마한테 혼내면 앵~~~ 하면서 달려오지만 너무나 이쁩니다.
이녀석을 쳐다보고 있으면 행복이 보입니다.
하느님께 감사드립니다.
이렇게 이쁜 공주를 보내주셔서….

Tags: ,


Jun 12 2009

Oracle xe 환경설정하기(Tora 접속방법)

분류: Database, How to, Ubuntu최 태현 @ 4:21 오전
  1. Go to the following directory:

    /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

  2. Look for the following scripts:
    • oracle_env.csh (for C or tcsh shell)
    • oracle_env.sh (for Bourne, Bash, or Korn shell)
  3. Run the appropriate script for your shell. For example:
    • Bourne, Bash, or Korn shell:
      $ . ./oracle_env.sh
    • C or tcsh shell:
      % source oracle_env.csh

You may also want edit your login or profile files so that these environment variables are set properly each time you log in or open a new shell.

For Bourne, Bash, or Korn shell, enter the following line into the .bash_profile (to log in) or .bashrc file (to open a new shell):

. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

For C or tcsh shell, enter the following line into the .login file (to log in) or .cshrc file (to open a new shell):

source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.csh

Tags: ,


Jun 12 2009

Oracle 접속오류 해결방법

분류: Database, How to최 태현 @ 1:47 오전

Why I got ORA-27121: unable to determine size of
shared memory segment ?

A. The full erros stack:
ERROR:
ORA-01034: ORACLE not available
ORA-27121: unable to determine size of shared memory
segment
Linux Error: 13: Permission denied

This is caused by Oracle installer not setting setuid
on $ORACLE_HOME/bin/oracle.

To fix do:
$ cd $ORACLE_HOME/bin
$ chmod 6751 oracle

Tags: , ,


Jun 11 2009

Tora With Oracle, MySQL

분류: Database, Desktop, How to최 태현 @ 9:54 오후

The “tora” database client package in Feisty Fawn comes with Postgres support, and MySQL if you have the libraries. This How-To shows you how to build Oracle Instantclient 10g support into tora.

This is client only. You will not install the whole Oracle database.

BTW, if you don’t have time to build the whole thing, here is the .deb package I built using this How-To. It’s x386 only, and you’ll need to have instantclient installed before you can use it.

tora_1.3.22-5_i386.deb is an updated .deb package for instantclient 11.1.0.1 and tora 1.3.22.

Continue reading “Tora With Oracle, MySQL”

Tags: , ,


Jun 11 2009

Oracle 10g 설치하기

분류: Database, How to, Ubuntu최 태현 @ 8:42 오후

OCI를 ubuntu에서 설치해보고 아예 오라클 자체를 Desktop에 설치하고 study할때 써보기로 맘 먹었습니다.

  • $ sudo vi /etc/sources.list <- 다음 라인을 맨 끝에 추가
  • deb http://oss.oracle.com/debian unstable main non-free
  • $ sudo wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle  -O- | sudo apt-key add -
    $ sudo apt-get update
    $ sudo apt-get install oracle-xe-universal
  • $ sudo /etc/init.d/oracle-xe configure <- 웹 관리 포트 및 리스너 포트, 비밀번호 등을 설정. sid는 기본 xe로 설정되어 있음.
  • $ 웹 브라우저에서 http://localhost:8080/apex 로 접속해서 시험해본다.
  • $ sudo vi /etc/environment
    ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
    PATH=$PATH:$ORACLE_HOME/bin
    export ORACLE_HOME
    export ORACLE_SID=XE
    export NLS_LANG=’KOREAN_KOREA.AL32UTF8
  • $ source /etc/environment
  • $ sqlplus ’sys /as sysdba’ 로 접속해서 테스트 해본다.
  • $ sudo /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh

첫줄의 #!/bin/sh를 #!/bin/bash로 변경한다.

참고사이트 : http://nameslayer.tistory.com/286

http://ids.snu.ac.kr/wiki/Oracle_Express_Edition

Tags: ,


Jun 11 2009

PHP + OCI8 설치

분류: Apache2, Desktop, How to, Web Server최 태현 @ 7:43 오후

도서관리시스템(KOLAS)이 오라클 DB를 사용해서 홈페이지 개발시 oracle instant client를 설치 했습니다.

  • $ sudo apt-get install build-essential php5-dev php-pear alien
  • Oracle 에서 Instant client 프로그램(instantclient-basic, instantclient-SDK)를 다운받는다. deb 파일 전환을 위해 rpm 파일을 다운받는다.
  • $ sudo alien -k oracle-instantclient-basic-10.2.0.4-1.i386.rpm
  • $ sudo alien -k oracle-instantclient-devel-10.2.0.4-1.i386.rpm
  • $ sudo dpkg -i oracle-instantclient-basic_10.2.0.4-1_i386.deb
  • $ sudo dpkg -i oracle-instantclient-devel_10.2.0.4-1_i386.deb
  • $ sudo pecl install oci8 ; pecl로 php rebuild

Continue reading “PHP + OCI8 설치”

Tags: , ,


뒷 쪽 »