Erinevus lehekülje "Apache ssl" redaktsioonide vahel
Allikas: Kuutõrvaja
36. rida: | 36. rida: | ||
kuulab :] | kuulab :] | ||
+ | |||
+ | |||
+ | Apache httpd.conf'i võib luua sarnaselt | ||
+ | |||
+ | Listen 443 | ||
+ | NameVirtualHost ip-aadress:443 | ||
+ | |||
+ | <VirtualHost ip-aadress:443> | ||
+ | ServerName www.nimi.ee | ||
+ | DocumentRoot /home/nimi | ||
+ | |||
+ | SSLEngine on | ||
+ | SSLCertificateFile /usr/local/etc/apache22/ssl.crt/nimi.ee.crt | ||
+ | SSLCertificateKeyFile /usr/local/etc/apache22/ssl.key/nimi.ee.key | ||
+ | |||
+ | </VirtualHost> |
Redaktsioon: 16. oktoober 2007, kell 14:20
Apache ssl ajutise self-signed sertifikaadi genereerimine
Näite aluseks FreeBSD
mkdir /usr/local/etc/apache2/ssl.key/ mkdir /usr/local/etc/apache2/ssl.crt/
openssl genrsa -des3 -out server.key 1024 openssl req -new -key server.key -out server.csr openssl x509 -req -days 300 -in server.csr -signkey server.key -out server.crt openssl rsa -in server.key -out server.key
cp server.key /usr/local/etc/apache2/ssl.key/ cp server.crt /usr/local/etc/apache2/ssl.crt/ chmod 0400 /usr/local/etc/apache2/ssl.key/server.key chmod 0400 /usr/local/etc/apache2/ssl.crt/server.crt
Lisame FreeBSD's faili /etc/rc.local rea
apache2ssl_enable="YES"
Käivitame apache ssl toega
apachectl sslstart
Kontrollime käsuga sockstat, kas kuulab?
ftp# sockstat | grep 443 www httpd 20720 4 tcp46 *:443 *:* www httpd 20709 4 tcp46 *:443 *:* www httpd 20020 4 tcp46 *:443 *:* www httpd 20019 4 tcp46 *:443 *:*
kuulab :]
Apache httpd.conf'i võib luua sarnaselt
Listen 443 NameVirtualHost ip-aadress:443
<VirtualHost ip-aadress:443> ServerName www.nimi.ee DocumentRoot /home/nimi SSLEngine on SSLCertificateFile /usr/local/etc/apache22/ssl.crt/nimi.ee.crt SSLCertificateKeyFile /usr/local/etc/apache22/ssl.key/nimi.ee.key </VirtualHost>