• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

httpd.include and vhost.conf question

M

Mr.Yes

Guest
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
 
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
 
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
 
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
 
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.
 
Back
Top