개발/Linux 계열

httpd_2.0.55 with mod_ssl

좋은느낌/원철 2009. 6. 11. 17:42

httpd_2.0.55 with mod_ssl PHP 

2006/05/18 11:21

복사 http://blog.naver.com/jjy8476/70004318523

./apache_install 옵션 추가

--enable-ssl \
--with-ssl=/usr/share/ssl/lib (rpm으로 설치된경우)

 

 

 

./apache_install

make

make install

 

아파치 설정파일을 수정한다. 
#: cd /usr/local/apache 
#: vi conf/httpd.conf

 

Change the following line: 
 Group #-1 => Group nobody

 

Default 시작페이지 설정을 수정해 줍니다
Documentroot "/var/www/html"

DirectoryIndex index.php index.php3  index.html index.htm

Section 2의 단락에서 아래 내용을 추가합니다.
................................
# And for PHP 4.x, use:
AddType application/x-httpd-php .php .php3 .inc .ph .htm
AddType application/x-httpd-php-source .phps
.................................

환경설정 수정후 저장을 합니다.
$ /usr/local/apache/bin/httpd -t        엔터를 두드리고  다음과 같은 메시지만 있으면 아파치 환경이 잘 설정되었습니다.
Syntax OK  

 

아파치 서버를 시작한다.
#: /usr/local/apache/bin/apachectl start

 

 

SSL Key and Certificate 만든다. 
(.key 생성)

openssl genrsa -des3 1024 > /usr/local/apache/conf/localhost.key

 

(.csr 생성)

openssl req -new -key /usr/local/apache/conf/localhost.key > \ 
/usr/local/apache/conf/localhost.csr

 

(.crt 생성)

openssl req -x509 -days 3650 -key \ 
/usr/local/apache/conf/localhost.key \ 
-in /usr/local/apache/conf/localhost.csr > \ 
/usr/local/apache/conf/localhost.crt

 

vi /usr/local/apache/conf/ssl.conf

Find the following lines in the ssl.conf file: 
DocumentRoot "/usr/local/apache/htdocs" 
ServerName new.host.name:443 
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt 
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key

 

Change the respective lines so that they are as follows: 
DocumentRoot "/usr/local/apache/htdocs-secure" 
ServerName localhost:443 
SSLCertificateFile /usr/local/apache/conf/localhost.crt 
SSLCertificateKeyFile /usr/local/apache/conf/localhost.key


#: mkdir /usr/local/apache2/htdocs-secure

 

Create a simple home page (e.g. Home, Secure Home) 
#: vi /usr/local/apache/htdocs-secure/index.html 
Save index.html and exit vi 
#: chmod a+rx /usr/local/apache/htdocs-secure/ 
#: chmod a+r /usr/local/apache/htdocs-secure/index.html

 

Remove the encryption from the RSA private key 
#: cd /usr/local/apache/conf 
#: cp localhost.key server.key.org 
#: /usr/local/ssl/bin/openssl rsa -in server.key.org -out localhost.key 
#: chmod 400 localhost.key

 

Test the Apache https server. 
#: /usr/local/apache/bin/apachectl stop 
#: /usr/local/apache/bin/apachectl startssl

 

 

 

 

php install

./php_install

[출처] httpd_2.0.55 with mod_ssl|작성자 지우맘