RHCE254 3

这篇博客介绍了如何配置服务器,包括使用iptables设置输入规则,编辑xinetd.d/tftp文件,以及配置虚拟主机。接着,安装mod_ssl并编辑ssl.conf文件,创建并验证SSL证书,最后重启httpd服务以应用变更。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

 

vim /etc/xinetd.d/tftp

 

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

NameVirtualHost *:80
<VirtualHost *:80>
        ServerName station3.example.com
        DocumentRoot /website_station
</VirtualHost>
<VirtualHost *:80>
        ServerName www3.example.com
        DocumentRoot /website_www
</VirtualHost>

 

 

yum install mod_ssl

vim /etc/httpd/conf.d/ssl.conf

84 DocumentRoot "/var/www/html"
 85 ServerName station3.example.com:443

 

[root@station3 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@station3 ~]# cd /etc/pki/tls/certs
[root@station3 certs]# make apache.pem

 

Country Name (2 letter code) [GB]:CN
State or Province Name (full name) [Berkshire]:Guangdong
Locality Name (eg, city) [Newbury]:Shenzhen
Organization Name (eg, company) [My Company Ltd]:KEYSMART
Organizational Unit Name (eg, section) []:RHCE
Common Name (eg, your name or your server's hostname) []:station3.example.com

 cp apache.pem /etc/pki/tls/private/

 

112 SSLCertificateFile /etc/pki/tls/certs/apache.pem
113
114 #   Server Private Key:
115 #   If the key is not combined with the certificate, use this
116 #   directive to point at the key file.  Keep in mind that if
117 #   you've both a RSA and a DSA private key you can configure
118 #   both in parallel (to also allow the use of DSA ciphers, etc.)
119 SSLCertificateKeyFile /etc/pki/tls/private/apache.pem

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值