728x90

 

If you see the following error while compiling nginx from source, follow the steps below:

1
2
3
4
5
6
checking for perl
 + perl version: This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
Can't locate ExtUtils/Embed.pm in @INC (you may need to install the ExtUtils::Embed module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5).
BEGIN failed--compilation aborted.


./configure: error: perl module ExtUtils::Embed is required

Issue the following by command:

1 yum install perl-ExtUtils-Embed

Result:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
[root@CentOS-82-64-minimal nginx-1.14.1]# yum install perl-ExtUtils-Embed
Last metadata expiration check: 2:06:33 ago on Wed 08 Jul 2020 06:31:28 AM CEST.
Dependencies resolved.
================================================================================
 Package                       Arch     Version               Repository   Size
================================================================================
Installing:
 perl-ExtUtils-Embed           noarch   1.34-416.el8          AppStream    79 k
Installing dependencies:
 perl-CPAN-Meta-Requirements   noarch   2.140-396.el8         AppStream    37 k
 perl-CPAN-Meta-YAML           noarch   0.018-397.el8         AppStream    34 k
 perl-ExtUtils-Command         noarch   1:7.34-1.el8          AppStream    19 k
 perl-ExtUtils-Install         noarch   2.14-4.el8            AppStream    46 k
 perl-ExtUtils-MakeMaker       noarch   1:7.34-1.el8          AppStream   300 k
 perl-ExtUtils-Manifest        noarch   1.70-395.el8          AppStream    37 k
 perl-ExtUtils-ParseXS         noarch   1:3.35-2.el8          AppStream    83 k
 perl-JSON-PP                  noarch   1:2.97.001-3.el8      AppStream    68 k
 perl-Math-BigInt              noarch   1:1.9998.11-7.el8     BaseOS      196 k
 perl-Math-Complex             noarch   1.59-416.el8          BaseOS      108 k
 perl-Test-Harness             noarch   1:3.42-1.el8          AppStream   279 k
 perl-devel                    x86_64   4:5.26.3-416.el8      AppStream   599 k
 perl-version                  x86_64   6:0.99.24-1.el8       AppStream    67 k
 python3-pyparsing             noarch   2.1.10-7.el8          BaseOS      142 k
 systemtap-sdt-devel           x86_64   4.2-6.el8             AppStream    81 k
Installing weak dependencies:
 perl-CPAN-Meta                noarch   2.150010-396.el8      AppStream   191 k
 perl-Encode-Locale            noarch   1.05-9.el8            AppStream    21 k
 perl-Time-HiRes               x86_64   1.9758-1.el8          AppStream    61 k


Transaction Summary
================================================================================
Install  19 Packages


Total download size: 2.4 M
Installed size: 7.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/19): perl-CPAN-Meta-YAML-0.018-397.el8.noarc 421 kB/s |  34 kB     00:00
(2/19): perl-CPAN-Meta-Requirements-2.140-396.e 425 kB/s |  37 kB     00:00
(3/19): perl-Encode-Locale-1.05-9.el8.noarch.rp 795 kB/s |  21 kB     00:00
(4/19): perl-ExtUtils-Command-7.34-1.el8.noarch 589 kB/s |  19 kB     00:00
(5/19): perl-CPAN-Meta-2.150010-396.el8.noarch. 1.4 MB/s | 191 kB     00:00
(6/19): perl-ExtUtils-Install-2.14-4.el8.noarch 1.5 MB/s |  46 kB     00:00
(7/19): perl-ExtUtils-Embed-1.34-416.el8.noarch 1.4 MB/s |  79 kB     00:00
(8/19): perl-ExtUtils-Manifest-1.70-395.el8.noa 1.2 MB/s |  37 kB     00:00
(9/19): perl-ExtUtils-MakeMaker-7.34-1.el8.noar 5.5 MB/s | 300 kB     00:00
(10/19): perl-ExtUtils-ParseXS-3.35-2.el8.noarc 2.9 MB/s |  83 kB     00:00
(11/19): perl-JSON-PP-2.97.001-3.el8.noarch.rpm 2.2 MB/s |  68 kB     00:00
(12/19): perl-Time-HiRes-1.9758-1.el8.x86_64.rp 2.2 MB/s |  61 kB     00:00
(13/19): perl-Test-Harness-3.42-1.el8.noarch.rp 5.2 MB/s | 279 kB     00:00
(14/19): perl-version-0.99.24-1.el8.x86_64.rpm  2.4 MB/s |  67 kB     00:00
(15/19): systemtap-sdt-devel-4.2-6.el8.x86_64.r 3.0 MB/s |  81 kB     00:00
(16/19): perl-Math-BigInt-1.9998.11-7.el8.noarc 2.7 MB/s | 196 kB     00:00
(17/19): perl-devel-5.26.3-416.el8.x86_64.rpm   5.0 MB/s | 599 kB     00:00
(18/19): perl-Math-Complex-1.59-416.el8.noarch. 1.7 MB/s | 108 kB     00:00
(19/19): python3-pyparsing-2.1.10-7.el8.noarch. 9.4 MB/s | 142 kB     00:00
--------------------------------------------------------------------------------
Total                                           6.1 MB/s | 2.4 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : perl-version-6:0.99.24-1.el8.x86_64                   1/19
  Installing       : perl-CPAN-Meta-Requirements-2.140-396.el8.noarch      2/19
  Installing       : perl-Time-HiRes-1.9758-1.el8.x86_64                   3/19
  Installing       : perl-ExtUtils-ParseXS-1:3.35-2.el8.noarch             4/19
  Installing       : perl-Test-Harness-1:3.42-1.el8.noarch                 5/19
  Installing       : python3-pyparsing-2.1.10-7.el8.noarch                 6/19
  Installing       : systemtap-sdt-devel-4.2-6.el8.x86_64                  7/19
  Installing       : perl-Math-Complex-1.59-416.el8.noarch                 8/19
  Installing       : perl-Math-BigInt-1:1.9998.11-7.el8.noarch             9/19
  Installing       : perl-JSON-PP-1:2.97.001-3.el8.noarch                 10/19
  Installing       : perl-ExtUtils-Manifest-1.70-395.el8.noarch           11/19
  Installing       : perl-ExtUtils-Command-1:7.34-1.el8.noarch            12/19
  Installing       : perl-Encode-Locale-1.05-9.el8.noarch                 13/19
  Installing       : perl-CPAN-Meta-YAML-0.018-397.el8.noarch             14/19
  Installing       : perl-CPAN-Meta-2.150010-396.el8.noarch               15/19
  Installing       : perl-devel-4:5.26.3-416.el8.x86_64                   16/19
  Installing       : perl-ExtUtils-Install-2.14-4.el8.noarch              17/19
  Installing       : perl-ExtUtils-MakeMaker-1:7.34-1.el8.noarch          18/19
  Installing       : perl-ExtUtils-Embed-1.34-416.el8.noarch              19/19
  Running scriptlet: perl-ExtUtils-Embed-1.34-416.el8.noarch              19/19
  Verifying        : perl-CPAN-Meta-2.150010-396.el8.noarch                1/19
  Verifying        : perl-CPAN-Meta-Requirements-2.140-396.el8.noarch      2/19
  Verifying        : perl-CPAN-Meta-YAML-0.018-397.el8.noarch              3/19
  Verifying        : perl-Encode-Locale-1.05-9.el8.noarch                  4/19
  Verifying        : perl-ExtUtils-Command-1:7.34-1.el8.noarch             5/19
  Verifying        : perl-ExtUtils-Embed-1.34-416.el8.noarch               6/19
  Verifying        : perl-ExtUtils-Install-2.14-4.el8.noarch               7/19
  Verifying        : perl-ExtUtils-MakeMaker-1:7.34-1.el8.noarch           8/19
  Verifying        : perl-ExtUtils-Manifest-1.70-395.el8.noarch            9/19
  Verifying        : perl-ExtUtils-ParseXS-1:3.35-2.el8.noarch            10/19
  Verifying        : perl-JSON-PP-1:2.97.001-3.el8.noarch                 11/19
  Verifying        : perl-Test-Harness-1:3.42-1.el8.noarch                12/19
  Verifying        : perl-Time-HiRes-1.9758-1.el8.x86_64                  13/19
  Verifying        : perl-devel-4:5.26.3-416.el8.x86_64                   14/19
  Verifying        : perl-version-6:0.99.24-1.el8.x86_64                  15/19
  Verifying        : systemtap-sdt-devel-4.2-6.el8.x86_64                 16/19
  Verifying        : perl-Math-BigInt-1:1.9998.11-7.el8.noarch            17/19
  Verifying        : perl-Math-Complex-1.59-416.el8.noarch                18/19
  Verifying        : python3-pyparsing-2.1.10-7.el8.noarch                19/19


Installed:
  perl-CPAN-Meta-2.150010-396.el8.noarch
  perl-CPAN-Meta-Requirements-2.140-396.el8.noarch
  perl-CPAN-Meta-YAML-0.018-397.el8.noarch
  perl-Encode-Locale-1.05-9.el8.noarch
  perl-ExtUtils-Command-1:7.34-1.el8.noarch
  perl-ExtUtils-Embed-1.34-416.el8.noarch
  perl-ExtUtils-Install-2.14-4.el8.noarch
  perl-ExtUtils-MakeMaker-1:7.34-1.el8.noarch
  perl-ExtUtils-Manifest-1.70-395.el8.noarch
  perl-ExtUtils-ParseXS-1:3.35-2.el8.noarch
  perl-JSON-PP-1:2.97.001-3.el8.noarch
  perl-Math-BigInt-1:1.9998.11-7.el8.noarch
  perl-Math-Complex-1.59-416.el8.noarch
  perl-Test-Harness-1:3.42-1.el8.noarch
  perl-Time-HiRes-1.9758-1.el8.x86_64
  perl-devel-4:5.26.3-416.el8.x86_64
  perl-version-6:0.99.24-1.el8.x86_64
  python3-pyparsing-2.1.10-7.el8.noarch
  systemtap-sdt-devel-4.2-6.el8.x86_64


Complete!

done!

728x90

To make sure that your visitors always will be using an secured connection to your website, you have to redirect visitors that are making the first connection via HTTP. Here we make use of the permanent HTTP redirect code (HTTP status 301).

The following steps describe the configuration of Nginx to have the website loaded completely over HTTPS. Please read our background information on Securing your complete website with SSL

Configuring HTTPS per website

To comply with the specs you should first redirect visitors entering via HTTP to HTTPS. We need to configure this per worker (website), the configuration file for your site probably sits in /etc/nginx/sites-available/.

 

server {
       listen         80;
       server_name    www.servercertificates.com;
       return         301 https://$server_name$request_uri;
}

Note that the server_name needs to be changed to your own domainname and the HTTPS version of your site is available, before creating the redirect.

728x90

Bot인 경우에 대비해서 이 차이를 정확히 명시해 주어야 합니다.(예를 들어, 웹 크롤러가 301을 반환받았다면 검색엔진의 Indexing된 주소를 수정할 것입니다.)

 

이 Redirection은 접속하려는 사용자에게 HTTPS를 통한 접속을 강제하려 할 때에도 유용하게 사용할 수 있습니다. 예를 들어, 다음과 같이 설정파일을 작성하면 http://tuwlab.com 으로 접속하려는 사용자를 https://tuwlab.com 으로 강제 Redirection 시킵니다.

?

server
{
    listen      80;
    server_name tuwlab.com;
    return 301 https://$server_name$request_uri;
}

 

뭐, 다음과 같이 스크립트를 통해서 수동으로 Redirection을 해 줄 수도 있지만,

?

<script>
    document.location.href = "{Redirection 주소}";
</script>

이 경우 페이지를 이동하는 과정에 사용에게 순간적으로 노출이 되고, 자바스크립트를 꺼 놓은 경우 흰색의 빈 화면만 달랑 표시되고 아무 일도 일어나지 않게 됩니다. 더 큰 문제점은 이런 식으로 Redirection을 하면 검색엔진에서 크롤링을 하지 않거나, 스팸 사이트로 분류할수도 있다는 점입니다.

따라서 이동된 페이지에 대해서는 HTTP Status Code를 사용해서 정확히 무슨 일이 일어났는지 Client측에 알려주도록 해야 합니다.

728x90

Linux SSL Trouble Shooting

[에러구문]

cannot load certificate key "/home/SSL/201810/key.pem": PEM_read_bio_PrivateKey() failed 

(SSL: error:0906406D:PEM routines:PEM_def_callback:problems getting password error:0906A068:PEM routines:PEM_do_header:bad password read)

 

[처리방법]

openssl rsa -in [기존인증서파일].key -out [새로운인증서파일].key

openssl 로 접근하게 되면 key에 대한 pass-phrase 를 물어본다. 이 경우 비밀번호를 넣었을 때 복호화에 성공하면 새로운 키를 -out 으로 생성하게 된다.

+ Recent posts