1、安装httpd软件包:
yum install httpd
2、启动apache服务:
[root@redhat desktop]# /etc/init.d/httpd start
starting httpd: [ ok ]
3、安装mod-ssl软件包
[root@redhat desktop]# yum install mod_ssl –y
4、创建一个/date/www/html的目录、并且修改安全上下文:
chcon –t httpd_sys_content_t /date/ -r(l临时修改都行)
5、在/date/www/html下添加一个apache可执行的文件:
6、在/var/www/html下添加一个可执行的文件
7、配置apache的配置文件:(注意打开80端口)
8、配置ssl的配置文件:(注意添加 加密那2行)
9、重启apache服务:
[root@redhat conf.d]# /etc/init.d/httpd restart
stopping httpd: [ ok ]
starting httpd: [ ok ]
[root@redhat conf.d]#
10、配置域名解析:/etc/hosts
apache.example.com 192.168.0.1
redhat.example.com 192.168.0.1
11测试是否成功:
如对本文有疑问, 点击进行留言回复!!
linux下文本编辑器vim的使用方法(复制、粘贴、替换、行号、撤销、多文件操作)
网友评论