• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

can Plesk do this? (is it "safe" to move from cPanel to Plesk?)

Sorry for delay. I have tested next configuration which allows to get your wish. I taken Wordpress and Debian 7 for tests.

0) Unpack Wordpress to /var/www/vhosts/wordpress and `chown www-data:www-data -R /var/www/vhosts/wordpress`
1) Create service plan with modified PHP settings: add '/var/www/vhosts/wordpress' to include path and open base dir.
2) Create custom vhost configs (http://download1.parallels.com/Ples...linux-advanced-administration-guide/68693.htm) and modify them:
/usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php:
40: DocumentRoot "/var/www/vhosts/wordpress"
153: <Directory /var/www/vhosts/wordpress/>
171: 'dir' => "/var/www/vhosts/wordpress/",

/usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
58: root "/var/www/vhosts/wordpress/";
72: alias "/var/www/vhosts/wordpress/";
3) Create few subscriptions and check result

Plesk shows wrong web roots and customers do not have access to Wordpress files. You can setup 'Custom view' for you customers to hide some confusing items (http://download1.parallels.com/Plesk/PP12/12.0/Doc/en-US/online/plesk-administrator-guide/70035.htm)

All my domains show me Wordpress installation wizard. Is it what do you need?

Custom vhost config templates have one problem - you should test it before perform upgrade to next major Plesk version because we can modify default templates.
 
Thank you for trying so hard Sergey. I appreciate it!

One thing though... I don't use (and will not use) Wordpress. Does this mean it won't work?

I was thinking... each time I create a new domain, a new vhost will be created. Correct? Can't I just make a custom vhost (based on the default vhost) and make the DocumentRoot hard-coded instead of dynamic? I think that is kind of what you are doing at point 2) but then skip the Wordpress installation. Would it work? So if I only did this:

Create custom vhost configs (http://download1.parallels.com/Plesk...uide/68693.htm) and modify them:
/usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php:
40: DocumentRoot "/var/www/vhosts/mydocumentroot"
153: <Directory /var/www/vhosts/mydocumentroot/>
171: 'dir' => "/var/www/vhosts/mydocumentroot/",

/usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
58: root "/var/www/vhosts/mydocumentroot/";
72: alias "/var/www/vhosts/mydocumentroot/";

Would it work?
 
Yes. Just do not forget to perform `chown` and set to use mod_php. Try our trial to perform complete test.

Wordpres is example only.
 
Thanks again Sergey! What does the chown do and where do I set to use mod_php?

Another question. I saw that when a domain is created, some default folders will automatically be placed in the document root. Is it possible to prevent these folders from being created, and is it possible to create my own file that will be automatically placed in the document root when the document root is created?

For example, when a domain is created the default is (something like) this:

Code:
/var/www/vhosts/mydocumentroot/
                               css/
                               images/
Can I make it like this?

Code:
/var/www/vhosts/mydocumentroot/
                               index.php
 
Yes, this is possible. You have a so called default "skeleton" for the initial http-docs which is located at "/var/www/vhosts/.skel/0/httpdocs" ( Plesk 12 ). The default skeleton folders and the content might be changed for your needs. Please see as well Change default website skeleton. As well there is a pretty good search option here in this forum. You might consider using it for some more questions: Forum search at parallels
 
1) 'chown' - it's command which change file owner user and group. It should be apache user and apache group in your case.
2) You can set php mode in subscription settings (scripting screen)
3) UFHH01 rightly said: You can use skeleton to provide default files for newly created domain.
 
Yes, this is possible. You have a so called default "skeleton" for the initial http-docs which is located at "/var/www/vhosts/.skel/0/httpdocs" ( Plesk 12 ). The default skeleton folders and the content might be changed for your needs. Please see as well Change default website skeleton. As well there is a pretty good search option here in this forum. You might consider using it for some more questions: Forum search at parallels
I've got 2 questions about the skeleton:

1)

By default a httpdocs folder is created. Can I delete this folder from the skeleton so there won't be a httpdocs folder anymore?

2)

Is it possible to create new root folders by using the skeleton, for example "myfiles" and "docroot", so you will get:

/var/www/vhosts/www.mysite.com/docroot
/var/www/vhosts/www.mysite.com/myfiles
 
You can create what ever you would like to create in the skeleton - folder ( folders/docs/images/...). Everything inside this skeleton - folder will be copied in the same order in a new domain/subdomain creation prozess.
 
Thanks for replying. If that is possible it would be great. However... documentation (click) says:

3. Pack the directories into an archive in tgz, tar, tar.gz, or zip format.

Make sure that the directories are in the root of the archive file and not in a subdirectory. If you include other directories or files in the root of the archive, Plesk will not add them to the template.
What exactly does "other directories or files" mean? I thought it refers to the default directories (see documentation).

1.On your local file system, create the following directories:
◦cgi-bin if you want to include custom scripts in the template.
◦httpdocs if you want to include custom documents such as web pages or images.
◦error_docs if you want to include custom error messages.
So that's why I asked this question. It seems to me like I can only use the directories "cgi-bin", "httpdocs" and "error_docs" and that every other (root)directory will be ignored. Am I wrong?
 
If you delete the skeleton folder named "httpdocs" and create instead your prefered document root "web", then again you have to modify your vhost - config as described, otherwise Plesk can't move the modified skeleton files to the unsual document root named "web". The Plesk documentation doesn't care about specific user configurations, because the alternative possibilties would raise the hole documentation up to 1000 sites or more, that's why there is a support, who may answer all individual questions in behalf of your prefered, specific user configuration.

Again to your really specific questions with really specific modifications: I would suggest to think of the other way round, than to modify the Plesk standards: try to think of ways to modify YOUR old structures into new ones, which are standard in a Plesk environment, because this is much faster to implement, than asking for all this and waiting for some one to post a solution for it. Think of ways to learn some more about bash scripts to help you modify old structures into new ones and as well, try to adapt Plesk standards and get rid of the cPanel ones. It will make the work with Plesk much easier if you try to understand the Plesk environment, instead of thinking about ways to change the handling, because "you are used to this and that in another way". It is much easier to learn something new, than modifying the whole Plesk software. ^^
 
Thanks UFHH01, you are really helping me. Your advice is certainly something to think about which I will do the next couple of days.

About your solution... so if I modify the default document root ("foo") in the config, and then I place a folder with the same name ("foo") in the skeleton, then it will work?

And how about other folders? Can I add a folder "bar"? As I understand it I can only use the folders "cgi-bin", "httpdocs" and "error_docs". Or am I mistaking?

In real-life I want to create a structure, something like this:

Code:
/var/www/vhosts/www.mysite.com/
                               cronjobs
                               private
                               public
Where "public" refers to the public files (the document root), where the "private" folder contains private files and where the "cronjob" folder contains cronjobs. Would such a structure be possible?
 
I never tried the solution changing the name "httpdocs" to something else, but the described way "should" be right. Please contact the support directly, or wait for a kind reply from a tester ( or Plesk supporter / mod ).
As I wrote above, you might add what ever you would like to add / folders / docs / ... ) into a skeleton... it will always be copied into the pre-defined root of the vhost ( wich is "/var/www/vhosts/yourdomain.com" ), when it's newly created... at least it works on MY Ubuntu system this way. ^^ If you would like to change this vhost - root as well, you will have to modify a few more things. :)

The way you would like to change the system directions, you have to override / configure quite a lot of things, when you finally decide to use Plesk. Having issues or problems with your specific configurations will mean that you always have to add all included modifications, when you ask for help, or want some one to help you from the support team. This is really not helpfull and not at all sufficient. The worst case would be, that you get the answer: "please use the original configuration, because this IS working" and this might say as well, that you have to re-install your server and Plesk, because it will be a much faster way, than to explain how and what you have to change, so that your specific configurations work as expected. You plan a special "JohanSki" - server with a special "JohanSki" - Plesk configuration, are you sure, that your have sufficient knowledge for all of your plans?
 
Good point... it truly is something I have to consider. I like to do it "my way" but as you say... is it the best and most efficient way... not sure about that to be honest.

So maybe I shouldn't adjust the document root then... but I do want to use for example a "general" johanski library which should be accessible from every vhost. Is that "doable" or will it also cause troubles?

(Thanks again for taking the time to help me.)
 
Let's say you are planing to serve your customers with custom cronjobs, custom cgi's, a pre-installed wordpress software, pre-installed forum software, pre-installed shop software and other things one might think off... you will sure configure, test and modify your cronjobs, cgi's and all that software on your server, that's why you would have a subdomain on your server-domain... in this case I called it "TEST-DOMAIN.SERVER_DOMAIN.com .

Every system has some really quick ways to copy folders and docs from one place to another .... it only takes two lines ( I do that with rsync to keep folders, docs and scripts up-to-date ):

Code:
rsync -r /var/www/vhosts/SERVER_DOMAIN.com/TEST-DOMAIN.SERVER_DOMAIN.com* /var/www/vhosts/EXAMPLE_DOMAIN.com 
chown -R SYSTEMUSEFORTHAT_doc_root:psaserv /var/www/vhosts/EXAMPLE_DOMAIN.com

This resyncs ALL folders and integrated files with the same permissions from inside a possible subdomain called TESTING-DOMAIN.SERVER_DOMAIN.com ( "/var/www/vhosts/SERVER_DOMAIN.com/TEST-DOMAIN.SERVER_DOMAIN.com" ) to the doc_root of EXAMPLE_DOMAIN.com. The second line gives the new folders and docs the specific permissions for the system user of EXAMPLE_DOMAIN.com. Keep in mind, that you might have to change the folders inside of the psaserv folders again with a third line, so that scripts and files can be served over php5-fpm or nginx, so the optional third line would be
Code:
chown -R SYSTEMUSER_FOR_THAT_doc_root:psacln /var/www/vhosts/EXAMPLE_DOMAIN.com/folder_who_needs_adjustment_because_of_php5-fpm_and_or_nginx/*


If you plan to use different buisiness plans, with different included packages, you might consider using several test-domains like TEST-DOMAIN-A.SERVER_DOMAIN.com, TEST-DOMAIN-B.SERVER_DOMAIN.com and what ever - with this way, it is as well easier to keep your pre-configured things up-to-date, because you only have to change the pre-configuration once and resync it within test-domains with the specific included package.

Keep in mind, that after you hand over the new domain to a customer, with the login details for the customer-specific Plesk-account, you have no longer the rights to add, delete or modify things inside the doc_root of that domain, nor have you got the right to modify things in the specific Plesk-account. You can make suggestions, how the customer might change things, but that's about all. IF a customer wants YOU to change this or that, you always have to ask for the actual login details each and every time and you should as well inform the customer, about any changes you made afterwards and remind him, to change the password now. :)
 
Thanks for your reply :)

I understand what you mean (although I don't understand the code :)) but I don't want to give customers server access. The idea is that I create the website and they can change and adjust it by using a cms I created. Every customer gets access to this cms which is configured to their needs. So I want to create 1 single cms/framework/library directory on the server that will be used to create (framework) and maintain (cms) all websites. So, the customer does not have FTP access and can only login to the cms to make changes to his website.

So on the one hand we have all the directories containing the different vhosts, on the other hand I want to create one single directory which contains the framework/cms/library.

So let's say we have some vhosts:

Code:
/var/www/vhosts/www.mysite.com/httpdocs
/var/www/vhosts/www.yoursite.com/httpdocs
/var/www/vhosts/www.someothersite.com/httpdocs
Then all of these vhosts must be able to communicate with the directory:

Code:
/var/www/code/cms
/var/www/code/framework
/var/www/code/library
In other words, every newly created vhost must be able to access the directory /var/www/code. Can that be realised in an easy way?
 
Last edited:
well.... sure... you can create what ever you would like to create and you can modify, what ever you would like to modify, but with these plans, you rather should think about modified open_base directories and symlinks and you could think of domain redirects instead of doc_roots for the domains..., you already got a hint for this from Sergey ( http://forum.parallels.com/showthread.php?306531-can-Plesk-do-this-(is-it-quot-safe-quot-to-move-from-cPanel-to-Plesk-)&p=742157&viewfull=1#post742157 ), sorry... I won't explain the whole procedure and won't give a step-by-step configuration for it, because I don't really think, that you are going the right way. What if a customer decides to move his domain to another hoster? WITH all HIS content, domains and webdesign he paid for? Second, you have a missunderstanding when it comes to privacy policy rights and copyrights. Even if the source code of the CMS might be written, copied, modified or whatever else by you, the content does not belong to you, it belongs to your customers and if they pay for hosting and webdesign, they have the full rights for the end product they paid for.

... but I don't want to start a discussion about legal rights... so I'm better off this thread now. ^^
 
Back
Top