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.

Virtual Hosts deleted during overnight update

Discussion in 'Bind / DNS / Nameserver Issues' started by nkitson, May 6, 2016.

  1. nkitson

    nkitson Registered

    Feb 17, 2011
    Likes Received:
    Trophy Points:
    3 nights ok my virtual hosts were removed from httpd.conf overnight. I tried various changes without success and yesterday restored from an image which resolved the problem. Unfortunately, the problem recurred last night.

    I also get an alert FAILED: dnsadmin followed by a RECOVERED which is presumably connected.

    httpd.conf has following as expected
    Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf"

    My virtual hosts are defined in /usr/local/apache/conf/includes/post_virtualhost_2.conf - this file hasn't been changed for several months.

    post_virtualhost_2.conf contains several VirtualHost definitions
    DocumentRoot /home/xyz2/public_html/abc
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/ combined
    CustomLog /usr/local/apache/domlogs/ "%{%s}t %I .\n%{%s}t %O ."
    ## User xyz1 # Needed for Cpanel::ApacheConf
    UserDir enabled xyz1
    <IfModule mod_suphp.c>
    suPHP_UserGroup xyz2 xyz2
    <IfModule !mod_disable_suexec.c>
    <IfModule !mod_ruid2.c>
    SuexecUserGroup xyz1 xyz1
    <IfModule mod_ruid2.c>
    RMode config
    RUidGid xyz1 xyz1
    <IfModule itk.c>
    # For more information on MPM ITK, please read:
    # apache2-mpm-itk
    AssignUserID xyz1 xyz1
    ScriptAlias /cgi-bin/ /home/xyz2/public_html/abc/cgi-bin/
    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2_2/xyz1/*.conf"
    xyz1 is a cpanel account (and hence a Linux user)
    xyz2 is a linux user but there isn't a cpanel account for xyz2

    If I run httpd -S, I get the following repeated for each of the VirtualHosts I'm trying to create.
    "[Fri May 06 11:15:16 2016] [warn] VirtualHost overlaps with VirtualHost, the first has precedence, perhaps you need a NameVirtualHost directive"

    I have tried adding NameVirtualHost which has prevented the warning but not helped otherwise

    I have tried using *:80 in place of which hasn't helped.

    A colleague (who has long gone!) wrote the post_virtualhost_2.conf file.

    I do not want to move my DocumentRoot to be under /home/xyz1/ (ie the cpanel path) as it contains a complicated jenkins/git development environment which would introduce further problems

    I'm fairly sure I just need to fix my post_virtualhost_2.conf work with the changes cpanel has made but I'm at a bit of a loss ....

    Thanks for any advice.

    access: root administrator
    /etc/redhat-release:CentOS release 5.11 (Final)
    /var/cpanel/envtype:xen pv
    Server version: Apache/2.2.29 (Unix)
    Server built: Jun 19 2015 14:19:59
    Cpanel::Easy::Apache v3.30.2 rev9999
    PHP 5.4.42 (cli) (built: Jun 19 2015 14:26:24)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    mysql Ver 14.14 Distrib 5.1.73, for unknown-linux-gnu (x86_64) using readline 5.1
    #1 nkitson, May 6, 2016
    Last edited by a moderator: May 6, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.

Share This Page