Jump to content
sleed

Cum sa ai HTTPS la Site [Tutorial]

Recommended Posts

Salut. In acest tutorial voi arata cum sa aveti https la site, cu certificat ssl, sa fie mai securizabil:)[Nimic nu este securizabil, orice are o vulnerabilitate]. In fine.. sa trecem la treaba :

1. II dam un

sudo apt-get update && sudo apt-get upgrade

, sa avem totul upgradat la zi, pe serverul nostru / statia de lucru.

2.

apt-get install apache2 ssl-cert

, instalam certificatul pentru apache2..

3.

mkdir -p /etc/apache2/ssl

, facem un director pentru certificat

4.Ca sa ,,instalam'' certificatul, rulam :

sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem

5. Avem grija , sa stergem # unde scrie port 443 , exemplu :

-----------------------------------------------------------------------------------------

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

6.In fisierul /etc/apache2/apache2.conf , il deschidem cu nano si adaugam la sfarsit :

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem

Nota: Recomand sa adaugam si urmatoarele pentru a ascunde ce tip de server este, sau pentru a nu lasa indexarea pe server, sa sara oamenii nostri de la un folder la altul, chiar daca sunt permisii pe acestea

ServerSignature Off

ServerTokens Prod

<Directory /var/www/html>

Options -Indexes

Options -FollowSymLinks

</Directory>

7.Dam un restart la apache,

sudo /etc/init.d/apache2 restart

sau

service apache2 restart

.

/Sa avem grija sa avem mod rewrite enable :

sudo a2enmod rewrite
sa fortam HTTPS pentru site :) Putem sa adaugam in .htaccess si urmatoarele :

RewriteEngine On

RewriteCond %{HTTPS} !=on

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Cam atat baieti :) Sa va fie de folos.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...