Archive for the ‘Plesk Control Panel’ Category

Howto Create ‘Catch all’ subdomains in Plesk

Friday, July 16th, 2010

A ‘catch all’  subdomain allows you to redirect all users who might type in http://subdomain.yourdomain.com  where ‘subdomain’ could be any subdomain which you would like to redirect users from.

Why would you need catch all subdomains

Maybe you have a few subdomains but sometimes your visitors are accessing non-existing subdomains. So the most appropriate solution would be to either redirect them to your main website or at least show them a list of available pages.

Step-by-step configuration in Plesk

  1. Create a subdomain ‘z-WILDCARD’ in Plesk – under the admin section of the right domain.
    Why do we need this name?  Because this entry should be the last entry in the list of subdomains, otherwise this “trick” will not work.
  2. Add special configuration (catchall for all subdomains) to the vhosts.conf file of this subdomain.
    Normally it’s located in /srv/www/vhosts/domain.com/subdomains/z-WILDCARD/conf/vhosts.conf. You have to create it – normally you need the root user to do this. Copy the following content into the file:
    ServerAlias *.domain.com
  3. Apply the new configuration – recreate the Apache configuration. You have to run the tool websrvmng which is a Plesk tool that manages and creates the webserver configuration. Execute the following as root user.
    /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com
  4. Finally – restart Apache to load the new configuration, also as root.
    service httpd restart

That’s it! Now your users can access non-existing subdomains as e.g. doesnotexists.domain.com and you should see the Plesk page displayed for new pages.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Alternate SMTP port through Plesk for Linux

Saturday, September 12th, 2009

Nowadays, quite a few ISPs block port# 25 which is the default SMTP port for relaying email for security purposes, so you need to configure an alternative port for SMTP connection.

Use instructions below to configure an additional alternate SMTP port in a Plesk Server running in Redhat Enterprise Linux Version 4/5 or CentOS version 5 in Qmail Server.

Choose any unused port and add it to the /etc/services file, for example:

smtp_alt        8425/tcp        mail            # Alternate SMTP Port
smtp_alt        8425/udp        mail            # Alternate SMTP Port (optional)

Make a copy of /etc/xinetd.d/smtp_psa to /etc/xinetd.d/smtp_psa_alt and correct service line within new file:

service smtp_alt

Below is a sample of smtp_psa_alt file.

service smtp_alt
{
socket_type     = stream
protocol        = tcp
wait            = no
disable         = no
user            = root
instances       = UNLIMITED
server          = /var/qmail/bin/tcp-env
server_args     = -Rt0 /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var
/qmail/bin/cmd5checkpw /var/qmail/bin/true
}

Restart xinetd and Qmail

service xinetd restart
service qmail restart

SMTP connections will be accepted on the both standard and 8025 ports. You may also need to reconfigure Horde IMP (webmail) settings so it uses the alternative SMTP port too. This can be done editing the following file in Horde webmail:

/etc/psa-horde/imp/servers.php file under smtpport parameter for both IMAP and POP3 servers.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

How to unlock Plesk admin user from the shell console

Monday, April 6th, 2009

The default lock time is 30 minutes. Do not attempt to log in until next 30 minutes and it will get unlocked itself. If you make 3 additonal failed attempts to login, this will lock out the users for an additional 30 minutes.

You can manually remove the lock from psa database.

Do the following from the shell console
# mysql -u admin -p`cat /etc/psa/.psa.shadow`
mysql> use psa;
mysql> delete from lockout where login = 'admin';

This short but helpful tip would allow you to login to the admin panel immediately without having to wait for 30 or more mins.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Creation of additional FTP users for Plesk Linux

Sunday, March 15th, 2009

Plesk is a great Control Panel in  the shared hosting environment, but there are a few things that are not available in the Control Panel. For example, you cannot create additional FTP user in Plesk Control panel for Linux (this support is enabled in Plesk for windows).  But some time it is required to have multiple FTP accounts to upload/download data. You need to have shell access since the Plesk control panel won’t allow it in the GUI.

Assuming you already have an existing domain (example.com) with the primary FTP user (jack) with password (schmidt) with home directory (/var/www/vhosts/example.com), and you wish to create additional ftp users (jill and bob) with the same access privileges as jack:

Procedure:

Login to server via SSH as root.

Issue the shell command:

#cat /etc/passwd |grep ‘jack’

This will show you a line similar to the following:

jack:x:10041:10001::/var/www/vhosts/example.com:/bin/false

The first number (after the 2nd colon : ) is 10041, so this is the UID of user jack. You will need this in the ‘useradd’ lines since useradd wants a number for the UID.

The second number (after the 3rd colon : ) is 10001, this is the GID (psacln), we won’t need that right now.

Then run the following shell commands to create the users and passwords:

#useradd -u 10041 -o -d /var/www/vhosts/example.com -g psacln -s /bin/false jill
#useradd -u 10041 -o -d /var/www/vhosts/example.com -g psacln -s /bin/false bob
#passwd jill (enter the new password and confirm it, does not have to be the same as jack’s)
#passwd bob (enter the new password and confirm it, does not have to be the same as jack’s)

You should now be able to use an FTP client to login with that user’s name and password.

User jill and bob should be able to see the example.com docroot just as user jack can. You should NOT be able to browse above the example.com docroot directory. All 3 users should have the same access to the files since they belong to the same group, so no matter which of the users created or edited the file(s), all should be able to access/edit/whatever the same files.

(NOTES: Since these are users defined at the OS level, when connecting with an FTP client, they would login with username ‘jill’, ‘bob’, or ‘jack’. They would NOT use ‘jill@example.com’. This also means that USERNAMES MUST BE UNIQUE.)
(more…)