View difference between Paste ID: wSeHFheC and fhd38u12
SHOW: | | - or go back to the newest paste.
1
Server Log Install Https
2
3
apt-get -y install apache2
4
5
Generate A certificate
6
7
mkdir /etc/apache2/ssl
8
cd /etc/apache2/ssl
9
openssl req -x509 -days 365 -newkey rsa:1024 -keyout hostkey.key -nodes -out hostcert.pem
10
11
--------------
12
Generating a 1024 bit RSA private key
13
...........++++++
14
......++++++
15
writing new private key to '/etc/apache2/ssl/hostcert.pem'
16
-----
17
You are about to be asked to enter information that will be incorporated
18
into your certificate request.
19
What you are about to enter is what is called a Distinguished Name or a DN.
20
There are quite a few fields but you can leave some blank
21
For some fields there will be a default value,
22
If you enter '.', the field will be left blank.
23
-----
24
Country Name (2 letter code) [AU]:ID
25
State or Province Name (full name) [Some-State]:West Java
26
Locality Name (eg, city) []:Bandung
27
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Hade Network
28
Organizational Unit Name (eg, section) []:Hade Warnet
29
Common Name (eg, YOUR name) []:Wandi Budiana
30
Email Address []:[email protected]
31
root@debian:~#
32
------------------------
33
34
chmod 700 *
35
36
nano /etc/apache2/sites-available/default-ssl
37
//update the following:
38
39
SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
40
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
41
42
with :
43
44
SSLCertificateFile    /etc/apache2/ssl/hostcert.pem
45
SSLCertificateKeyFile /etc/apache2/ssl/hostkey.key
46
47
ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/000-default-ssl 
48
a2enmod ssl
49
/etc/init.d/apache2 restart or /etc/init.d/apache2/force-reload