Having trouble configuring apache virtualhost SSL

Discussion in 'Apache' started by Drumrocker365, Dec 10, 2013.

  1. #1
    Hello,

    I am really having trouble getting a virtualhost to work for an SSL certificate.. my browser just will not load the page and I don't know what I'm doing wrong - could someone please help me? I have tried several different articles on how to setup a virtualhost and none of them seem to work.

    My ssl.conf http://pastebin.com/5npepGfv

    *Note: I did purchase an SSL certificate - it is not self signed

    Any help is appreciated,
    Drumrocker365
     
    Last edited: Dec 10, 2013
    Drumrocker365, Dec 10, 2013 IP
  2. evtimii

    evtimii Active Member

    Messages:
    55
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    70
    #2
    I see that you edited the /etc/httpd/conf.d/ssl.conf file - I would recommend that you restore the original file if that is the case.


    The easiest way to add a virtualhost (CentOS) is to create a config file in:

    /etc/httpd/conf.d/websitename.com.conf

    that will contain your settings.

    Here's a template that you could use for the SSL part:

    http://pastebin.com/nJFsSpX4

    And a full example config:

    http://pastebin.com/r0J9gW56
     
    evtimii, Dec 13, 2013 IP
  3. Drumrocker365

    Drumrocker365 Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    It's just not working.. I tried creating a totally new file but the page load.. I just don't know what to do :(
     
    Drumrocker365, Dec 14, 2013 IP
  4. evtimii

    evtimii Active Member

    Messages:
    55
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    70
    #4
    Did you restored /etc/httpd/conf.d/ssl.conf to it's original state ?
    Also did you changed all of the variables/paths on the example config file ?
     
    evtimii, Dec 14, 2013 IP
  5. Drumrocker365

    Drumrocker365 Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    I don't know how to restore the ssl.conf .. I didn't make a backup before editing it :(
     
    Drumrocker365, Dec 14, 2013 IP
  6. evtimii

    evtimii Active Member

    Messages:
    55
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    70
    #6
    try running:
    yum remove mod_ssl -y

    (this will remove mod_ssl)

    and then:

    rm /etc/httpd/conf.d/ssl.conf

    after that install mod_ssl again:

    yum install mod_ssl -y
     
    evtimii, Dec 14, 2013 IP
  7. Drumrocker365

    Drumrocker365 Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    it worked but still nothing.. when I try to visit
    https://www.mineprowebhost.com
    Code (markup):
    it just loads and loads forever but http://mineprowebhost.com loads just fine but it isn't secured..
     
    Drumrocker365, Dec 14, 2013 IP
  8. evtimii

    evtimii Active Member

    Messages:
    55
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    70
    #8
    Check if your firewall is not blocking port 443
     
    evtimii, Dec 14, 2013 IP
  9. Drumrocker365

    Drumrocker365 Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #9
    How do I do that? I am very new to Apache so I don't know many commands.
     
    Drumrocker365, Dec 14, 2013 IP
  10. evtimii

    evtimii Active Member

    Messages:
    55
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    70
    #10
    You could check if port 443 is blocked:

    iptables --list
    Code (markup):
     
    evtimii, Dec 14, 2013 IP
  11. Drumrocker365

    Drumrocker365 Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #11
    
    Chain INPUT (policy ACCEPT)
    target    prot opt source              destination
    
    Chain FORWARD (policy ACCEPT)
    target    prot opt source              destination
    
    Chain OUTPUT (policy ACCEPT)
    target    prot opt source              destination
    [root@drummerzcraft ~]#
    Code (markup):
    Uh.. that's what I got.. what does that mean?
     
    Drumrocker365, Dec 16, 2013 IP
  12. evtimii

    evtimii Active Member

    Messages:
    55
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    70
    #12
    It means that your iptables firewall rules are empty and port 443 is not blocked by the firewall.
     
    evtimii, Dec 16, 2013 IP
  13. Drumrocker365

    Drumrocker365 Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #13
    for some reason when I go to
    https://(my server IP here)
    Code (markup):
    my website comes up and it's secured - it just will not work with the virtualhost and the domain :(
     
    Drumrocker365, Dec 17, 2013 IP
  14. Drumrocker365

    Drumrocker365 Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #14
    I am going to assume that it's hopeless :( any good uses for an SSL certificate? lol
     
    Drumrocker365, Dec 21, 2013 IP