Results 1 to 7 of 7
  1. #1

    Virtual Host Query

    Hi, in order to get a script to run, I have had to create a virtual host on my server for it:

    <VirtualHost MYIPHERE>
    DocumentRoot /usr/local/script/folder
    ServerName myserver.mydomain.com
    ServerAlias mail.domainone.com
    ServerAlias mail.domaintwo.com

    User name
    Group name
    </VirtualHost>

    That way when someone accesses the script it runs as that user and that group.

    Now at present this cannot be accessed from every domain which poses a problem, originally I had an alias so it could be accessed from every single domain but this could not be run as a user.

    The problem I have is is there anyway to get cpanel or apache to add an extra ServerAlias in everytime a domain is added?

    Thanks

  2. #2
    maybe this should be in the dedicated server forum

  3. #3
    Join Date
    Dec 2005
    Location
    Internet
    Posts
    1,337
    The problem I have is is there anyway to get cpanel or apache to add an extra ServerAlias in everytime a domain is added?
    If you create domains seperately via WHM, they will have their own virtualhost entry in apache conf. So, you have to remove their virtualhost entry and add as a ServerAlias to myserver.mydomain.com.

    Why not adding the new domains as an addon domain to mydomain.com so that you wont have to add ServerAlias manually.

  4. #4
    but I would still have todo that every time individually? What i was after is a way that it gets done automatically everytime a domain is added, or is that not possible

  5. #5
    Join Date
    Dec 2005
    Location
    Internet
    Posts
    1,337
    Let me explain

    If you have myserver.mydomain.com having the documentroot /usr/local/script/folder and you want to create a new domain whose serveralias should be inside the virtualhost entry of myserver.mydomain.com, then create the new domain as an addon domain to mydomain.com.

    If you create an addon domain, it wont have a seperate virtualhost entry in httpd.conf, instead its entry will be inside the virtualhost entry of myserver.mydomain.com

    This will help you from editing httpd.conf file manually everytime.
    Senior Server Administrator

  6. #6
    i understand that cheers wish there was a way for it todo it automatically but thats life.

    Thanks mate

  7. #7
    Join Date
    Dec 2005
    Location
    Internet
    Posts
    1,337
    You are welcome
    Senior Server Administrator

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •