Category: Plesk Toggle Comment Threads | Keyboard Shortcuts

I love Plesk – it’s a work of art that makes my life easier. Rather than a “programme” as such, it’s a web interface that takes control of several thousand services on a web server and makes administering domains and hosting a breeze.

Since 2012 I’ve been a certified Parallels Plesk Automation Technician.

  • Jay Versluis 11:58 am on April 27, 2015 Permalink | Reply  
    Categories: Plesk, WordPress ( 64 )

    How to fix WordPress Media upload trouble caused by open_basedir restriction 

    When I’ve recently migrated a WordPress site from one server to another (running Plesk) and noticed that file uploads were no longer working. All existing files showed up fine, but new uploads were always aborted with a message such as “Is your uploads directory writable?” – which of course it was.

    Here’s what it looked like – a familiar sight for anyone with WordPress issues:

    Screen Shot 2015-04-27 at 11.29.46

    Uploads had been working fine on the pervious server, and other sites on the new server didn’t have a problem. Puzzles like that rob me of sleep and sweet dreams. I decided to poke into any error logs on the new server (which wasn’t even that new mind you).

    To my surprise I found that in /var/www/vhosts/system/domain.com/logs, there was an error log that was seemingly growing out of control very quickly. At one point it was over 500GB in size. Obviously this had a very adverse effect on the that server, which was running out of space when it shouldn’t have.

    The repeating error message was this:

    mod_fcgid: stderr: PHP Warning:  is_dir(): open_basedir restriction in effect. 
    File(/) is not within the allowed path(s): (/home/www/vhosts/domain.com/:/tmp/) 
    in /home/www/vhosts/domain.com/httpdocs/wp-includes/functions.php on line 1501

    Sure I thought, I can understand why the server had a problem with this: the path is just NOT where domain data is saved on my target server. Why was it addressing a path that may have worked on the source server? Shouldn’t WordPress adjust itself automatically?

    Why yes, usually it does – unless of course there’s an old database entry that specifies this path. Many options have been removed from the WordPress admin interface over time, but the values that could be set are still in effect. Thankfully it was an easy fix – even though it took me days to think of this: that nasty path was defined under Settings – Media:

    Screen Shot 2015-04-27 at 11.28.24

    Anything in the top field is a full server path. If it starts with a slash it’s a root path, while no slash at the beginning is a relative path. A wrong path (like mine) messed up all future uploads. All I had to do was delete anything in that field.

    Note that this option only shows up if a path is defined: as soon as I cleared the field, the option disappeared.

    Thanks to cleasterwood for this tip, who had this problem 5 years ago (goes to show how old my WordPress installation really was):

    As for that huge 500GB log file, that’s another story: simply deleting it was not enough to free up space on the server. Because Apache kept an open write connection to that file, I was still running low on space – even though the file was gone. Restarting Apache didn’t do the trick either.

    What did work here was a full server restart. It took a little longer than usual, but the massive log file was gone, and over 500GB of space was back at my disposal. And more importantly, my WordPress instance was accepting uploads again.

    Phew!





     
  • Jay Versluis 4:05 pm on April 23, 2015 Permalink | Reply
    Tags: , ,   

    Categories: Linux, Plesk ( 67 )

    How to open SMTP port 587 to send emails in Plesk 

    Plesk-LogoBy default Plesk on Linux uses Postfix for outgoing email, and by default listens on port 25 for outgoing SMTP mail. Some service providers do not allow to send emails on that port, and tragedy occurs: clients can’t send email with their Plesk servers. Not good.

    Other SMTP ports will usually work, such as the other favourite 587 – but by default, Postfix is not listening on this port for email submissions – at least not in Plesk 12.0.8 on CentOS 7.

    Here’s how to enable port 587 such such ventures:

    Open the Postfix configuration file at /etc/postfix/master.cf and find the following line. It’s commented out. All we have to do is to remove the hash in front of it, and email can be sent via port 587:

    submission inet n       -       n       -       -       smtpd
    

    Restart Postfix for the changes to take effect. In CentOS 5 and 6:

    service postfix restart
    

    This will also work in CentOS 7, but to be more precise:

    systemctl restart postfix.service
    

    Happiness!

    Note that port 587 needs to be open in your firewall. If the Plesk Firewall Extension is enabled, it’ll take care of it for you automagically.

     





     
  • Jay Versluis 6:03 pm on April 22, 2015 Permalink | Reply
    Tags:   

    Categories: Linux, Plesk ( 67 )

    How to turn off all Plesk Health Monitor alert emails 

    Plesk-LogoI have previously described how to adjust the values that the Plesk Health Monitor uses to determine when an email should be sent out.

    There is also a way to switch these emails off entirely. Here’s how:

    To turn off the daemon that is responsible for sending these emails, issue this:

    /etc/init.d/psa-health-monitor-notificationd stop
    

    No more emails until you restart the server, when the daemon will be resumed. If you don’t want that, switch it off at boot time using

    chkconfig psa-health-monitor-notificationd off
    

    To remove the Health Monitor altogether, head over to Tools and Settings – Updates and Upgrades and uninstall the component.





     
  • Jay Versluis 8:24 am on April 21, 2015 Permalink | Reply
    Tags: , , NGINX   

    Categories: Plesk ( 64 )

    How to fix Apache/NGINX trouble after restarting your Plesk server 

    Plesk-LogoSome of my servers have a weird habit of throwing an Apache error after a restart: NGINX is running fine, but Apache can’t start and all websites are down. I have no idea why some servers do it and some do not. But when they do, it’s just plain annoying.

    Here are two ways to fix this problem.

    Restart Apache gracefully

    The quickest option is to shutdown NGINX, restart Apache, tell it to shutdown gracefully and then bring up NGINX again. Here are the commands that will work on CentOS 7:

    systemctl stop nginx.service
    systemctl restart httpd.service
    apachectl graceful
    systemctl restart nginx.service
    

    Likewise, on CentOS 6 we can use the service command to do the same:

    service nginx stop
    service httpd restart
    apachectl graceful
    service nginx restart
    

    Note that Apache doesn’t always like a restart – in which case, stop the service first, give it a moment and then restart it. Quirks and habits I guess.

    Thanks to Mike Yrabedra for this tip!

    If you find yourself doing this a lot, consider writing a quick script with the above commands, or restart your server less often (sometimes it’s enough to restart Plesk, or not reboot the machine at all). Alternatively, you can remove NGINX altogether and avoid such problems in the future.

    Removing NGINX from Plesk

    NGINX is not necessary – Apache will do a good job by itself. If you want to get rid of it completely, head over to Tools and Settings (or the Server Tab if you’re in Power User Mode) and select Updates and Upgrades. You’ll be taken to the Parallels Installer. Select Add/Remove Components.

    Screen Shot 2015-04-21 at 08.10.45

    Scroll down to the NGINX section under Web Hosting Features and untick both NGINX options. Now click Continue at the bottom and NGINX will be removed, leaving Apache in charge for all website connections. There’s no need to restart Plesk.

    Screen_Shot_2015-04-21_at_08_11_17

    Why would anyone want to use both NGINX and Apache together?

    Very good question indeed. Both are excellent web servers, and logic dictates that you should use one or the other. Using two web servers together is a certain sign of trouble.

    From what I understand, NGINX is not designed to be a replacement web server in Plesk (even though NGINX can be used in this way on a LAMP Stack). Instead it is implemented as an enhancement to Apache, sitting in front of it. Static files are therefore served from NGINX via Apache, and NGINX acts as a reverse proxy server.

    The benefits are faster connections and a smaller memory footprint. Read more about how NGINX and Apache are implemented in Plesk in the following articles:





     
  • Jay Versluis 9:47 am on April 20, 2015 Permalink | Reply
    Tags:   

    Categories: Plesk, Screencasts, Windows ( 64 )

    How to setup Plesk Mail in Mozilla Thunderbird for Windows 

    In this video I’ll show you how to setup Plesk Mail in Thunderbird for Windows. Unlike most email clients, Thunderbird can figure out the correct settings by itself – something neither Outlook nor Mac Mail can do. Therefore, the real magic with Thunderbird is figuring out how to get to the account settings.

    To do so, click the three little lines next to the search box. It will bring up a fly-out menu. Under Options – Account Settings, setup a new account or change the settings for an existing one.

    TB-Demo

    Thunderbird is clever usually enough to detect the settings it needs to connect to the Plesk server. In case it fails, use the following:

    • STARTTLS as encryption
    • Authentication: use encrypted password
    • your full email address as user name (such as you@domain.com)
    • Port 143
    • Outgoing Mail Server: Port 587
    • Incoming Mail Server: Port 143 OR 993

    Good luck!





     
  • Jay Versluis 6:21 pm on April 13, 2015 Permalink | Reply
    Tags:   

    Categories: Plesk, Screencasts, Windows ( 64 )

    How to setup Plesk Mail in Microsoft Outlook for Windows 

    In this video I’ll show you how to setup Plesk Mail in Microsoft Outlook on Windows. It’s often a big stumbling block for users. The instructions will also work for Microsoft Essentials, the predecessor of Outlook Express. I’m using Outlook 2010 here, but the instructions are also applicable to later versions.

    The two important windows are under Account Settings, there’s a window with six tabs. One of which is labelled Outgoing Server and the other one is called Advanced:

    Screen Shot 2015-04-13 at 18.16.03

     

    Screen Shot 2015-04-13 at 18.16.13

    Make sure Outlook is set to use TLS for both incoming and outgoing connections. The Root Folder Path needs to be set to INBOX (in all capitals).

    Good luck 😉





     
  • Jay Versluis 4:15 pm on April 9, 2015 Permalink | Reply
    Tags: , ProFTP   

    Categories: Plesk ( 64 )

    How to allow resuming FTP uploads in Plesk and ProFTP 

    Plesk-LogoProFTP has a handy feature that lets uploads resume if they were interrupted, much like Safari downloads. This feature has to be enabled both on the server and the client.

    By default however, resuming uploads are disabled for security reasons – a wise precaution if anonymous uploads are allowed to a server. Here’s how to enabled it.

    Plesk uses ProFTP, and all we have to do is add a couple of lines to the /etc/proftpd.conf file. Anywhere will do, as long as it’s outside the “global” tags:

    # allow resuming file uploads
    AllowStoreRestart on
    AllowOverwrite on
    

    ProFTP is part of the xinetd system service, and for the change to take effect we’ll have to restart this:

    service xinetd restart
    

    To make use of this feature, an FTP client needs to support this feature too: in FileZilla it’s under Settings – Transfers – File Exists Action:

    Screen Shot 2015-04-09 at 12.40.26





     
  • Jay Versluis 4:39 pm on April 6, 2015 Permalink | Reply
    Tags:   

    Categories: Plesk ( 64 )

    How to move the vhosts directory in Plesk 

    Plesk-LogoThe default directory for all web files in Plesk on Linux is /var/www/vhosts. Usually this works well, but if you’d like to use another partition instead, you’ll be pleased to hear that you can!

    Parallels (or Odin as we call them now) have written a handy script which moves the content and patches the relevant configuration file and copies all content at the same time. The script is called transvhosts and you can download it here:

    Download it using wget and make the file executable:

    wget http://kb.sp.parallels.com/Attachments/kcs-12467/transvhosts.pl
    chmod +x transvhosts.pl
    

    It’s a PERL script, which means it needs prefixed with ‘perl’ to be called. Say you want to move your vhosts directory to /home/vhosts, you’d call it like this:

    perl transvhosts.pl --dest-dir /home/vhosts --correct-scripts
    
    Moving files to new directory...
    Correct psa configuration file...
    Correct passwd file...
    Correct server configuration files...
    Clean up symlinks...
    /etc/httpd/conf/plesk.conf.d/vhosts
    Correct php-fpm pools configuration...
    Moving files to new directory...
    Correct psa configuration file...
    Correct passwd file...
    Correct server configuration files...
    Clean up symlinks...
    /etc/httpd/conf/plesk.conf.d/vhosts
    Correct database...
    Update hosting settings...
    done
    Update subdomains settings...
    done
    Update system users settings...
    done
    The service node 'local' was successfully updated.
    Correct user scripts...
    

    This may take a moment or two depending on the amount of content you have in the current directory. The script will patch Plesk’s configuration file and restart the panel. There’s minimal downtime in involved in this process.





     
  • Jay Versluis 9:29 am on March 27, 2015 Permalink | Reply
    Tags: ,   

    Categories: Plesk ( 64 )

    Parallels Cloud Services changes into Odin 

    Odin Logo

    Parallels have announced this week that they’ve changed their name to brand cloud services from Parallels to Odin. This blog post has more details:

    While I dislike change for the sake of change, I believe that it makes a lot of sense in this case. I have been working with Parallels products since 2008, and when I started out I always thought there was a dissociation between the consumer products, such as Parallels Access and Parallels Desktop, and the professional products, such as Plesk.

    The Odin branding will be used for the latter line of products, while the Parallels branding will continue to be used for Parallels Desktop & Co. Parallels Plesk will simply be known as “Plesk”.

    The company itself will remain a single unit for now, simply operating under two brands.

    In case you’re wondering what will become of all those Parallels Summits, they will be renamed to Odin Summits. The first one with this branding will be in May: http://www.odin.com/summit/2015/

    Long live Odin!





     
  • Jay Versluis 8:18 am on March 9, 2015 Permalink | Reply
    Tags: , ENOM   

    Categories: Plesk ( 64 )

    How to view Plesk websites even if your domain does not resolve to your server 

    Plesk-LogoIt’s never good if your server is working fine, but the domains that resolve to it are down for one reason or another. This has happened to me TWICE this year already, and both times it was out of my hands (yes @ENOM, I’m looking at you).

    Many of my clients use websites for data storage, and while it’s not nice when one goes down, it’s even worse if you can’t access information you may have saved as part of a web application. Thankfully there is a way to access Plesk websites even if the domain no longer resolves properly.

    Let me show you how in this article.

     

    1.) Accessing Plesk without a domain

    First let’s gain access to our Plesk server via it’s numeric IP instead of a domain name. Let’s assume that you’ve had access via https://domain.com:8443 before, but domain.com is currently down due to a DNS resolve issue.

    In that case, find out your numeric IP and access your Plesk server with https://12.34.56.78:8843 – replacing 12.34.56.78 with the IP of your server. If you can’t remember, login to your domain host’s control panel and find out what it is.

     

    2.) Preparing an external domain that’s still working

    We need a domain that still works and is not affected by the DNS outage. It doesn’t have to point to the Plesk server whose domains you want to access, but you need access to the DNS records. Perhaps your domain resolves via CloudFlare or DNSMadeEasy, or even your domain registrar’s control panel.

    Let’s call this domain working.com. We must create an A record that looks like this:

    *.12-34-56-78.working.com

    Replace your own IP for your Plesk server here, replacing the dots in your numeric IP with dashes. Don’t forget the asterisk in the front so all requests can be redirected properly.

    You will also have to supply the IP to your Plesk server with the A record. Don’t worry, this change will not impact on the other services hosted with this domain, we’ll simply make an addition.

    One last note: you want this to kick in as soon as possible, so set your TTL to something like 60 rather than 4000. TTL describes the “time to live” in seconds – and we want this emergency preview in place sooner rather than later.

     

    3.) Setting up Plesk with an external Preview Domain

    In Plesk, head over to Tools and Settings – General Settings – Website Preview Settings. If you can’t see Tools and Settings, look for the Server Tab.

    Define an external preview domain here, like this:

    Screen Shot 2015-03-09 at 07.36.53

    This is designed for customers who want to see their websites before a domain has switched to this server. We’re borrowing this functionality in these troubled times.

    Plesk lets you choose a domain from the drop down menu, but assuming none of them are working at this point, our tweaked external domain should work just fine.

    Now head over to the customer control panel for a domain that is not resolving on this server. In our example it’s domain.com. Under Websites and Domains, find the Preview option:

    Screen_Shot_2015-03-09_at_07_47_54

    Clicking this will open a new browser tab which will attempt to display your website on a URL much like this one:

    If all works well you should see your website, all the while bypassing the broken domain, with full PHP scripting capabilities. You can also access subfolders by simply appending them to the URL like this:

     

    Caveat: Subdomains, Permalinks and Redirects

    This isn’t a perfect solution, and several things won’t work with this approach. Webmail for one thing, or anything that is accessed as a subdomain (like webmail.domain.com).

    Another thing that won’t work is permalinks: all Apache mod_rewrite rules will attempt to turn the URL back into its original state, and this means requests may be redirected to the broken domain.

    In addition, web applications like WordPress are usually aware of where they live and you may have to teach them their new (temporary) home URL.

    Here’s how you can fix a WordPress site. It will allow you to write new and access existing posts until the DNS problem has been fixed.

    Try to login using /wp-login.php instead of /wp-admin. Then head over to Settings – General and tweak the two values for WordPress Address and Site Address by changing them to the temporary Plesk Preview URL (see above).

    Before you do, make a note of what these values were before you hit Save. You’ll have to change them back when your real domain resolves again:

    Screen Shot 2015-03-09 at 07.57.37

     

    Next, head over to Settings – Permalinks and simply click the save button. This will update the .htaccess files so that all mod_rewrites can be redirected to the correct temporary URL.

    As soon as the DNS panic is over, change these two URL values back to their original and once again click save under Permalinks.





     
    • Jay Versluis 8:34 am on March 9, 2015 Permalink | Reply

      What about emails?

      I just had a question in regards to accessing emails. There’s no need to change anything on the server for that – simply replace your incoming and outgoing email server settings with the numeric IP of your server.

      This needs to be done in your email client (i.e. Mac Mail, Outlook, Mail for iOS, etc).

      So instead of mail.yourdomain.com, use 12.34.56.78. This will bring up a certificate warning dialogue – ignore it and you’ll have access to your emails again!

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel