• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Wrong update of httpd.conf Plesk 12.5

Anders Yuran

New Pleskian
I try changing the document root for a virtual host in Apache using the following guide https://forum.opencart.com/viewtopic.php?f=19&t=98202

Everything goes as plan until I test the addon domain. I get a "no input file specified" I have created a vhost.conf to specify the document root but when I reconfigure the domain I get this Document Root "DocumentRoot "/var/www/vhosts/dvd-xxx.eu/beautyandpleasure.co.uk/httpdocs" The first domain should ofc not be there. I take it away in httpd.conf, reconfigure the domain and it is there again

What can be wrong, I cant find anything online

Plesk 12.5
CentOs 7
 
Last edited:
That is interesting, however, I do not exactly understand how the description of the article in your "forum.opencart.com"-link can work, because
1) Step 6 names a wrong path where to put the configuration file. It should actually go into /var/www/vhosts/system/your_additional_domains.com/conf
2) Each time the web server configuration is reconfigured by httpdmng it will re-create the .conf files from what is stored in Plesk's database, overwriting the individual change.
So how is this expected to work?

[Edit: Sorry, at the time when I wrote this post I was not aware that a custome .conf file can be placed into a custom /conf directory within the own web space. This is possible/supported.]
 
Last edited:
That is interesting, however, I do not exactly understand how the description of the article in your "forum.opencart.com"-link can work, because
1) Step 6 names a wrong path where to put the configuration file. It should actually go into /var/www/vhosts/system/your_additional_domains.com/conf
2) Each time the web server configuration is reconfigured by httpdmng it will re-create the .conf files from what is stored in Plesk's database, overwriting the individual change.
So how is this expected to work?

The mistake in the tutorial probably comes from the age of it. I put the vhost.conf where Plesk tells me to put it.
From the httpd.conf


#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
#IF YOU REQUIRE TO APPLY CUSTOM MODIFICATIONS, PERFORM THEM IN THE FOLLOWING FILES:
#/var/www/vhosts/system/dvd-xxx.eu/conf/vhost.conf

This is what I have done

Anders
 
Ah, I see. I never noticed that an individual .conf file can be placed inside the own web space subscription. I've never tried that and wonder if the full virtual host can be overwritten by it or if it is only meant as an "add on" to the existing virtual host. In your case does that file contain
DocumentRoot "/var/www/vhosts/Your_primary_domain_here.com/httpdocs"
<Directory /var/www/vhosts/Your_primary_domain_here.com/httpdocs>
or does it read
DocumentRoot "/var/www/vhosts/Your_primary_domain_here.com/beautyandpleasure.co.uk/httpdocs"
<Directory /var/www/vhosts/Your_primary_domain_here.com/beautyandpleasure.co.uk/httpdocs>
?

https://docs.plesk.com/en-US/12.5/a...types/virtual-host-configuration-files.72064/
 
Ah, I see. I never noticed that an individual .conf file can be placed inside the own web space subscription. I've never tried that and wonder if the full virtual host can be overwritten by it or if it is only meant as an "add on" to the existing virtual host. In your case does that file contain
DocumentRoot "/var/www/vhosts/Your_primary_domain_here.com/httpdocs"
<Directory /var/www/vhosts/Your_primary_domain_here.com/httpdocs>
or does it read
DocumentRoot "/var/www/vhosts/Your_primary_domain_here.com/beautyandpleasure.co.uk/httpdocs"
<Directory /var/www/vhosts/Your_primary_domain_here.com/beautyandpleasure.co.uk/httpdocs>
?

https://docs.plesk.com/en-US/12.5/a...types/virtual-host-configuration-files.72064/
That is the problem, it is the last one, and ofc it can not work. On the other hand the Plesk guys say that you should not use conf files nowadays, you can set the Document Root directly in Plesk. But the result is the same
 
From what I understand, you should simply replace the two lines
DocumentRoot "/var/www/vhosts/Your_primary_domain_here.com/beautyandpleasure.co.uk/httpdocs"
<Directory /var/www/vhosts/Your_primary_domain_here.com/beautyandpleasure.co.uk/httpdocs>
with these:
DocumentRoot "/var/www/vhosts/Your_primary_domain_here.com/httpdocs"
<Directory /var/www/vhosts/Your_primary_domain_here.com/httpdocs>
because you don't need any reference of the secondary domain there. You want the secondary domain to use the same document root as the primary domain. From what you are writing, you have not done it that way, but added "...your_primary_domain_here.com/your_secondary_domain.com/httpdocs", but it should only be "...your_primary_domain_here.com/httpdocs".
 
That is interesting, however, I do not exactly understand how the description of the article in your "forum.opencart.com"-link can work, because
1) Step 6 names a wrong path where to put the configuration file. It should actually go into /var/www/vhosts/system/your_additional_domains.com/conf
2) Each time the web server configuration is reconfigured by httpdmng it will re-create the .conf files from what is stored in Plesk's database, overwriting the individual change.
So how is this expected to work?

[Edit: Sorry, at the time when I wrote this post I was not aware that a custome .conf file can be placed into a custom /conf directory within the own web space. This is possible/supported.]
From what I understand, you should simply replace the two lines
DocumentRoot "/var/www/vhosts/Your_primary_domain_here.com/beautyandpleasure.co.uk/httpdocs"
<Directory /var/www/vhosts/Your_primary_domain_here.com/beautyandpleasure.co.uk/httpdocs>
with these:
DocumentRoot "/var/www/vhosts/Your_primary_domain_here.com/httpdocs"
<Directory /var/www/vhosts/Your_primary_domain_here.com/httpdocs>
because you don't need any reference of the secondary domain there. You want the secondary domain to use the same document root as the primary domain. From what you are writing, you have not done it that way, but added "...your_primary_domain_here.com/your_secondary_domain.com/httpdocs", but it should only be "...your_primary_domain_here.com/httpdocs".


From my vhost.conf

DocumentRoot "/var/www/vhosts/beautyandpleasure.co.uk/httpdocs"
<Directory /var/www/vhosts/beautyandpleasure.co.uk/httpdocs>

But still the hpptd.conf have the double domain oot and it just can't work, because that path does not exist

Anders
 
Is beautyandpleasure.co.uk the domain where the shop is installed on? From your first post I thought that dvd-xxx.eu is the domain where the shop is installed on and beautyandpleasure.co.uk shall only be the add on domain.
 
Is beautyandpleasure.co.uk the domain where the shop is installed on? From your first post I thought that dvd-xxx.eu is the domain where the shop is installed on and beautyandpleasure.co.uk shall only be the add on domain.
The default shop is on beauty domain. It is a multishop setup so there will be another shop on the dvd domain using the same shop platform admin.
 
I want to make sure that I understand it all correctly. In my own words:

beautyandpleasure.co.uk is your primary domain where the shop software is installed.
dvd-xxx is your secondary domain that does not need an individual software installation, because the shop installation in beautyandpleasure.co.uk can serve additional domains. It only needs to point to the same document root directory, so that a request for dvd-xxx starts the same shop software.

You have a vhost.conf file in /dvd-xxx/conf/vhost.conf
with this content (excerpt):
DocumentRoot "/var/www/vhosts/beautyandpleasure.co.uk/httpdocs"
<Directory /var/www/vhosts/beautyandpleasure.co.uk/httpdocs>
By this you want to achieve that the virtual host of dvd-xxx uses the document root of beautyandpleasure.co.uk to deliver files.

But yet, when you reconfigure dvd-xxx, it does not deliver files from /var/www/vhosts/beautyandpleasure.co.uk/httpdocs, but tries to deliver them from /var/www/vhosts/dvd-xxx/beautyandpleasure.co.uk/httpdocs

Is that a correct presentation of the issue?
 
I want to make sure that I understand it all correctly. In my own words:

beautyandpleasure.co.uk is your primary domain where the shop software is installed.
dvd-xxx is your secondary domain that does not need an individual software installation, because the shop installation in beautyandpleasure.co.uk can serve additional domains. It only needs to point to the same document root directory, so that a request for dvd-xxx starts the same shop software.

You have a vhost.conf file in /dvd-xxx/conf/vhost.conf
with this content (excerpt):
DocumentRoot "/var/www/vhosts/beautyandpleasure.co.uk/httpdocs"
<Directory /var/www/vhosts/beautyandpleasure.co.uk/httpdocs>
By this you want to achieve that the virtual host of dvd-xxx uses the document root of beautyandpleasure.co.uk to deliver files.

But yet, when you reconfigure dvd-xxx, it does not deliver files from /var/www/vhosts/beautyandpleasure.co.uk/httpdocs, but tries to deliver them from /var/www/vhosts/dvd-xxx/beautyandpleasure.co.uk/httpdocs

Is that a correct presentation of the issue?

Yes 100%. And if I use the vhost.conf I get No inputfile specified, using Plesk I get If you are seeing this message, the website for www.dvd-xxx.eu is not available at this time.. This is the setting now
 
I think, this is a feature and it will not be possible to set a document root outside the own subscription's web space.

The reason for that is that theoretically such an option would enable you to set the document root to other paths on the physical server, too. You are only attempting to read files from another subscription of your own, but you could equally well address for instance a Ruby on Rails installation in another user's account that you ought to never be able to read any files from or another website running on the same hardware but maybe served by a separate web server on a different port that you would normally not be able to reach from your subscription.

That option would also enable you to hijack other people's website content and present their websites on your domain as your own, even logging their webserver errors to your account.

I see what you are trying to achieve, but I think it is correct that Plesk does not let you do it for security reasons. The primary domain is jailed to the secondary domain, that is why the paths are not updated to the document root that you have set.

The workaround would be to have both domains inside the same subscription. But in that case, of course, you will not be able to run them on two different IP addresses.

Another workaround would be to use a symlink on the secondary domain to point to the sources of the primary domain (e.g. symlink httpdocs to the primary domain's httpdocs). But this is unsupported by Plesk and will definitely cause issues on the next software update or migration of such accounts (httpdocs must be a real directory, it cannot be a symlink).

From whatever perspective you look at it: The solution presented in the forum.opencart.com article will not work.
 
I think, this is a feature and it will not be possible to set a document root outside the own subscription's web space.

The reason for that is that theoretically such an option would enable you to set the document root to other paths on the physical server, too. You are only attempting to read files from another subscription of your own, but you could equally well address for instance a Ruby on Rails installation in another user's account that you ought to never be able to read any files from or another website running on the same hardware but maybe served by a separate web server on a different port that you would normally not be able to reach from your subscription.

That option would also enable you to hijack other people's website content and present their websites on your domain as your own, even logging their webserver errors to your account.

I see what you are trying to achieve, but I think it is correct that Plesk does not let you do it for security reasons. The primary domain is jailed to the secondary domain, that is why the paths are not updated to the document root that you have set.

The workaround would be to have both domains inside the same subscription. But in that case, of course, you will not be able to run them on two different IP addresses.

Another workaround would be to use a symlink on the secondary domain to point to the sources of the primary domain (e.g. symlink httpdocs to the primary domain's httpdocs). But this is unsupported by Plesk and will definitely cause issues on the next software update or migration of such accounts (httpdocs must be a real directory, it cannot be a symlink).

From whatever perspective you look at it: The solution presented in the forum.opencart.com article will not work.
I have only one subscription, one ip address thats why I think it should work. And there is a lot of different users making it happen, but they all have cpanel, not plesk
 
If you have a single IP address only, why don't you simply add the domain to the same subscription and set the document root to the other domain's document root? This will work without trouble. You won't need any special configuration in that case.
 
If you have a single IP address only, why don't you simply add the domain to the same subscription and set the document root to the other domain's document root? This will work without trouble. You won't need any special configuration in that case.
How do I do that. Forwarding does not work
 
Create the add-on domain with the "Add domain" button in your existing subscription.
The document root line will be preset with the domain name, but clear that and enter httpdocs instead.
Save.

No the add-on domain will use the same document root path like the main domain. Changes you apply to that path from the add-on domain are reflected by the main domain, changes to the main domain's content by the add-on domain.

The article you quoted in your initial post is about a different thing: There the user tries to have two domains with different IP addresses use the same document root. But if you do not have different IP addresses, your domains can reside in the same subscription, making it easy to point them to the same document root.
 
Back
Top