Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2010
    Location
    UK
    Posts
    16

    Default Edit Apache directives for a virtual host

    Hi,
    I have few sites on my server & I need to edit the apache directive for selected sites.
    My OS is CentOS & running cpanel newest version. I can't see a place in cpanel to change directives for a selected site.
    Does CentOS keep seperate virtual host file for each site? On Ubuntu I can see like that.

    What is the best way to do this?

    many Thanks

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Edit Apache directives for a virtual host

    Hello,

    What are you specifically needing to change? Depending on what is needing changed, it might need to be done differently. If you are adding individual VirtualHost directives, those need to go into an include file for the user. If you are modifying existing VirtualHost directives, you'd have to edit the userdata file for the user.

    If you are editing global directives, you'd have to edit the Apache template file by copying it and making changes. If you are adding global directives, you'd need to add them into one of the global include files.

    You can review the various include locations in the following documentation:

    The Apache Web Server and cPanel & WHM

    Thanks.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Dec 2010
    Location
    UK
    Posts
    16

    Default Re: Edit Apache directives for a virtual host

    Hi,
    Thanks for the reply.
    Lets say for a selected domain, in the apache virtual host I want to add the wildcard capability
    Example
    ServerAlias www.mydoamin.co.uk need to replace with
    ServerAlian *mydomain.co.uk

    Thanks
    Milindra

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Edit Apache directives for a virtual host

    Hello Milindra,

    Would there be a reason you do not simply add a wildcard subdomain onto the account in cPanel or park a wildcard onto cPanel? You can certainly edit the VirtualHost directive, but it seems like that's overkill when it should be something you can add in cPanel > Subdomains or cPanel > Parked Domains area.

    To edit the ServerAlias lines, you simply need to edit /var/cpanel/userdata/username/mydomain.co.uk file and add the wildcard in the serveralias: line it will have. Replace username with the cPanel username in that path, and replace mydomain.co.uk with the actual domain name.

    You'd also have to add a parked domain entry in /var/cpanel/userdata/username/mydomain.co.uk/mail file.

    Thanks.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Apache httpd.conf every virtual host using port 8888 and not 80
    By Saint Isaiah in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-29-2011, 02:23 PM
  2. customize apache's default virtual host
    By deviancelabs in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 09-16-2009, 01:25 PM
  3. cpanel apache virtual host
    By liang3391 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-05-2009, 01:51 AM
  4. how to edit apache virtual hosts in cpanel
    By natnet123 in forum New User Questions
    Replies: 1
    Last Post: 12-06-2007, 01:22 PM
  5. Apache 2... Virtual Host
    By jaymc in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 01-05-2006, 12:22 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube