Plesk: Difference between revisions

From Cheatsheet
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
<pre>/var/www/vhosts/HoudiniESQ.com/conf</pre>
<pre>/var/www/vhosts/HoudiniESQ.com/conf</pre>


=== Turn off Safe_mode in plesk ===
=== Turn off Safe_mode and open_basedir in plesk ===
NOTE-dont forget to replace <domain name>, with the actual domain name.<br>
NOTE-dont forget to replace <domain name>, with the actual domain name.<br>
Create a “vhost.conf” file in “/var/www/vhosts/<domain name>/conf/”
Create a “vhost.conf” file in “/var/www/vhosts/<domain name>/conf/”

Revision as of 02:36, 17 April 2012

Plesk


Location of the vhost in plesk

/var/www/vhosts/HoudiniESQ.com/conf

Turn off Safe_mode and open_basedir in plesk

NOTE-dont forget to replace <domain name>, with the actual domain name.
Create a “vhost.conf” file in “/var/www/vhosts/<domain name>/conf/”

cd /var/www/vhosts/<domain name>/conf/
vim vhost.conf

Insert the following into it.

<Directory /var/www/vhosts/<domain name>/httpdocs>
php_admin_value safe_mode off
php_admin_value open_basedir none
</Directory>

Now run the following to update the conf.

/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=<domain name>

Now restart httpd

service httpd reload

Dumping Databases in Plesk

mysqldump -u admin -p database > .sql

Running Awstats in plesk

Notice: Aquired from the following:
Parallels Forum

update all domains

/usr/local/psa/admin/sbin/statistics --calculate-all

Update a single domain

/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=domain.tld

Email issues

If you ever find that emails are throwing this error on a plesk server while trying to be sent follow the steps below.

tail -f /usr/local/psa/var/log/maillog

I see this:

Nov 29 20:34:15 host X-Qmail-Scanner-2.08st:
[host.dokuga.com12910808557906501] clamdscan: corrupt or unknown clamd scanner
error or memory/resource/perms problem - exit status 512/2 
Nov 29 20:34:15 host X-Qmail-Scanner-2.08st: [host.dokuga.com12910808557906508] clamdscan:
corrupt or unknown clamd scanner error or memory/resource/perms problem - exit
status 512/2 
Nov 29 20:34:15 host X-Qmail-Scanner-2.08st:
[host.dokuga.com12910808557906516] clamdscan: corrupt or unknown clamd scanner
error or memory/resource/perms problem - exit status 512/2 
Nov 29 20:34:15 host X-Qmail-Scanner-2.08st: [host.dokuga.com12910808557906523] clamdscan:
corrupt or unknown clamd scanner error or memory/resource/perms problem - exit
status 512/2

Then try to update clamd with the following.

freshclam

If that returns this error do the next part if not find another solution.

ClamAV update process started at Mon Nov 29 21:04:07 2010
main.cld is up to date (version: 53, sigs: 846214, f-level: 53, builder: sven)
WARNING: Current functionality level = 44, recommended = 53
Please check if ClamAV tools are linked against the proper version of libclamav
DON'T PANIC! Read http://www.clamav.net/support/faq
ERROR: chdir_tmp: Can't create directory ./clamav-ba29cb18cefd7655eebdcc82d2f7401d
WARNING: Incremental update failed, trying to download daily.cvd
ERROR: getfile: Can't create new file /var/clamav/clamav-08bf3637d601dae2695c04b7fc08d9ea in /var/clamav
Hint: The database directory must be writable for UID 111 or GID 105
WARNING: Can't download daily.cvd from db.us.clamav.net

now do this

cd /var
ll | grep clamav

if the results look like this:

drwxr-xr-x  2 qscand qscand  4096 Nov 29 04:34 clamav

You will need to do the following

chown -R qscand. clamav
chmod 777 clamav/
freshclam
/etc/init.d/clamd restart

Now you should have the following:

drwxrwxrwx  2 qscand qscand  4096 Nov 29 21:22 clamav

And this should solve the problem, as well as have all up to date virus stuff's.

Adding alternate port to smtp in plesk

http://kb.parallels.com/837

QMail (Parallels Plesk Panel 8.x, 9.x)

vim /etc/services

add the following:

smtp_alt 587/tcp # new SMTP port

save and exit

cp -Rp /etc/xinetd.d/smtp_psa /etc/xinetd.d/smtp_psa_alt
vim /etc/xinetd.d/smtp_psa_alt

Change the server line withing the new file to the following:

service smtp_alt

Restart xinetd:

/etc/init.d/xinetd restart

Now SMTP connections will be accepted on both the standard and 25025 ports. You may also need to reconfigure Horde IMP (webmail) settings so they also use the alternative SMTP port. This can be done in:

vim /etc/psa-horde/imp/servers

php file under the smtpport parameter for both IMAP and POP3 servers.

If you have a 'netd' super-server (Debian or FreeBSD), modify inetd.conf to enable an additional SMTP port:

grep '^smtp ' /etc/inetd.conf | sed 's/^smtp/smtp_alt/' >> /etc/inetd.conf

and restart inetd.

/etc/init.d/inetd restart

NOTE: If you wish to disable the default (25) port completely and continue using only an alternate one, please do not block the 25 port at the firewall and do not remove the 'smtp_psa' service from the xinetd/inetd but set the default SMTP service to be listened only on 127.0.0.1 by adding 'bind = 127.0.0.1' to /etc/xinetd.d/smtp_psa. Otherwise, the SMTP service status will be displayed incorrectly in Plesk CP. Plesk determines SMTP service status by checking the 25th port and the port number is hardcoded there.


Postfix (Parallels Plesk Panel 9.x, 10.x, ...)

Add the following line to the Postfix configuration file:

vim /etc/postfix/master.cf:
<IP_Address>:<port> inet n - - - - smtpd

where <IP_Address> is the IP address of your server and <port> is the additional port for the SMTP connection.

If Postfix is configured to use Postfix Before-Queue Content Filter extend the line with the proxy filter settings:

<IP_Address>:<port> inet n - - - - smtpd -o smtpd_proxy_filter=127.0.0.1:10025

Reload the mail service with mailmng after the reconfiguration:

/usr/local/psa/admin/sbin/mailmng --reload-service

You should get:

Reloading postfix: [  OK  ]


upgrade php in plesk

Notice: Due to recent changes at atomic repos this might not work, proceed to the does not work steps.


please make sure that you remove the old atomic repo if there was any.

rpm -qa | grep atomic

to remove do the following.

rpm -e (atomic package name the previous command provided)

atomics repo

All you have to do is the following.

wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh 
yum upgrade php
/etc/init.d/httpd restart
php -v

After you restart if the output gives you an error about ioncube just reinstall it.

yum search ioncube

now install whatever package it lists, make sure it matched your distro system bit (uname -a)

yum install php-ioncube-loader.x86_64
/etc/init.d/httpd restart
php -v

Now everything should work for you, and if this does not work for you do the following.

After you add the atomic repo, just run a:

yum update -y

now all of your php should be version 5.3, at this point if you need to install more modules please do them now.

EXAMPLE mcrypt.

yum search mcrypt

this provides me with this list.

libmcrypt.x86_64 : Encryption algorithms library
libmcrypt-devel.x86_64 : Development libraries and headers for libmcrypt
php-mcrypt.i386 : Standard PHP module provides mcrypt library support
php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support

if you have trouble with mcrypt this is what saved me. http://www.kelvinwong.ca/2009/12/06/install-libmcrypt-and-php-mcrypt-on-centos-5-3-without-losing-too-much-hair/

Now run a uname -a and install all packages that match your systems bit.

yum install libmcrypt.x86_64 libmcrypt-devel.x86_64 php-mcrypt.x86_64

once this has completed you are ready to switch to php 5.2 assuming that you only need to add mcrypt.

now do the following.

rpm -qa | grep php-

output should be similar to

php-common-5.3-1.el5.art
php-devel-5.3-1.el5.art
php-xml-5.3-1.el5.art
php-pdo-5.3-1.el5.art
php-5.3-1.el5.art
php-mbstring-5.3-1.el5.art
php-imap-5.3-1.el5.art
php-mcrypt-5.3-1.el5.art
php-cli-5.3-1.el5.art
php-mysql-5.3-1.el5.art
php-gd-5.3-1.el5.art

the output of all the system php modules, now run the following to complete this task.

yum downgrade php* 

Make sure everything listed in the above output for "rpm -qa | grep php-" is listed in Downloading Packages.

type y and continue the install

After this fail of a method has completed please check

php -v

make sure everything looks correct.

repeat

yum downgrade php* 

until you are at the desired version