The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache vHosts and shared ssl

Discussion in 'EasyApache' started by verdon, Apr 15, 2004.

  1. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Hi :)

    I'm attempting to setup a ssl cert that my users can share. My server is running;
    WHM 9.1.0 cPanel 9.1.0-R85__
    RedHat 8.0 - WHM X v2.1.2
    ...and for the most part, I am trying to accept it's defaults to avoid potential trouble with future cpanel updates

    In my httpd.conf file, mod_userdir.c enabled, and there's a global statement like

    <IfModule mod_userdir.c>
    UserDir public_html
    </IfModule>

    And user sites can be accessed by going http://mydomain.com/~user or http://www.mydomain.com/~user

    This is what I want, and I'm not worried about bandwidth leeching in my environment. I have done some reading and realize I can gain more granular control by doing things like

    <IfModule mod_userdir.c>
    UserDir public_html
    UserDir disabled
    UserDir enabled user1 user2 user15
    </IfModule>

    But that's not really what I'm asking about. I have to give a little more background to get to my question.

    I also have a ssl cert installed and working for a virtual host https://secure.mydomain.com/. What I want (and is not working) is for user sites to be able to use this cert by going https://secure.mydomain.com/~user

    All of these virtual hosts are using the same IP. The virtual host entry for secure.mydomain.com has an entry 'UserDir public_html/secure', which is the root directory for secure.mydomain.com created by cpanel. What do I need to add to be able to allow my user's sites to be able to resolve by going https://secure.mydomain.com/~user

    Currently, http://secure.mydomain.com/~user resolves while https://secure.mydomain.com/~user generates a 404 error

    Thanks,
    verdon
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
  3. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Hi Mike,

    Thanks for the reply...

    I should have said that I did try the trailing backslash (as I had read that somewhere) and no, it doesn't make a difference.

    Do I need to repeat my

    <IfModule mod_userdir.c>
    UserDir public_html
    </IfModule>

    statement (that is global) inside my vhost entry for the secure domain?

    I also had a friend suggest that I move the directory for secure.myhost.com from the location created by cpanel -- /myHostuser/public_html/secure -- to /myHostuser/ssl-public_html which led me to wondering if the line -- UserDir public_html/secure -- which is inside my vhost entry for the secure subdomain, is conflicting or over-riding my global entry -- UserDir public_html

    salut,
    verdon
    [a fellow canadian, mac user struggling to learn some *nix]
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    You might need to have someone look at your settings to find out what's wrong. On mine, all I have is the global moduser_dir before the virtual host entries, and the celebgcc username in the list of enabled names and it works fine. No further customizations or setups.

    I don't know why yours won't work. Maybe someone else has an idea.
     
  5. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Thanks for trying Mike...

    I'm beginning to suspect that it may be an issue with me having multiple IP's and named virtual hosts. The entries all look correct, but I'm not sure about the order of the lines and I don't know enough about this to be sure. I will get someone to look at it for me.

    For instance,

    First my ssl globals are declared, then I have

    NameVirtualHost xxx.xx.xx.xx1:80

    <VirtualHost xxx.xx.xx.xx1>
    </VirtualHost>

    <VirtualHost xxx.xx.xx.xx1>
    </VirtualHost>

    then

    <VirtualHost xxx.xx.xx.xx2>
    </VirtualHost>

    then

    NameVirtualHost xxx.xx.xx.xx2:80

    and a bunch more

    <VirtualHost xxx.xx.xx.xx2>
    </VirtualHost>

    then

    <IfDefine SSL>
    <VirtualHost xxx.xx.xx.xx2:443>
    </VirtualHost>
    </IfDefine>

    then a bunch more

    <VirtualHost xxx.xx.xx.xx2>
    </VirtualHost>

    best regards,
    verdon
     
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    The order of those entries shouldn't really matter, but just for clarity, I go in and clean mine up once in a while by putting all NameVirtualHost lines just before the host entries and delete the multiple ones.

    Just remember, if you EVER edit the httpd.conf file, make a copy first just in case. 1 tiny error in the changes will keep apache from restarting.
     
  7. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    being the big chicken that I am, I don't touch anything without backing it up :D
     
  8. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Apache vHosts and shared ssl - SOLVED

    Hi,

    I figured this out. It was really quite simple once I looked at it with fresh eyes :)

    In my first post to this thread, I said that my VirtualHost entry for the secure domain had a line 'UserDir public_html/secure', which is where cpanel created the subdomain for 'secure.mydomain.com'. All I had to do was change that line to read 'UserDir public_html/secure public_html' and now 'https://secure.mydomain.com/~user' resolves correctly.

    cheers,
     
  9. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Glad you figured it out. :)
     
Loading...

Share This Page