Apr 08 2010

Mac OS X Snow Leopard : PHP + OCI8

분류: .Mac, Apache2, Oracle, PHP, Server최 태현 @ 10:55 오전

Mac OS X Snow Leopard 에서 Oracle 10.g 설치하기 를 통해 Oracle을 설치했다는 전제하에 PHP에 OCI8을 설치하는 방법입니다.

먼저 OCI8 module이 제대로 설치되어 있는지 확인합니다.

env  |  grep  -­E  ”(ORACLE)|(DYLD)”

ORACLE_SID=y2love
ORACLE_BASE=/Users/Y2Love
DYLD_LIBRARY_PATH=/Users/oracle/oracle/product/10.2.0/db_1/lib
ORACLE_HOME=/Users/oracle/oracle/product/10.2.0/db_1

와 같이 나오면 됩니다.

Continue reading “Mac OS X Snow Leopard : PHP + OCI8″


Dec 19 2009

Apache2 Error…

분류: Apache2, How to, Server, Ubuntu, Web Server최 태현 @ 10:24 오전

시스템 upgrade후 다음과 같은 오류메세지가 나오면서 apache 접속이 되지 않았다. 그 이유는??? 아직 모르겠다.

starting httpd: (98)address already in use: make_sock: could not bind to address [::]:80
(98)address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
unable to open logs
[failed]

어째든 80port를 무언가 잡아먹는것 같아서 확인해 보니까

$ sudo netstat -anp | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3836/apache2
unix  2      [ ACC ]     STREAM     LISTENING     6380     2540/amavisd (maste /var/lib/amavis/amav

apache2가 왜그런지 모르게 별도로 뜨고 있었다. 우선 다음과 같이 Process를 kill하고 다시 올렸다. 시간있을때 이유를 찾아봐야 겠다.

$ ps aux|grep 3836/apache2
solove    4360  0.0  0.0   3368   800 pts/0    R<+  10:10   0:00 grep 3836/apache2
solove@sage:~$ ps aux|grep apache2
root      3820  0.0  0.0   1872   588 tty8     S+   10:03   0:00 /bin/sh -e /etc/rc2.d/S91apache2 start
root      3831  0.0  0.0   1872   532 tty8     S+   10:03   0:00 /bin/sh /usr/sbin/apache2ctl start
root      3836  0.0  0.2  24336  6584 tty8     S+   10:03   0:00 /usr/sbin/apache2 -k start
solove    4363  0.0  0.0   3368   796 pts/0    R<+  10:10   0:00 grep apache2

$ sudo killall apache2
$ ps aux|grep apache2
solove    4407  0.0  0.0   3368   800 pts/0    R<+  10:11   0:00 grep apache2
solove@sage:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2                                                                                                       Apache/2.2.11 mod_ssl/2.2.11 (Pass Phrase Dialog)
Some of your private key files are encrypted for security reasons.
In order to read them you have to provide the pass phrases.

Server trac.sourceforge.kr:443 (RSA)
Enter pass phrase:

OK: Pass Phrase Dialog successful.


Dec 01 2009

Windos XP에서 APM 설치하기

분류: Apache2, Desktop, PHP, mysql최 태현 @ 10:22 오전

1. Apache, MySQL, PHP 설치하기

1. Apache 설치하기

  • 윈도우용 Apache Download ( 저는 apache_2.2.14-win32-x86-openssl-0.9.8k.msi 를 받았습니다. )
  • Run the Apache Installer
Server Information 설정화면

Continue reading “Windos XP에서 APM 설치하기”

Tags: , , ,


Jul 04 2009

Apache Webserver 정보숨기기

분류: Apache2최 태현 @ 2:16 오전

httpd.conf 설정에 아래 내용을 원하는 형태로 추가하면 된다.

*아파치 버젼만 표시
ServerTokens Minimal

*아파치만 표시
ServerTokens ProductOnly

*아파치 버젼과 OS 표시
ServerTokens OS

*관련 정보 모두 표시
ServerToekns Full

Tags: ,


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 17 2009

GD Library 설정하기

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

# sudo apt-get install php5-gd

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: , ,


Jun 09 2009

HTTP Status 상태 코드별로 페이지 작성하기

분류: Apache2, How to, Web Server최 태현 @ 10:43 오전

일반적으로 웹호스팅을 받아보면 HTTP Status code page가 윈도우의 기본적인 그것이 아니라 깔끔하게 제작된 페이지를 본적이 있을 것입니다.
그것은 아파치에서(혹은 사용자가 [Override enabled]) 서버에러에 대한 응답을 지정해주어서 그렇습니다.

아파치 문서에 보면 ErrorDocument 부분이 정의되어 있으니 한번쯤 읽어보시면 이해하시기가 쉬우실 겁니다. 대략적으로 정리하면 총 3가지 방법으로 응답을 지정할 수가 있는데, 그것은 아래와 같습니다.
Continue reading “HTTP Status 상태 코드별로 페이지 작성하기”

Tags: ,


May 26 2009

SSL 인증서 HOWTO

분류: Apache2, Ubuntu, Web Server최 태현 @ 3:58 오후

http://wiki.kldp.org/wiki.php/DocbookSgml/SSL-Certificates-HOWTO 에 너무 잘올라와 있어서 그중 제가 필요하고 참고할 부분만 발췌했습니다.

1. SSL은 뭐고, 인증서는 뭔가?

Secure Socket Layer(SSL) 프로토콜은 넷스케이프사에서 웹서버와 브라우저 간의 보안 통신을 위해 만들어졌다. SSL은 통신할 때 인증기관(Certificate Authority, CA)라는 것을 이용해서 서로 인식하게끔 되어 있다. 이 과정을 간단하게 설명하면 다음과 같다. Continue reading “SSL 인증서 HOWTO”

Tags:


Apr 28 2009

Ubuntu Server and Apache2 Virtual Hosts

분류: Apache2, Ubuntu최 태현 @ 9:06 오후

1.  /etc/apache2/ports.conf

NameVirtualHost *:80

Listen 80

<IfModule mod_ssl.c>

    # SSL name based virtual hosts are not yet supported, therefore no

    # NameVirtualHost statement here

    Listen 443

</IfModule>

2. edit /etc/apache2/site-available/yourdomain.com
<VirtualHost *>
ServerName blogs.mydomain.org
ServerAdmin youremail@mydomain.org
…..
</virtualHost>
3. sudo a2ensite yourdomain.com
4. sudo /etc/init.d/apache2 reload

Tags: ,