9.脚本别名
在主配置文件中找到定义脚本别名的区域添加一行
ScriptAlias/cgi-bin/ "/website/cgi-bin/"
#mkdir–pv /website/cgi-bin/
#vim/website/cgi-bin/test.sh
#!/bin/bash
cat../../var/log/httpd
lrwxrwxrwx.1 root root 29 Aug 10 08:38 modules-> ../../usr/lib64/httpd/modules
lrwxrwxrwx.1 root root 19 Aug 10 08:38 run ->../../var/run/httpd自建CA
[root@stu2CA]# cd private/
[root@stu2private]# (umask 077;openssl genrsa -out cakey.pem 2048)
GeneratingRSA private key, 2048 bit long modulus
...................+++
......+++
e is 65537(0x10001)
[root@stu2private]# cd ..
[root@stu2CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 3656
You areabout to be asked to enter information that will be incorporated
into yourcertificate request.
What youare about to enter is what is called a Distinguished Name or a DN.
There arequite a few fields but you can leave some blank
For somefields there will be a default value,
If youenter '.', the field will be left blank.
-----
CountryName (2 letter code) [XX]:CN
State orProvince Name (full name) []:henan
LocalityName (eg, city) [Default City]:zhengzhou
OrganizationName (eg, company) [Default Company Ltd]:apachessl
OrganizationalUnit Name (eg, section) []:tech
Common Name(eg, your name or your server's hostname) []:www.magedu.com
EmailAddress []:
[root@stu2CA]# ls
cacert.pem certs crl newcerts private
[root@stu2CA]# touch serial index.txt
[root@stu2CA]# echo 01 > serial
[root@stu2CA]# ls
cacert.pem certs crl index.txt newcerts private serial
[root@stu2 ssl]# (umask 077;openssl genrsa-out httpd.key 2048)
GeneratingRSA private key, 2048 bit long modulus
..........+++
.......................+++
eis 65537 (0x10001)
[root@stu2ssl]# openssl req -new -key httpd.key -out httpd.csr -days 3656
Youare about to be asked to enter information that will be incorporated
intoyour certificate request.
Whatyou are about to enter is what is called a Distinguished Name or a DN.
Thereare quite a few fields but you can leave some blank
Forsome fields there will be a default value,
Ifyou enter '.', the field will be left blank.
-----
CountryName (2 letter code) [XX]:CN
Stateor Province Name (full name) []:henan
LocalityName (eg, city) [Default City]:zhengzhou
OrganizationName (eg, company) [Default Company Ltd]:apachessl
OrganizationalUnit Name (eg, section) []:tech
CommonName (eg, your name or your server's hostname) []:www.hailian.com
EmailAddress []:
Pleaseenter the following 'extra' attributes
tobe sent with your certificate request
Achallenge password []:
Anoptional company name []:
[root@stu2ssl]# ls
httpd.csr httpd.key
[root@stu2ssl]# openssl ca -in httpd.csr -out httpd.crt -days 3656
Usingconfiguration from /etc/pki/tls/openssl.cnf
Checkthat the request matches the signature
Signatureok
CertificateDetails:
Serial Number: 2 (0x2)
Validity
Not Before: Aug 23 20:54:06 2013GMT
Not After : Aug 27 20:54:06 2023 GMT
Subject:
countryName = CN
stateOrProvinceName = henan
organizationName = apachessl
organizationalUnitName = tech
commonName = www.hailian.com
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
42:E4:0D:53:42:1C:E4:B3:9E:DE:87:4D:D7:46:D8:C3:EB:6B:32:4E
X509v3 Authority Key Identifier:
keyid:C7:08:F5:87:6E:E3:7E:AA:21:6F:0A:C2:42:07:3B:18:7A:B7:5F:55
Certificateis to be certified until Aug 27 20:54:06 2023 GMT (3656 days)
Signthe certificate? [y/n]:y
1out of 1 certificate requests certified, commit? [y/n]y
Writeout database with 1 new entries
DataBase Updated 修改ssl.conf配置文件
DocumentRoot"/web/host1"
ServerNamewww.hailian.com
SSLCertificateFile/etc/httpd/conf/ssl/httpd.crt
SSLCertificateKeyFile/etc/httpd/conf/ssl/httpd.key
修改httpd.conf文件