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.

Easyapache and Redirect for the main vitrual host

Discussion in 'EasyApache' started by dmgens, Feb 3, 2010.

  1. dmgens

    dmgens Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Folks:

    I have solved a security problem by inserting a redirect directive. This is placed in the "root" virtual host

    <VirtualHost 208.109.23.94:80>
    ServerName barakael.thegreate-scape.net
    DocumentRoot /usr/local/apache/htdocs
    Redirect permanent / https://barakael.thegreate-scape.net/
    ServerAdmin david_gens@qwestoffice.net
    </VirtualHost>

    Now this will go away during a easyapache rebuild. There needs to be a vhost include file to do this.

    but the include files are of the form:

    userdata/std/2/{userid}/{domain}/*.conf

    Well the domain is barakael.thegreate-scape.net but there is no userid associated with this host. So where do i put the vhost include to make sure that easyapache finds it?

    Thanks
     
    #1 dmgens, Feb 3, 2010
    Last edited by a moderator: Feb 3, 2010
  2. Kevinfrom

    Kevinfrom Well-Known Member

    Joined:
    Jan 18, 2008
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    There are several ways to do this.

    Edit /var/cpanel/userdata/nobody/barakael.thegreate-scape.net then rebuild httpd.conf using /scripts/rebuildhttpdconf

    Or you can use the pre_virtualhost_global.conf include in /usr/local/apache/conf/includes then run /scripts/ensure_includes

    Or manually edit the VirtualHost in httpd.conf then run /usr/local/cpanel/bin/userdata_update

    Dont forget to restart Apache after any changes.
     
  3. Warrenw

    Warrenw Active Member
    PartnerNOC

    Joined:
    Nov 1, 2008
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    cpanelkevin: If you have the time can you please elaborate on how each of these methods work?
     
Loading...

Share This Page