顯示包含「Plesk 虛擬主機」標籤的文章。顯示所有文章
顯示包含「Plesk 虛擬主機」標籤的文章。顯示所有文章

星期四, 9月 27, 2018

Plesk shows error with custom template: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhostIpDefault.php

Symptoms

The following error is shown on main page of Plesk:
New configuration files for the Apache web server were not created due to the errors in configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhostIpDefault.php, error = TemplateException: Template domain/service/wordpress.php doesn't exists file: /usr/local/psa/admin/plib/Template/Processor.php line: 28 code: 0 Previous error: TemplateException: Template domain/service/wordpress.php doesn't exists file: /usr/local/psa/admin/plib/Template/Processor.php line: 28 code: 0 Previous error: Template_Exception: Template domain/service/wordpress.php doesn't exists file: /usr/local/psa/admin/plib/Template/Finder.php line: 25 code: 0. Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter

Cause

Corrupted or invalid /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.phpfile, which acts as a custom template configuration files.

Resolution

  1. Connect to the server using SSH.
  2. Create a backup of /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php using the following command:
    # mv /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php.backup
  3. Rebuild Apache configuration:
    Warning: Reconfiguration implies downtime, which depends on the number of domains.
    # /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
  4. If the issue persists, move all the custom templates:
    # mv /usr/local/psa/admin/conf/templates/custom /usr/local/psa/admin/conf/templates/custom_old
  5. Delete information about failed configuration:
    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin -Dpsa -Ne "delete from Configurations where status='error'"
  6. Rebuild Apache configuration:
    Warning: Reconfiguration implies downtime, which depends on the number of domains.
    # /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

星期三, 3月 01, 2017

Linux fuser 造成主機系統負載過高,網站開啟不了的解決方式

Cause

The script plesk-php-cleanuper contains a string ' ! -execdir fuser {} \\ ', which opens every file in the/var/lib/php/session directory and checks that it is not used by a working process and can be deleted. However, the maximum number of open files is set to 1024 by default.

fuser是一個UNIX命令,用於顯示哪些進程正在使用指定的文件,文件系統或unix套接字,find命令用於查找Unix或Linux系統上的文件


1. 使用 ps aux | grep 'fuser' 指令查出, fuser 所使用的pid號


2. 再使用 kill -9 8352 強制停止該程序。 8352 是fuser pid號

3. 如果網站還是無法正常顯示重新啟動 httpd

#/etc/init.d/httpd restart


問題產生原因如下 :

PHP Session Cleanup failing

https://support.plesk.com/hc/en-us/articles/213947925-PHP-Session-Cleanup-failing




星期二, 9月 27, 2016

Error on Home page: New configuration files for the Apache web server were not created

Symptoms
There is an error message on the Home page or in Domains > example.com page:
New configuration files for the Apache web server were not created due to the errors in configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainForwarding.php, error = Template_Exception: No data. file: /usr/local/psa/admin/plib/Template/Processor.php line: 27 code: 0 Previous error: Template_Variable_Exception: No data. file: /usr/local/psa/admin/plib/Template/Variable/AbstractCachedData.php line: 65 code: 0. The error message containing the detailed error descriptions was sent to you by e-mail. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.
There are one or more entries in Configurations table with error status:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ne"select * from Configurations where status='error'\G"

Cause

Entries for several domains are absent in psa database.

Resolution

Get the affected domain name:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ne"select name from domains where id in (select objectId from Configurations where status='error')"
Reconfigure domain name in question:
/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain example.com
If some configurations still need to be fixed, run the following:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ne"delete from Configurations where status='error' \G" 

星期六, 9月 27, 2014

Fail2ban configuration for ProFTPd with Plesk on RHEL CentOS Fedora Redhat-based Linux

詳細說明 http://www.shkodenko.com/fail2ban-configuration-for-proftpd-with-plesk-on-rhel-centos-fedora-redhat-based-linux/



 

星期一, 7月 28, 2014

未建立 Apache web 伺服器的新設定檔因為配置範本中出現錯誤

未命名-1



 



缺少 apsc.aps_application_resource 資料表處理方式 請參考以下連結



http://kb.parallels.com/en/122174



 



另外需要重新生成範本,這部份尚未確認是否會影響正常的網站,先不執行,等確認後再說。

#/usr/local/psa/admin/sbin/httpdmng --reconfigure-all


 



 



 

星期六, 6月 14, 2014

Plesk Panel is not accessible after the upgrade: Can't create/write to file

執行到第五點 客戶端管理就正常了

Symptoms


  1. Plesk Panel is not accessible after the upgrade. The following error can be observed in the/usr/local/psa/admin/logs/panel.log:

    2013-09-14T00:30:40+01:00 CRIT (2): Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql_691_0.MYI' (Errcode: 28)
    
    file: /usr/local/psa/admin/plib/Zend/Db/Statement/Pdo.php
    
    line: 238
    
    code: 0
    
  2. The Plesk version file /usr/local/psa/version has incorrect Plesk version:

    # cat /usr/local/psa/version
    
    10.3.1 CentOS 6 1013110726.09
    
  3. There are two psa packages in the system: psa package from the previous Plesk Panel version and from the 11.5 Plesk Panel.

    # rpm -q psa
    
    psa-10.3.1-rhel6.build1012110718.16.x86_64
    
    psa-11.5.30-cos6.build115130819.13.x86_64 
    

Cause

Failed upgrade from previous version.

Resolution


  1. Create databases backup:

    # mkdir /root/mysql_backups/
    
    # mysql -uadmin -p`cat /etc/psa/.psa.shadow `  psa -Ne"show databases"|grep -v information_schema|while read db;do mysqldump -uadmin -p`cat /etc/psa/.psa.shadow ` $db > /root/mysql_backups/$db.`date +%F_%H.%M`.sql;done
    

  2. Find the pre-upgrade psa dump:

    # grep -i dump_d /etc/psa/psa.conf
    
    DUMP_D /var/lib/psa/dumps
    
    
    
    # ls -l /var/lib/psa/dumps/mysql.preupgrade*
    
    -rw------- 1 root root 461031 Sep 14 19:15 /var/lib/psa/dumps/mysql.preupgrade.10.12.0-11.5.30.20130914-191454.dump.gz
    
    -rw------- 1 root root   2524 Sep 14 19:15 /var/lib/psa/dumps/mysql.preupgrade.apsc.10.12.0-11.5.30.20130914-191504.dump.gz
    
  3. Use found mysql.preupgrade dump, run the following command:

    # zcat /var/lib/psa/dumps/mysql.preupgrade.10.12.0-11.5.30.20130914-191454.dump.gz | sed -n '/^CREATE DATABASE.*psa/,/^CREATE DATABASE.*horde/p' > preupgrade.sql                                                                             
    
  4. Remove psa-11.5.30 package:

    # rpm -q psa
    
    psa-10.3.1-rhel6.build1012110718.16.x86_64
    
    psa-11.5.30-cos6.build115130819.13.x86_64
    
    # rpm -e --nodeps --noscripts --justdb psa-11.5.30-cos6.build115130819.13.x86_64
    

  5. Restore the pre-upgrade psa database :

    # cat preupgrade.sql | mysql -uadmin -p`cat /etc/psa/.psa.shadow`
    

  6. Run Plesk Panel upgrade using the autoinstaller:

    # /usr/local/psa/admin/bin/autoinstaller


Plesk 11.0.9 升級到 11.5 失敗 錯誤處理

更新失敗後 發現 無法登入 plesk



參考這邊文章 http://kb.parallels.com/en/121741 順利解決登入Plesk 管理介面



 



先使用 root 登入伺服器,然後 參考下面指令 登入到 psa 資料庫,再參考上面的說明,使用指定



把遺失的表格加入

Resolution



The table should be created manually. Execute the following query for the Plesk database:





CREATE TABLE `ServiceNodeProperties` ( `serviceNodeId` int(10) unsigned NOT NULL, `name` varchar(255) CHARACTER SET ascii NOT NULL, `value` blob NOT NULL, PRIMARY KEY (`serviceNodeId`,`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;



 

How to access Parallels Plesk Panel database



Linux



To access Plesk database on Linux, use the following command:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa

星期一, 4月 14, 2014

How do I restart Parallels Plesk Panel

Parallels Plesk Panel for Linux:



# /etc/init.d/psa stop

# /etc/init.d/psa start

星期三, 1月 01, 2014

如何降级 CentOS 5.x/6.x 上的 PHP 5.3

APPLIES TO:

Parallels Plesk Panel 11.x for Linux

Parallels Plesk Panel 10.x for Linux



故障

网站上运行的 PHP 应用程序与 PHP 5.3 不兼容,需要降级服务器上的 PHP



解决方案

基于 CentOS 5: PHP 5.3.x 由 Parallels 提供,而从操作系统供应商库可获取 PHP 5.1.x。



降级步骤如下:

因为 PHP 5.3 程序包有 "php53" 或 "php53-mysql," 等名称,因此无法由供应商的 PHP 程序包替代,需要移除这些程序包,忽略其相关性:



rpm -qa | grep php53 | xargs rpm -e --nodeps



从供应商库安装 PHP:

yum install php php-pdo php-gd php-imap php-mbstring php-mysql php-xml php-cli



下载适合您的 Plesk 版本和服务器 CPU 基础架构的 Plesk psa-php5-configurator 程序包:

Plesk 10.4.4 基于 CentOS 5 i386

Plesk 10.4.4 基于 CentOS 5 i386

Plesk 11.0.9 基于 CentOS 5 i386

Plesk 11.0.9 基于 CentOS 5 x86_64



安装 Plesk PHP 配置程序包:

rpm -Uhv psa-php5-configurator-1.6.2-cos5.build110120608.16.x86_64.rpm



基于 CentOS 6: CentOS 6 提供 PHP 5.3,在操作系统供应商库中没有更早版本的 PHP。 可使用第三方软件库。 例如,可从 Atomic 库获取 PHP 5.2.17。 但是要降级 PHP 并保留它,应禁用 Parallels Plesk Panel 自动更新。 应按照 KB #9294 中建议的安装微更新。



降级 CentOS 6 上 PHP 版本的步骤:

添加 Atomic 库:

wget -qq -O - http://www.atomicorp.com/installers/atomic | /bin/bash



降级所有的 PHP 程序包:

yum downgrade $(rpm -qa --qf "%{NAME} " | grep -v ioncube | grep ^php | awk '{print $1"-5.2.17"}')


星期六, 11月 23, 2013

plesk 11 Cron 無法執行

每次都收到錯誤通知信



-: /usr/bin/php: No such file or directory



想了變通的方法



把crontab 寫道  root帳號內,並設定每天凌晨兩點一分開始發送。



# crontab -e



# Sender Edm

1 2 * * * /usr/bin/php /var/www/vhosts/dzvhost.com/cgi-bin/epaper_send.php



 

星期二, 10月 29, 2013

我得到了一个错误:“Could not connect to SQL database. Too many connections”。

APPLIES TO:









  • Parallels Plesk Panel for Linux/Unix












原因



这个错误的意思是MySQL的并发连接数已经达到了限制,此时无法在服务器上建立新的连接。

解决方案



有两种办法来解决这个问题。第一种是增加连接限制数,第二种是找出导致“too many connection”错误的原因并尝试降低MySQL服务器的资源使用率。

MySQL服务状态可以通过‘mysqladmin’工具来检测。例如为了找出当前服务器连接数,使用:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow` extended-status | grep Max_used_connections


| Max_used_connections | 11 |

当前最大连接数限定的设置可以通过:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow ` variables | grep 'max.*connections'




| max_connections | 100 |



| max_user_connections | 0



从以上的例子看出,服务器的最大连接数(max_connections)设置是100.每用户的最大连接数(max_user_connection)是0,意思是没有限制。



这些都是MySQL默认值,可以通过/etc/my.cnf来重定义,



例如:



[mysqld]

max_connections=150



修改完my.cnf后重启MySQL服务。 注意,如果您将连接限制数设置得非常高,这可能影响服务器性能。



比较好的方法是找出MySQL服务器资源使用率高的原因。您可以检查是那个用户/请求放慢了mysql运行速度以及占据了所有当前的连接,例如使用下面命令:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow` processlist


 

星期日, 8月 18, 2013

Parallels Panel update failed

注意,更新Parallels Panel失敗。



您可以從此連結下載Parallels安裝程式日誌: https://aaabbbccc.com:8443/admin/update/log/id/13ed6642-f9cb-d1b5-6b65-c191b7fb5699。

聯絡主機服務商尋求協助。



Parallels安裝程式自動發出此消息。



soluation

yum repolist enabled   檢查一下是否安裝了 Atomic repo,如果是將它移除。

yum remove atomic-release


星期六, 8月 03, 2013

Failed loading /usr/lib64/php/ioncube/ioncube_loader_lin_5.2.so:

Centos 當使用YUM 自動更新到 php 5.4.x時,crontab 自動排程出現以下的錯誤。



Failed loading /usr/lib64/php/ioncube/ioncube_loader_lin_5.2.so:  /usr/lib64/php/ioncube/ioncube_loader_lin_5.2.so: undefined symbol: php_body_write

PHP Fatal error:  Directive 'safe_mode' is no longer available in PHP in Unknown on line 0



調整



vi /etc/php.d/ioncube.ini

/usr/lib64/php/ioncube/ioncube_loader_lin_5.4.so



請確認伺服器內是否真的有 ioncube_loader_lin_5.4.so 這個檔案。



 



 

星期三, 6月 26, 2013

PLESK Is it safe to update system packages using the operating system package manager?

APPLIES TO:





  • Parallels Plesk Panel for Linux/Unix










Resolution



Yes, it is safe, and moreover, we recommend using "yum" (or "apt-get" on Debian) to keep the system up-to-date.



However, some packages may conflict with Parallels Plesk Panel (PP) or another software. These can be added to the skip list. It is recommended that you use the following settings:



- for up2date, add to /etc/sysconfig/rhn/up2date:



pkgSkipList=kernel*;sendmail;bind-chroot;caching-nameserver;



- for yum, add to /etc/yum.conf:



exclude=kernel* sendmail bind-chroot caching-nameserver



To find out which actions should be taken after an Apache upgrade on the PP system, see here.



1) If Parallels Plesk Panel is installed inside a container, the kernel updates are not necessary -- the kernel should be upgraded from the Node.

2) If Parallels Plesk Panel is installed on a hardware server, the kernel updates are recommended if there are only vendor's repositories configured. Otherwise, if the custom repositories provide new kernels, it is better to have the kernel updated from the vendor repository manually. The reason is simple: major troubles result from kernels with GRSecurity patches applied. PP is not designed to work in such configurations.




星期六, 6月 22, 2013

星期五, 5月 31, 2013

Check the Mail log on Plesk Server

The Plesk mail logs are kept in /usr/local/psa/var/log/maillog



The best command to use for viewing the logs in real time is

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

星期二, 3月 19, 2013

How should I partition the hard drive prior to installing Plesk?

Resolution

We cannot give any exact numbers, however, you should take into account the following.



Plesk for Linux OSes stores all users' data in /var partition by default, so the partitioning should be like:



SWAP -> twice RAM size

/boot -> 128 MB

/ -> System + Plesk, updates. 5-10 GB should be enough.

/tmp -> 5GB.

/var -> the rest of the space (domains, mail, backups, databases are stored there)



Directories that usually take much disk space:



/var/www/vhosts (/srv/vhosts on SuSE) - domains.

/var/qmail - mail.

/var/lib/mysql - Mysql databases.

/var/lib/psa/dumps - Plesk clients'/domains' backups.

/var/lib/pgsql/data - Postgres databases.

/var/tomcat* - Tomcat applications.

/var/lib/mailman - Mailman lists.



Please check file /etc/psa/psa.conf for all other directories used by Plesk control panel.



Plesk Contorl Panel under FreeBSD uses the /usr/local partition for storing large quantity of data and /var/db partition for databases.

So the /usr and /var partitions have to be larger in this case.



On Debian and Ubuntu, Plesk itself is located in /opt/psa.



Currently supported operating systems can be found on the product requirements page at



http://www.parallels.com/en/products/plesk/reqs.

Which ports need to be opened for all Plesk services to work with a firewall?

Article ID: 391

Last Review: Jun, 23 2011

Views: APPLIES TO:

‧Parallels Plesk Panel for Linux/Unix

Resolution

Generally it depends on what services are running on the server. All the ports which can be used by Parallels Plesk Panel/services are listed below:



#20 ftp-data (TCP)

#21 ftp (TCP)

#22 ssh (TCP)

#25 smtp (TCP)

#53 dns (TCP and UDP)

#80 http (web server and Plesk updater) (TCP)

#106 poppassd (for localhost only) (TCP)

#110 pop3 (TCP)

#113 auth (TCP)

#143 imap (TCP)

#443 https (TCP)

#465 smtps (TCP)

#587 mail message submission (TCP)

#990 ftps (TCP)

#993 imaps (TCP)

#995 pop3s (TCP)

#3306 mysql (TCP)

#5224 (outgoing connections only) plesk-license-update (TCP)

#5432 postgres (TCP)

#8443 plesk-https (TCP)

#8880 plesk-http (TCP)

#9080 tomcat (TCP)



Added since version 9.0:



#11443 sw-cp-serverd (TCP)

#11444 sw-cp-serverd (TCP)



These two ports are used for SSO service when Billing is installed.



Added since version 10.0



#8447 autoinstaller (TCP)

Additional Information

NOTE: none of these services should be denied access in /etc/hosts.deny and if /etc/hosts.deny includes some general access rules, then explicit allowing rules should be put in in /etc/hosts.allow for all ports mentioned (only ports that accept incoming connections).

星期二, 2月 28, 2012

停止 Dr. Web Antivirus Update Emails

使用 root權限,編輯 drweb32.ini 檔案



 vi  /etc/drweb/drweb32.ini:



尋找:

CronSummary = Yes



調整為:

CronSummary = No



將 drwebd 服務重新啟動

/etc/init.d/drwebd restart

星期一, 9月 12, 2011

關閉sso服務

/usr/local/psa/bin/sso --disable