aws linuxでhttpsが開かなかったけど開れた話
やったこと
1.とりあえずawsのコンソールでセキュリティグループ確認 -> 開いてた
2.linux側でiptablesの設定が入ってなかった -> なんだやってなかったっけw
↓
3.やってみたけど開かない(・ω・)
↓
command
vi /etc/sysconfig/iptables
/etc/sysconfig/iptables
# Generated by iptables-save v1.4.18 on Mon Jul 4 13:10:03 2016
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [12:1904]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed
command
/sbin/iptables-save > /etc/sysconfig/iptables
/etc/init.d/iptables restart
4.とりあえず分からないから放置
5.「あれ確かhttpd的になんかやるんじゃなかったっけ?」
6.ssl.confとかなんとかがいると判明。こんなの今まで入れてたっけ?
7.yumしてみたが失敗。
command
yum -y install mod_ssl
yum
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/x86_64 | 2.1 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package mod_ssl.x86_64 1:2.2.29-1.4.amzn1 will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: 1:mod_ssl-2.2.29-1.4.amzn1.x86_64
--> Processing Dependency: httpd = 2.2.29-1.4.amzn1 for package: 1:mod_ssl-2.2.29-1.4.amzn1.x86_64
--> Running transaction check
---> Package httpd.x86_64 0:2.2.29-1.4.amzn1 will be installed
--> Processing Dependency: httpd-tools = 2.2.29-1.4.amzn1 for package: httpd-2.2.29-1.4.amzn1.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.29-1.4.amzn1.x86_64
--> Running transaction check
---> Package apr-util-ldap.x86_64 0:1.4.1-4.14.amzn1 will be installed
---> Package httpd-tools.x86_64 0:2.2.29-1.4.amzn1 will be installed
--> Processing Conflict: httpd24-tools-2.4.10-1.59.amzn1.x86_64 conflicts httpd-tools < 2.4.10
--> Processing Conflict: httpd24-2.4.10-1.59.amzn1.x86_64 conflicts httpd < 2.4.10
--> Processing Conflict: 1:mod24_ssl-2.4.10-1.59.amzn1.x86_64 conflicts mod_ssl < 1:2.4.10
--> Finished Dependency Resolution
Error: httpd24-tools conflicts with httpd-tools-2.2.29-1.4.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.29-1.4.amzn1.x86_64
Error: mod24_ssl conflicts with 1:mod_ssl-2.2.29-1.4.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
8.apache2.4系をいれてるのでmod_sslもmod24_sslというのを入れれば解決した
command
yum -y install mod24_ssl
apachecontrol restart
以上