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

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

被折叠的 条评论
为什么被折叠?



