1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

httpd.include and vhost.conf question

Discussion in 'Plesk for Linux - 8.x and Older' started by Mr.Yes, Feb 21, 2006.

  1. Mr.Yes

    Mr.Yes Guest

    0
     
    Hi,

    i need to add this line to "httpd.include" file on one domain:

    ServerAlias *.mydomain.com


    BUT i know this file will be overwritten by plesk so i created a "vhosts.conf" file where i have only:

    <VirtualHost 77.32.43.55:80>
    ServerAlias *.mydomain.com
    </VirtualHost>

    THEN go 2 terminal to say:
    /usr/local/psa/admin/bin/websrvmng -u --vhost-name=mydomain.com

    THEN i try to restart Apache

    BUT Apache do not restart and i had to delete vhost.conf file to have it UP again.

    Can you help me to write correctly my vhost.conf file?

    Thanx
     
  2. dahamsta

    dahamsta Guest

    0
     
    The containing VirtualHost block is causing the problem; this is already taken care of in httpd.include. Just add the ServerAlias line to vhost.conf.

    adam
     
  3. Joesimms

    Joesimms Guest

    0
     
    Hi

    I would like to do the same thing but for every domain that i install. So do i add this to the vhosts.conf skeleton file for each domain.

    However, is there a variable that i can use for the domain, as obvioulsy this will change for each domain created, like:

    ServerAlias *.{domain}

    or something similiar.

    Any help here would be very much appreciated.

    Many thanks

    Joe
     
  4. roeschu

    roeschu Guest

    0
     
    yes there is:


    use @domain_name@ as a variable in your file vhost.conf in skeleton directory. plesk will substitute this variable with the domain name at the creation process.


    there are more variables like this...unfortunalty i didn't find a reference guide so far....someone?


    greets
     
  5. Joesimms

    Joesimms Guest

    0
     
    Hi, thats great, thanks for that.

    Basically what i am trying to achieve is as follows:

    By adding the ServerAlias *.domain to my domains vhost.conf file, all subdomains by default will be handled by my main domains httpdocs folder, this is great for me and the apps i build.

    However, if i want to point a subdomain to another application, i would normally in plesk create a subdomain, and use the folder that it creates.

    Plesk includes the vhost files in the following way:

    <VirtualHost *:80>
    # main domain
    </VirtualHost>

    <VirtualHost *:80>
    # sub domain 1
    </VirtualHost>

    <VirtualHost *:80>
    # sub domain 2
    </VirtualHost>

    This creates the problem in that that if i add the universal alias to the main domain, as it appears above the subdomains in the http.conf file, it overrides their settings.

    I could combine these two if there is a way of moving the subdomains virtual host elements above the main domains one.

    I'm not too sure if this would have any other detremental effects though with the plesk setup, but it would allow me to handle all subdomains by my main domain, unless a subdomain is specifically created in plesk.

    Anybody know if this is possible to configure in plesk.
     
Loading...