Archive for the ‘apache’ Category

adjust /etc/php.ini (default path)
then /usr/local/psa/bin/php_settings –update-all -> it modifies all websites php.ini according to server /etc/php.ini

# /usr/local/psa/bin/php_settings –help

Usage: php_settings command [options]
Available commands:
–update-all or -u Update per-domain PHP settings of all domains in accordance with the server-wide php.ini file.


create /var/www/vhosts/$DOMAIN$/conf/vhost.conf

content:

<DIRECTORY /var/www/vhosts/$DOMAIN$/httpdocs>

<IfModule sapi_apache2.c>

php_admin_flag engine on

# General settings

php_admin_flag safe_mode off

php_admin_value open_basedir "/var/www/vhosts/$DOMAIN$/:/tmp/"

# Performance settings (not mandatory)

php_admin_value memory_limit 512M

php_admin_value max_execution_time 600

php_admin_value max_input_time 300

php_admin_value post_max_size 60M

php_admin_value upload_max_filesize 60M

# Additional directives

</IfModule>

</DIRECTORY>

<DIRECTORY /var/www/vhosts/$DOMAIN$/httpdocs>

<IfModule mod_php5.c>

php_admin_flag engine on

# General settings

php_admin_flag safe_mode off

php_admin_value open_basedir "/var/www/vhosts/$DOMAIN$/:/tmp/"

# Performance settings

php_admin_value memory_limit 512M

php_admin_value max_execution_time 600

php_admin_value max_input_time 300

php_admin_value post_max_size 60M

php_admin_value upload_max_filesize 60M

# Additional directives

   AddHandler php5-script .hph

   AddType text/html .hph

</IfModule>

</DIRECTORY>

/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain $DOMAIN$



and voila..

before:
# head FormMail.pl
#!/usr/bin/perl
##############################################################################

after:
# head FormMail.pl
#!/usr/bin/perl -wT
##############################################################################

not exactly sure why, but perl w/o this 2 variables does not work called from execve

Since plesk 9.5, you can choose in plesk how php will run (as apache module will be executed as apache user, as cgi/fastcgi will be executed as domain user/system user)

wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
wget http://www.atomicrocketturtle.com/RPM-GPG-KEY.art.txt
rpm --import RPM-GPG-KEY.art.txt
yum install mod_suphp

edit the /etc/httpd/conf.d/mod_suphp.conf and leave only LoadModule suphp_module modules/mod_suphp.so line
modify /etc/suphp.conf:

[global]
logfile=/var/log/suphp.log
loglevel=info
webserver_user=apache
docroot=/var/www/vhosts
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
check_vhost_docroot=false
errors_to_browser=false
env_path=/bin:/usr/bin
umask=0022
min_uid=500
min_gid=500

[handlers]
x-httpd-php="php:/usr/bin/php-cgi"
x-suphp-cgi="execute:!self"

create file /etc/httpd/conf.d/zzz_suphp.conf with content:

<Directory /var/www/vhosts>
        <IfModule mod_suphp.c>
               AddHandler x-httpd-php .php .php3 .php4 .php5 .phtml
               suPHP_AddHandler x-httpd-php
               suPHP_Engine on
        </IfModule>
</Directory>

With this config you will enable the suPHP only for vhost folder and not for webmail and other folders.

You have also to check the file/folders permissions. If you have files/folders with 777 permission you will get a 500 error. You have to change it to 755 or 644.

[How To] How to test Spamassassin

Resolution
To test Spamassassin it is necessary to send a test mail containing the following string of characters (in upper case and with no white spaces and line breaks):

XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

Note: Test mail must be sent from an account outside of your network.
Additional information

Please see more information about Spamassassin here: http://spamassassin.apache.org/gtube

wget --user-agent Firefox --save-headers --referer "http://www.google.com/search?q=duuude" "example.com"

The way to execute PHP on a .html page is to modify your .htaccess file. This file may be hidden, so depending upon your FTP program you may have to modify some settings to see it. Then you just need to add this line for .html:

AddType application/x-httpd-php .html

Or for .htm

AddType application/x-httpd-php .htm

If you only plan on including the PHP on one page, it is better to setup this way:

AddType application/x-httpd-php .html

This code will only make the PHP executable on the yourpage.html file, and not on all of your html pages.

http://lerdorf.com/veracruz.pdf

http://www.linuxscrew.com/2009/12/21/best-of-linux-cheat-sheets/

1. Create a subdomain z-WILDCARD in Plesk – of course in the admin section of the right domain.
Why do we need this name? ’cause this entry should be the last entry in the list of subdomains, otherwise this
“trick” will not work. So if you have a domain as e.g. zabalula , than you should maybe name the subdomain zzzz-WILDCARD
or similar.
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.
apache2ctl restart