2024. április 26., péntek

Gyorskeresés

Útvonal

Cikkek » Számtech rovat

StartSSL és Apache

  • (f)
  • (p)
Írta: |

Hitelesített SSL tanúsítvány ingyen weblapodhoz: inkább te is okulj utóbbi hónapok adatkezelési botrányaiból!

[ ÚJ TESZT ]

Apache config

Elérkeztünk arra a pontra, amikor beállítjuk a certeket az Apache siteu-nkhoz.

FONTOS: MIELŐTT BÁRMIT MÓDOSÍTOTOK KÉSZÍTSETEK BIZTONSÁGI MENTÉST A FÁJLOKRÓL

Szükségünk van az ssl Apache modulra, amit az alábbi paranccsal tudunk aktiválni

a2enmod ssl
service apache2 restart

Most meg kell mondanunk az Apache-nak, hogy a 443-as HTTPS porton is fogadja a kéréseket, ehhez szerkesszük a /etc/apache/ports.conf fájlt.

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *:80
NameVirtualHost *:443
Listen 80

<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>

Szerkesszük az oldalunkhoz tartozó config fájlt
nano /etc/apache2/sites-enabled/oldalunk

Valahogy így kell majd kinéznie:

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory &quot;/usr/lib/cgi-bin&quot;>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ &quot;/usr/share/doc/&quot;
<Directory &quot;/usr/share/doc/&quot;>
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

<VirtualHost *:443>
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

SSLCertificateFile /etc/apache2/ssl/ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/private.key
SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory &quot;/usr/lib/cgi-bin&quot;>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ &quot;/usr/share/doc/&quot;
<Directory &quot;/usr/share/doc/&quot;>
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

A configban az elérési utakra figyeljetek!
SSLCertificateFile /etc/apache2/ssl/ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/private.key
SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem

Ezután indítsuk újra az Apacheot
service apache2 restart

A böngészőbe beírva a https://domainünk.hu címet máris titkosított a kapcsolat, melyet a böngészők a címsorban egy kis lakattal jeleznek.

Köszönöm a figyelmet, jó utánépítést!

Előzmények

Hirdetés

Copyright © 2000-2024 PROHARDVER Informatikai Kft.