plesk use specific directory as root for website - plesk

I got used to have all my websites in /var/www so no matter which domain, each subdomain has its document root located in /var/www/
Plesk is trying to force me to use /var/www/vhosts/domain/ and I did not find a way to tell Plesk to just put everything into /var/www.
I don't want a whole new structure, I want to migrate my existing websites from my old server (without Plesk) to my new server running Plesk 17.8
Edit: Feel free to answer this question for future reference but I won't need it as I realized that no sane person would use Plesk. Server will be reinstalled.

This may help you:
In Plesk for Linux, transvhosts.pl utility can be used to change the location for all virtual hosts:
# /usr/local/psa/bin/transvhosts.pl --help
In the following example, the location is changed to /home directory:
# /usr/local/psa/bin/transvhosts.pl --dest-dir /home --correct-scripts
Note, that currently Plesk Onyx with SELinux enabled does not support custom vhosts directory.

Related

PURE-FTPd and Apache userdir | how to make public_html directory in home automaticly

I am using an Ubuntu 20.04.2 LTS Server and Apache 2.4.41.
I´ve installed pureFTPd with mySQL and inserted some test users. The users register in a frontend and then they are created in the SQL Database via PHP. It works fine.
But I want all users to be able to host a website. For this I installed the mod userdir for Apache. This mod needs a subdirectory in the home folder, in my case public_html.
Is there a possibility to let pureFTPd create this folder automatically as soon as the home directory is created?
Some details on your pureFTPd/mysql setup would be helpfull.
TL;DR: PureFTPd doesn't support home directory template/skeleton
https://serverfault.com/questions/615487/create-home-directory-from-skeleton-upon-ftp-first-login
Also the userdir apache module rely on system auth to map username to home directory, if you only setup pureFTPd to query a mysql user database it won't work the way you expect.
You would need to make this mysql database a system authentication base by using components like libpam-mysql and libnss-mysql, given this setup in place you could then use pam-mkhomedir to spin-up a home directory template with this public_html folder.
I wouldn't recommend this however, a mod-rewrite based solution with a username.domain.tld mapping to /path/to/ftp/user/htdocs would be probably safer, and combined with Pro-FTPd ability to create the home directory based on a template this could work the way you want.
Of course there is also a third and probably simpler way: have your user-management interface create the home directory the way you want it.

Migrate files from drupal 7 to drupal 8

I have Drupal 7 website and i need to upgrade it to Drupal 8 i’ve followed drupal website documentation for upgrading to drupal 8 using web browser https://www.drupal.org/docs/8/upgrade/upgrade-using-web-browser#source-site
Now both sites installed in the same server with different domains.
When i added database access all data migrated successfully else the media files because I have an error in public file directory input  i’ve tried the following directories but each one return error.
1- When I added public files directory with the website address as https://drupal7migration.mydomain.com/sites/default/files 
Or
https://drupal7migration.mydomain.com/sites/default/files
the error was unable to read from public files directory. Client error 'Head  https://drupal7migration.mydomain.com/sites/default/files' resulted in a 404 not found response.
2- When I added the local file directory:   /var/www/vhosts/drupal7migration.mydomain.com/httpdocs/sites/default/files
Or
/var/www/vhosts/drupal7migration.mydomain.com/httpdocs/sites/default/files/public
Or
/var/www/vhosts/drupal7migration.mydomain.com/httpdocs/sites/default/public
the error was "unable to read from public files directory".
also the sites folder has 777 permission.
So, what’s the right public file directory that should be added to migrate both database and files successfully?
The files folder usually lives in :
/sites/yourSite/files.
Given the errors you indicated, it sounds like the “web server” doesn’t have enough permissions to the /sites/yourSite/files (read, write , and execute).
So determine the user under which your web server is running and make sure that use has enough permission.
See docs for more:
https://www.drupal.org/docs/7/install/setting-up-the-files-directory
Also, look at your web server vhost to get the actual documentRoot location.
I don’t think what you have is correct:
 /var/www/vhosts/drupal7migration.mydomain.com/httpdocs/sites/default/files
Is probably meant to be
 /var/www/vhosts/drupal7migration.mydomain.com/sites/default/files
Normally,
You have /
var/www/HTML/example.com
Point
to your Drupal install as:
/
yourDrupalInstall/sites/example.com
Or
 /yourDrupalInstall/sites/default
/files

Plesk Webserver - New domain redirects to server IP rather than index.html

I'm running Plesk 12.0.18 on Ubuntu 12.04.5 and have a problem with a recently added domain.
The domain was added to plesk for a new website and has its own directory (httpdocs/goodsnap). When I visit the domain http://goodsnap.co.uk it redirects to the default domain on the server IP rather than opening the index.html file within httpdocs/goodsnap.
I can open the index file manually by going to http://goodsnap.co.uk/index.html and also get into WP by going to http://goodsnap.co.uk/wordpress
Can anyone advise how to rectify this? I have tried setting a redirect to the wordpress subdirectory by placing a .htaccess in httpdocs/goodsnap but it makes no difference.
Many Thanks
Tom

Change Local Path for CakePHP over II6 and windows 2003

I have followed this article to configure CakePHP over II6:
http://bakery.cakephp.org/articles/jamesmking/2008/04/12/cakephp-on-iis6-with-fastcgi-sql-server-2005-and-isapi_rewrite
But i want to change the "Local Path" from "C:\Inetpub\wwwroot\CakePHP\app\webroot" to "C:\Inetpub\wwwroot\" in order to be able to execute different web applications and not only the CakePHP one.
I have tried it changing the "local path" on the IIS manager but i doesn't work. I guess it should be something related with the ISAPI Rewrite and its conditions.
Do you know how could I make the needed changes in order to make it work?
Regards.
Move the .htaccess file in the root of the site's root folder.

Changing the host of my CakePHP site

I bought an application made in ​​Cakephp, everything was fine before, but once I wanted to host it on another server (with keeping the same database and folders), I find the links to the CSS, JavaScript and images do not work.
Please I have no knowledge in CakePHP.
Did you clean up the database?
I had to change some entries by hand once, because the servername/ip/url didn't change.
go to your db management system and search for your old IP/Path/domainname etc....
Did you copy over the (often hidden) .htaccess files when you moved to the new host?
There are three .htaccess files, one in the root of your site, on in the /app directory, and one in /app/webroot
Is mod_rewrite enabled on your new server?

Resources