Mohammedz.com

For Linux and Shell scripting.


Leave a comment

Plesk restore: Restore domains from old hard drive

The operating system must be reloaded onto a separate disk, which will become the primary, and old disk can be mounted as a different mount point like /restore. Plesk actually has a nice migration tool (PleskX.pl), and as such, a disk to disk-based migration is easy to accomplish. The following steps can be used:

1. Mount the old drive, for example to the /restore directory. If there are several partitions on the old drive, for example / and /var, they all should be mounted as they were in the old system, so / is mounted to /restore/ and /var/ to /restore/var/

2. Stop all Plesk services in the new system with:
# /etc/init.d/psa stopall

3. Copy the migration agent to the old drive (make sure that there is enough free disk space to perform the dump):
# mkdir /restore/migration
# mkdir /restore/migration/archives
#cp -r /usr/local/psa/PMM/agents/shared/* /usr/local/psa/PMM/agents/PleskX/* /restore/migration

4. chroot to the root directory of the old server (/restore in our case):
# export SHELL=/bin/bash
# chroot /restore

5. Start MySQL from the old drive in the new chrooted environment:
# /etc/init.d/mysql start

6. Run migration agent to make Plesk dump (note, this may take a few hour depending on the amount of data to backup):
# cd /migration
# ./PleskX.pl –dump-all -v5

7. Move all files except for dump.xml from /restore/migration/ to /restore/migration/archive directory.

8. You can now import data via the Plesk control panel. Select the import option on the Server->Migration page and specify /restore/migration (used in this example) as the working directory.

~Jimmy Thomas


Leave a comment

FTP not working….. Connection closed by foreign host.

My FTP service is not working. When I try telneting to ftp port, it gets closed by foreign host soon after connecting.

-bash-3.1# telnet localhost 21
Trying 127.0.0.1…
Connected to localhost (127.0.0.1).
Escape character is ‘^]’.
Connection closed by foreign host.
-bash-3.1#

Solution
***********
The server is having Plesk control panel installed. So, ftp service is proftp which is started with xinetd. So, restarted xinetd and check if ftp is listening on port 21.

-bash-3.1# netstat -plan |grep 21
tcp 0 0 0.0.0.0:106 0.0.0.0:* LISTEN 2173/xinetd
tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 3221/httpsd
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 2173/xinetd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2173/xinetd

Yes, it’s listening and xinetd didn’t show any errors. But, still FTP connection is in the old stated……Connection closed by foreign host.

Just check /etc/xinetd.d/ftp_psa to see how ftp service is getting started and started it manually. Hmm…….it shows errors now :(.

root@~#/usr/sbin/in.proftpd -c /etc/proftpd.conf
– IPv4 getaddrinfo ‘your.hostname.com’ error: Name or service not known
– warning: unable to determine IP address of ‘your.hostname.com’
– error: no valid servers configured
– Fatal: error processing configuration file ‘/etc/proftpd.conf’
root@~#

The hostname entry “your.hostname.com” was missing in /etc/hosts.
root@~#hostname
your.hostname.com
root@~#hostname -i
hostname: Unknown host
root@~#

So, added “your.hostname.com” to /etc/hosts and restarted xinetd service. That resolved the issue.


2 Comments

Plesk Error Massage 553 “Message did not Reach Intended Recipients. That Domain isn’t in my list of Allowed RCPThosts”.

Use this article to repair the following error message:

“Your message did not reach some or all of the intended recipients. 553 sorry, that domain isn’t in my list of allowed rcpthosts”

1. Log in as admin to the Plesk control panel.
2. In the server administration (click “Server” in the menu), click “Mail”.
3. Select the tab “Maximum letter size and relay mode parameters”.
4. Check the box “POP 3 lock time”
5. Click “Set”
6. Restart “psa”

This should repair the error message and allow all messages to be sent.


1 Comment

My Plesk Control Panel is Showing a Blank Page. How Can I Locate the Error?

If you see empty page in Plesk control panel instead of a page with content, it means that an error occurred. By default Plesk does not show PHP errors for security reasons. To enable PHP error reporting, you can edit $PRODUCT_ROOT_D/admin/conf/php.ini and set display_errors = On, then restart Plesk. This should resolve the issue and help you locate the error.


2 Comments

How to Enable MAPS SPAM Protection in Plesk

To enable MAPS SPAM protection in Plesk, begin by selecting the server you wish to manage, then “Mail”, then “MAPS Zone”. The 5 major SPAM protection lists are listed below with a general description. Users can define which lists they would like to use:

1. Spamhaus block list (SBL) sbl.spamhaus.org: A free real-time DNS-based database of IP addresses of verified SPAMmers, SPAM gangs and SPAM services.
2. Arbitrary black hole list (ABL) spammers.v6net.org: Aggressive black list that may stop mail from popular mail servers (xxx.yahoo.com, xxx.hotmail.com)
3. Domain Name System Real-time Black List (DNSRBL) dun.dnsrbl.net: List of IP addresses of machines that are either direct SPAM sources or Dial-up (dynamic address) pools which would never be a source of non-SPAM messages.
4. VOX DNSBL vox.schpider.com: List of servers that send out SPAM, compiled by phydiux.com and it’s partners.
5. RFC Ignorant (Whois) whois.rfc-ignorant.org: List of IP’s that do not comply with RFC’s.

In the newer versions of Plesk, such as Plesk 8.1, they have renamed the “MAPS Zone” option to “Enable support for Trend Micro RBL+ Service.” If you want to enter multiple lists, separate the lists by semicolon. For example: “maps1.domain.com” or “maps1.domain.com;maps2.domain.com”.


7 Comments

Plesk for Windows Webmail Error: Webmail Cannot be Found

If you are getting an error that says “File cannot be found” or if you are receiving a 404 error when you try to go to webmail.mydomain.com, this is due to the fact that default mapping application extensions do not include php support.To solve this, do the following:

1. Go to “Start” – > “Administrative Tools” -> “Internet Information Services (IIS) Manager”
2. Expand the server (local computer)
3. Expand “Web Sites”
4. Right-click on “webmail(default)” and click “Properties”
5. Go to the “Home Directory” tab
6. Click on the “Configuration” button towards the bottom.
7. In the list box that appears, if the extensions php, php3, and phtml do not exist, you have found your problem.
8. Click “Add”
9. Type the location of the file php.exe in the “Executable” field. For example: C:\Program Files\SWsoft\Plesk\Php\php.exe
10. Type: .php in the “extension” field.
11. Leave everything else as default checked. Click “OK”.
12. Repeat this setup using the same executable and adding the extensions: .php3 and .phtml
13. Exit out of everything. Webmail should be up and running now.


Leave a comment

How to Change the Plesk Outgoing Mail Port

Follow the steps below if you want to change the outgoing mail port for Plesk:

1. Create a copy of smtp_psa by entering:
1. # cp /etc/xinetd.d/smtp_psa /etc/xinetd.d/smtp_nonstandard
2. Add these lines to the copy you just made:
1. type = UNLISTED
port = 2525 < Port to which smtp service should bind >
and change the service name to match the name of the file.
3. Restart xinetd:
# /etc/init.d/xinetd restart

You should now be able to send mails through port 2525. You can choose any other port, if needed.