MAX RECIPIENT

By default, it would be 20 in server ie at a time, a user can send single mail to 20 recipients( cc a mail to 20 recipients).

you should be able to setup something like this in your /etc/exim.conf for increasing its value:

=======

recipients_max = 100
RELAY_RCPT_LIMIT_NUM = 100

=======

Disable modsecurity for a particular domain

Internal Server error
————————-
error log is as follows:
ModSecurity: Output filter: Response body too large (over limit of 524288, total not specified). [hostname “domain.com”] [uri “/modules/popnupblog/index.php”] [unique_id “Tu6zGUPeYikAACRZGpQAAAAA”]

Solution
———-
Make a file “modsecurity_crs_10_config.conf” in /usr/local/apache/conf
Add the foll rule to that domain

SecRule SERVER_NAME “domain.com” phase:1,nolog,allow,ctl:ruleEngine=off

Add the file path in modsec2.conf

Include “/usr/local/apache/conf/modsecurity_crs_10_config.conf”

do /usr/local/apache/bin/apachectl configtest to check syntax
Restart apache..
It works!!!

Outlook error (0x800CCC78)

=============================
Error
—–
Sending’ reported error (0x800CCC78) : ‘Cannot send the message. Verify the e-mail address in your account properties.
———————————————————————————————————————

please try this.

Go to Tools > Accounts. Select the “Mail” tab. Select your account and press “Properties.” Go to the “Servers” tab, and check “My server requires authentication” under Outgoing Mail Server. Press “Settings,” select “Use same settings as my incoming mail server,” then press “OK” twice times to save the changes, then press “Close” to return to Outlook Express. Finally, restart your computer
==============================

Sample Outlook Configuration – which includes needed checks and avoided unwanted checks.

MS Outlook Express Setup

1. Click on the tools menu then accounts
2. Click Add on the right side at the top and select mail
3. Display Name: Your Name 4. Click Next
5. E-mail Address: email id
6. Click Next
7. My incoming mail server is a POP3 server.
8. Incoming mail server (POP3): mail.yourdomain.com
9. Outgoing mail server (SMTP): mail.yourdomain.com
10. Click Next
11. Acount Name: emailid
12. Password: password of your email id
13. Check Remember password if you don’t want to enter your password each time.
14. DO NOT CHECK “Log on using Secure Password Authentication (SPA)”
15. Click Next then Finish
16. Click on the account you just created then click Properties
17. Click the Servers tab
18. CHECK “My server requires authentication” at the bottom
19. Click the Advanced tab
20. Under Server Port Numbers Incoming server (POP3): 110
: Don’t click “This server requires a secure connection (SSL).
21. Under Server Port Numbers Outgoing server (SMTP): 26.
: Don’t click “This server requires a secure connection (SSL).
22. Click OK to close that window.
23. Click Close to close that window.

Installing PCNTL manually in cPanel Server

PCNTL is Process Control support in PHP implements the Unix style of process creation, program execution,
signal handling and process termination.

Sample Error: when PCNTL requires and it is missing for some accounts
========
Fatal error: Call to undefined function pcntl_fork() in /path/blah.php on line 5
========
The PCNTL installation option is not available through cPanel by default, but we can install it manually without any issue.

The following simple steps would help you.

If you want to add –enable-pcntl to all PHP4 compilations, do this:

Create a file called: /var/cpanel/easy/apache/rawopts/all_php4
Add this to the file: –enable-pcntl

If you want to add –enable-pcntl to all PHP5 compilations, do this:

Create a file called: /var/cpanel/easy/apache/rawopts/all_php5
Add this to the file: –enable-pcntl

If you want to add –enable-pcntl to a specific version of PHP, say 5.2.6 , do this:

Create a file called: /var/cpanel/easy/apache/rawopts/PHP-5.2.6
Add this to the file: –enable-pcntl

Then rebuild apache and php using /scripts/easyapache

Once it is done confirm if pcntl is there either by creating a phpinfo page or from the php module list(php -m).

PCRE ERROR

[PCRE – Perl-compatible regular expression library. PCRE has its own native API, but a set of “wrapper” functions that are based on the POSIX API are also supplied in the library libpcreposix. Note that this just provides a POSIX calling interface to PCRE; the regular expressions themselves still follow Perl syntax and semantics. The header file for the POSIX-style functions is called pcreposix.h]

added in PHP.INI
pcre.backtrack_limit = 10000000
pcre.recursion_limit = 10000000

and added in modsec2.user.conf
SecPcreMatchLimit 150000
SecPcreMatchLimitRecursion 150000

php.ini wants to be worked individually for a domain when php is configured as FCGI or CGI.

***PHP FCGI Individual php.ini File***
======================================

1. Copy and Edit default php.ini
=============================

To know the default php.ini –> #php -i | grep php.ini

#cd /home/user/public-html/cgi-bin
#cp /path/to/default_php.ini /home/user/public_html/cgi-bin
#vi php.ini

2. For eg:, As a test change one of the variables like register_globals from:
register_globals = Off
To
register_globals = On

3. Create php.fcgi file to load custom php.ini

#vi php.fcgi
(Please note that you should still be in /home/user/public_html/cgi-bin location)

Put into file:
Code:
———————————–
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5
———————————–

Please note the path to php5 is due to using PHP5 on this system. If you are using php4,
it might be /usr/local/cpanel/cgi-sys/php4 or some other path. Check /usr/local/apache/conf/php.conf
to see what it shows for cgi-sys path for your version of PHP.

4. Save file, then made executable:

Code:
————
chmod +x /home/user/public_html/cgi-bin/php.fcgi
————

Change ownership of files to correct user:

Code:
————
chown -R user:user /home/user/public_html/cgi-bin/
————

5. Edit .htaccess to point to php.fcgi wrapper

Code:
————-
#cd /home/user/public_html
#vi .htaccess
————-

Put at top of file:

Code:
————–
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
————–

Again, here php5 is listed.

6. Add paths to php.conf file

Add the following lines to /usr/local/apache/conf/php.conf file:
(Sometimes already present – check if it is there)

Code:
————–
Action php5-fastcgi /cgi-bin/php.fcgi
AddType application/x-httpd-php .php
————–

Yours will probably look similar to the following after those lines are added:

Code:
—————
#Fastcgi configuration for PHP5
LoadModule fcgid_module modules/mod_fcgid.so
MaxRequestsPerProcess 500
AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
Action php5-fastcgi /cgi-bin/php.fcgi
AddType application/x-httpd-php .php
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml
—————

7. Distill and rebuild Apache, then restart Apache

Run these commands:
(take a backup of apache conf)

Code:
————————-
#/usr/local/cpanel/bin/apache_conf_distiller –update
#/scripts/rebuildhttpdconf
#/etc/init.d/httpd restart
————————-

8. Load phpinfo page on account

Code:
—————
#cd /home/user/public_html
#vi php.php
—————

In file put:

Code:
—————-
<?php
phpinfo();
?>
—————-
9. Change ownership to the user:

Code:
—————-
#chown user:user php.php
—————–
10. Load the file at http://domain.com/php.php to see the results.

Your phpinfo file should now shows the changes you made on any variables as well as have this at the top defining the new php.ini path:

Like this:
—————-
“Loaded Configuration File /home/user/public_html/cgi-bin/php.ini”
—————-

===========================================================================================================================================

***PHP CGI Individual php.ini File***
======================================

1.  Copy and Edit default php.ini

To know the default php.ini –> #php -i | grep php.ini

#cd /home/user/public-html/cgi-bin
#cp /path/to/default_php.ini /home/user/public_html/cgi-bin
#vi php.ini

2. For eg:, As a test change one of the variables like register_globals from:
register_globals = Off
To
register_globals = On

3. Create php.cgi file to load custom php.ini

#vi php.cgi
(Please note that you should still be in /home/user/public_html/cgi-bin location)

Put into file:
Code:
———————————–
#!/bin/sh
/usr/local/cpanel/cgi-sys/php5 -c /home/user/public_html/cgi-bin/
———————————–

Please note the path to php5 is due to using PHP5 on this system. If you are using php4,
it might be /usr/local/cpanel/cgi-sys/php4 or some other path. Check /usr/local/apache/conf/php.conf
to see what it shows for cgi-sys path for your version of PHP.

4. Save file, then made executable:

Code:
————
chmod +x /home/user/public_html/cgi-bin/php.cgi
————

Change ownership of files to correct user:

Code:
————
chown -R user:user /home/user/public_html/cgi-bin/
————

5. Edit .htaccess to point to php.cgi wrapper

Code:
————-
#cd /home/user/public_html
#vi .htaccess
————-

Put at top of file:

Code:
————–
Action application/x-httpd-php5 /cgi-bin/php.cgi
————–

Again, here php5 is listed. If your PHP is different, use the Action listed for
your version of PHP in /usr/local/apache/conf/php.conf file.

8. Load phpinfo page on account

Code:
—————
#cd /home/user/public_html
#vi php.php
—————

In file put:

Code:
—————-
<?php
phpinfo();
?>
—————-
9. Change ownership to the user:

Code:
—————-
#chown user:user php.php
—————–
10. Load the file at http://domain.com/php.php to see the results.

Your phpinfo file should now shows the changes you made on any variables as well as have this at the top defining the new php.ini path:

Like this:
—————-
“Loaded Configuration File /home/user/public_html/cgi-bin/php.ini”
—————-

Some Redirect rules – really helpful ones

Redirect www to non-www:
========================

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

Redirect non-www to www:
=======================

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

Redirect main site to subdirectory
==================================
RewriteEngine on
RewriteCond %{HTTP_HOST} ^hotelespara2.co.com$
RewriteRule (.*) http://www.hotelespara2.co.com/$1 [R=301,L]
RewriteRule ^$ blog/home/ [L]

Another one with symbol ‘?’ in URL.

==============================================================
www.domain.com/index.php?main_page=index&cPath=44

If you want the above URL should resolve to

http://domain.com/st_main.html?m=wedding-ceremony-programs-wedding-program-paper&p_catid=8

then use the following pattern,

RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{QUERY_STRING} main_page=index&cPath=44
RewriteRule ^index.php$ “http://www.domain.com/st_main.html?m=wedding-ceremony-programs-wedding-program-paper&p_catid=8” [R=301,L]
===============================================================