Centos apache ssl+php support

1
yum install php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml httpd mod_ssl mod_php mysql-server

Generate certs:


openssl genrsa -des3 -rand file1:file2:file3:file4:file5 -out server.key 1024

openssl rsa -in server.key -out server.pem

openssl req -new -key server.key -out server.csr

openssl req -new -key server.key -out server.csr

openssl x509 -req -days 3600 -in server.csr -signkey server.key -out server.crt

Move certs to:

/etc/ssl/certs/

Remove the pass:

openssl rsa -in server.key -out server.key.nopass

————-

vim /etc/httpd/conf/httpd.conf

LoadModule ssl_module modules/mod_ssl.so

LoadModule php5_module modules/libphp5.so

NameVirtualHost *:443

Listen 443

ServerAdmin webmaster@dummy-host.example.com

DocumentRoot /var/www/html

ServerName localhost

ErrorLog logs/dummy-host.example.com-error_log

CustomLog logs/dummy-host.example.com-access_log common

AddHandler php5-script .php

DirectoryIndex index.php

AddType application/x-httpd-php .php

SSLProxyEngine on

SSLEngine on

SSLCertificateFile /etc/ssl/certs/server.crt

SSLCertificateKeyFile /etc/ssl/certs/server.key

AllowOverride All

 


Похожие записи:

Оставить комментарий

Ваш e-mail не будет опубликован. Обязательные поля отмечены *