搭建web网站

1,搭建一个静态网站

[root@localhost ~]# echo "welcome to openla.com" > /www/index.html

 2,给该网站下建立三个子网站

(1)先建立三个三个子目录

[root@localhost ~]# mkdir /www/openla/stdent
[root@localhost ~]# mkdir /www/openla/data
[root@localhost ~]# mkdir /www/openla/money

[root@localhost ~]# echo "stdent " > /www/openla/stdent/index.html
[root@localhost ~]# echo "money  " > /www/openla/money/index.html
[root@localhost ~]# echo "data  " > /www/openla/data/index.html

 (2)添加两个新用户

[root@localhost ~]# htpasswd -c /etc/httpd/user tian
New password: 
Re-type new password: 
Adding password for user tian
[root@localhost ~]# htpasswd  /etc/httpd/user song
New password: 
Re-type new password: 
Adding password for user song

 (3)更改主文件配置

(4)使用https加密,使用私钥进行加密

 

[root@localhost private]# openssl genrsa -AES128 2048 > money.key
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:

(5)新建证书

[root@localhost certs]# openssl req -utf8 -new -key  /etc/pki/tls/private/money.key 
Enter pass phrase for /etc/pki/tls/private/money.key:
Could not read private key from /etc/pki/tls/private/money.key
80DB8502B17F0000:error:1608010C:STORE routines:ossl_store_handle_load_result:unsupported:crypto/store/store_result.c:151:
80DB8502B17F0000:error:1C800064:Provider routines:ossl_cipher_unpadblock:bad decrypt:providers/implementations/ciphers/ciphercommon_block.c:124:
80DB8502B17F0000:error:11800074:PKCS12 routines:PKCS12_pbe_crypt_ex:pkcs12 cipherfinal error:crypto/pkcs12/p12_decr.c:86:maybe wrong password
[root@localhost certs]# openssl req -utf8 -new -key  /etc/pki/tls/private/money.key 
Enter pass phrase for /etc/pki/tls/private/money.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:86
State or Province Name (full name) []:shanxi
Locality Name (eg, city) [Default City]:xi'an
Organization Name (eg, company) [Default Company Ltd]:localhost
Organizational Unit Name (eg, section) []:money  
Common Name (eg, your name or your server's hostname) []:money@qq.com
Email Address []:money@QQ.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值