Archive for the tag 'Script'

SBDavid

Premature End Of Script Headers

Premature End Of Script Headers

Where to check for errors

Check domain/apache error log file.
Check /var/log/apache/suexec.log file that should give a solution.

http://httpd.apache.org/docs/current/suexec.html

Upload your script is ASCII mode

Upload your Perl script in ASCII mode.
Set the permission of the file to 755, which allows the script to be executed by everybody.

Tracking Errors in the Script

perl -wc helloworld.pl

Will cause the Perl interpreter to check your script for syntax errors.

Running it without the syntax check options:

perl -w helloworld.pl

If something strange has gone wrong with your program and youre not sure where you should look for help, try the -w switch first.

It will often point out exactly where the trouble is.

The cPanel & WHM update script (/scripts/upcp)

This script handles most of the updates on your cPanel & WHM system. You can run this script in 2 ways:

* On the command line, by entering /scripts/upcp as the root user.
* In WHM, using the Upgrade to Latest Version feature at Main >> cPanel >> Upgrade to Latest Version.

In addition to updating cPanel & WHM, this script also updates most of the software on your system by calling a number of other scripts within the /scripts directory.

SBDavid

The update_php_mime_types Script

The update_php_mime_types Script

There is a command line tool for managing these settings called update_php_mime_types, located in the /usr/local/cpanel/bin/ directory.

Run the following command for detailed information about how this tool works:

/usr/local/cpanel/bin/update_php_mime_types –man

The update_php_mime_types script is run automatically as part of the EasyApache3.

It will update or remove PHP AddHandler directives in .htaccess files down to, by default, 3 levels deep within users’ home directories.

note Note: You can configure the depth for update_php_mime_types from the Tweak Settings page.

To prevent this update from occurring, create a file named:

/var/cpanel/easy_skip_update_php_mime_types

Reference: http://cpanel.net/

Script for installing Parallels Installer binary from a network location.

This sample script is applicable in cases when the Parallels Installer binary is obtained directly from a network location (the sample URL http://example.com/type_parallels_installer_name_here should be substituted with a valid installer download link).

#!/bin/sh

SERVERS_LIST=”node1.example.com node2.example.com”

for current_server in $SERVERS_LIST; do

ssh -f root@$current_server ‘wget http://example.com/type_parallels_installer_name_here -o parallels_installer;chmod 755 ./parallels_installer;./parallels_installer –source http://updates.example.com/ –target /tmp/panel –select-release-id PLESK_10_0_0 –install-component base –install-component postgresql –install-component spamassassin –notify-email admin@serverbuddies.com’
done

Implementation and Execution of an installation script.

Script below is applicable in cases when Parallels Installer is previously uploaded to the target server and the execution bit is set in its permissions.

#!/bin/sh
SERVERS_LIST=”node1.example.com node2.example.com”
for current_server in $SERVERS_LIST; do
scp parallels_installer root@$current_server:
ssh -f root@$current_server “parallels_installer –source http://updates.example.com/ –target /tmp/panel –select-release-id PLESK_10_0_0 –install-component base –install-component postgresql –install-component asp –notify-email admin@domain-name.com”
done

To avoid being prompted for password each time you connect via SSH to the servers where the Panel should be installed, place your public key to the list of authorized keys of a user on whose behalf the script is run on each server.

Reference: http://parallels.com/

Next »