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 Mod_Userdir with SSL

Discussion in 'EasyApache' started by vlee, May 29, 2013.

  1. vlee

    vlee Well-Known Member

    Joined:
    Oct 13, 2005
    Messages:
    272
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    Las Vegas, Nevada, United Stat
    cPanel Access Level:
    Root Administrator
    I would like to how you this below can be done.

    Say you allow users to use this http://host.example.com/~username

    But there is a catch force it is use the Shared SSL Certificate that is on host.example.com

    So they will see this https://host.example.com/~username in the address bar.

    I just want make this feature very secure and free to use for customers.

    Can anyone tell me how to force users to use the Shared SSL Certificate if they want to use this https://host.example.com/~username feature?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You could try using a custom Mod_Rewrite rule in the VirtualHost for the hostname of the server (or the host that you have configured as a shared SSL). EX:

    Code:
    <VirtualHost 1.1.1.1:80>
        ServerName host.domain.com
        DocumentRoot /usr/local/apache/htdocs
        RewriteEngine on
        ReWriteCond %{SERVER_PORT} !^443$
        RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
        ServerAdmin root@host.domain.com
        <IfModule mod_suphp.c>
            suPHP_UserGroup nobody nobody
        </IfModule>
    </VirtualHost>
    The following URL documents how to make a change to a single VirtualHost:

    EasyApache: Changes Contained Within a VirtualHost Directive

    Note that per our documentation, if you want to enable mod_userdir so that shared SSL certificates can be used, you will need to either add users to, or exclude protection from, the virtual host for the domain to which the certificate was issued.

    Thank you.
     
Loading...

Share This Page