linuxgo.net, webhosting blog, hosting blog, linux blog, linux related blog, linux blog

squirrel mail not found error

February 5th, 2012 No comments

The server was not able to find the document (./3rdparty/squirrelmail/index.php) you requested.
Please check the url and try again. You might also want to report this
error to your web hosting provider.
webmaild/11.25 Server at *
Just do the following steps after logging into server and see the magic :)
mv /usr/local/cpanel/base/3rdparty/squirrelmail /usr/local/cpanel/base/3rdparty/squirrelmail.bak
/usr/local/cpanel/bin/update-squirrelmail –force

Categories: Cpanel/WHM, Email Issues Tags:

Publshing found the error “Cannot connect to domainname.com using curl_init”

December 11th, 2011 No comments

This error frequently occurs by having set your domain redirects to another destination, but you don’t choose the match one when publishing your project. Thus, your website will get stuck. You have to choose the domain when publish in step 7 to be matched with the destination of your domain set. Correctly choosing will favor you publish website easy.

If the direction above doesn’t help, please contact your host provider to create file skip_validate_domain in  /var/cpanel/rvglobalsoft/rvsitebuilder/var

This may help you skip the matching validation process.

Categories: Cpanel/WHM, Third Patry Apps Tags:

how to install geoIP

November 30th, 2011 No comments

You just need to fire following command on cpanel server to install geoIP.

pecl install GeoIP

While installation  you may get the following error.

checking for re2c version... invalid
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for geoip support... yes, shared
checking for geoip files in default path... not found
configure: error: Please reinstall the geoip distribution
IF you got the above error then you need to install Geoip C API from this link http://www.maxmind.com/app/c and then you need to install mod_geoip from this URL http://geolite.maxmind.com/download/...pi/mod_geoip2/
Once you install this then proceed with this command pecl install GeoIP

 

 

Categories: Apache, Cpanel/WHM Tags:

Block ip address from .htaccess

November 13th, 2011 2 comments

To block certain ip address from accessing your website, just create a file with name .htaccess at your root directory with the content below:-

order allow,deny
deny from 192.168.0.1
allow from all

If you want to block multiple ip address using .htaccess simply add one ip address per line as below:-

order allow,deny
deny from 192.168.0.2
deny from 192.168.0.3
deny from 192.168.0.4
allow from all

You can even block a network range ip using .htaccess:-

order allow,deny
deny from 129.0.0
allow from all
Categories: htaccess Tags:

Disable Mod Security for a specific domain

September 8th, 2011 1 comment

If Apache is compiled with SuPhp and Mod Security, do the following:

Create a directory for that domain:

mkdir -p /usr/local/apache/conf/userdata/std/2/USERNAME/DOMAIN.TLD
Then create a mod_security conf file:

touch /usr/local/apache/conf/userdata/std/2/USERNAME/DOMAIN.TLD/mod_security.conf
Using your favorite Linux Text editor such as pico or vi, add the following directive(s) in that file:

<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
Save the file and then run:

/scripts/ensure_vhost_includes –user=USERNAME
If Apache is NOT compiled with SuPhp and Mod Security, do the following:

You can implement one of the following two options:

1. Add the following directive in .htaccess file:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
If that didn’t work on your server ,

2. SSH to the server and add the following directive to /etc/httpd/conf/httpd.conf file:

<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>

Categories: Apache, htaccess Tags:

InnoDB has been disabled for this engine

September 2nd, 2011 No comments

If you are getting this error so first check if InnoDB is enabled or not using following steps,

root@server[~]# mysql

SHOW ENGINES;

Above command will give you following output

mysql> SHOW ENGINES;
+------------+---------+----------------------------------------------------------------+
| Engine     | Support | Comment                                                        |
+------------+---------+----------------------------------------------------------------+
| MyISAM     | YES     | Default engine as of MySQL 3.23 with great performance         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      |
| InnoDB     | DISABLED| Supports transactions, row-level locking, and foreign keys     |
| BerkeleyDB | NO      | Supports transactions and page-level locking                   |
| BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE    | YES     | Example storage engine                                         |
| ARCHIVE    | YES     | Archive storage engine                                         |
| CSV        | YES     | CSV storage engine                                             |
| ndbcluster | NO      | Clustered, fault-tolerant, memory-based tables                 |
| FEDERATED  | YES     | Federated MySQL storage engine                                 |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          |
| ISAM       | NO      | Obsolete storage engine                                        |
+------------+---------+----------------------------------------------------------------+
12 rows in set (0.00 sec)
Then you can check if its disabled in my.cnf
vi /etc/my.cnf
skip-innodb
Comment the above line in my.cnf using #
skip-innodb
If you cant see this line then add the following line in my.cnf
default-storage_engine=InnoDB
and then restart mysql service
service mysql restart
Now your default storage engine is set to InnoDB
Categories: Mysql Tags:

GREP command with all options

August 9th, 2011 1 comment

GREP (Global regular expression print) is a command line search utility, This command us useful to filder specific word or input given to it.

GREP is a command line search utility or tool  to filter the input given to it. Grep got its name from ed editor as g/re/p (global / regular expression / print).

Now we will see how to grep command with all options.

GREP command syntax

grep options searchterm filename

or

command | grep options searchterm 

For searching a word in file

 grep 'ada' filename

For search a word which is either caps or small letters(i — case insensitive )

 grep -i 'ac' filename

inverse search for a word

 grep -v 'ac' filename

To count a word occurrence

 find -c ‘ac’ filename

Find ac characters along line numbers

 grep -n 'ac' filename

Find exact word ac

 grep -x 'ac'

Basic regular expressions:

^ -- Caret symbol, Match beginning of the line.

$ -- Match End of the line

* -- Match 0 or more occurrence of previous character

. – Match Any single character

[] – Match Range of characters, just single occurrence.

            [a-z] –Match small letters

            [A-Z] –Match cap letters

            [0-9] – Match numerical.

[^] – Match Negate a sequence

\ -- Match Escape character.

If we learn any new thing with example, it will be there for long time in our mind. Now we will see one example each regular expression what we given above.

Example1: Find all the lines which start with “Mr”

grep ‘^Mr’ filename

Example2: Find all the lines which ends with ‘sh’

grep ‘sh$’ filename

Example3: Display all the lines in a file expect empty lines.

grep –v ‘^$’ filename

Note:-v option is used to negate the search term, here ^$ indicates empty line, so our grep –v is filtering empty lines in the output.

Example4: Search for words which are bash, baash, bsh, baaash, baaaaash,

grep ‘ba*s’ filename

This will search for words which has a between b and s zero or more times.

Example5: Search for all words which starts with b and h

grep ‘b.*h’ filename

Example6: Search for a word which is having three letters in it and starts with x and ends with m.

grep ‘x[a-z]m’ filename

This search will return all the 3 letter words which start with x and ends with m.

Example7: Search words do not contain ‘ac’ in a file.

grep ‘[^ac]’ filename

Example8: Search for a ‘[‘ in a file

Note: The “[“is a special character, you cannot search with normal grep we have to use escape character (\) in order to negate it. So use ‘\[‘ to search for [. This is applicable for all the special characters mention above.

grep ‘\[’ filename

Extended regular expressions:

+ --Match one or more occurrences of previous character.

| -- Match Either character

? – Match 0 or 1 occurrence of previous character.

() –match a group of characters

{number} –Match number of occurrence of a character

{1, 3} –Match a character which is 1 to 3 times repetition

{5, } –Match a repeated character which is repeated 5 or more times.

Note1: In order to use this extended regular expressions we have to use –E option give grep the capability to understand Extended regular expressions.

Note2: egrep is nothing but grep –E, so try to avoid it if grep itself can do the work for you. Why to learn new command?

Examples:

Example1:Search for a words which contains one or more occurrence of ‘b’ between a and c.

grep –E ‘ab+c’ filename

Example2: Search for a word which contains zero or one occurrence of b between a and c

grep –E ‘ab?c’ filename

Example3: Search for a word which contains either a or b, a and b between d, e characters

grep –E ‘da|be’ filename 

Example4: Search for a word which contains either a or b, but not both a and b between d, e characters

grep –E ‘d(a|b)e’ filename 

Example5: Search for a word which contains only 2 ‘b’ between a and c character

grep –E ‘ab{2}c’ filename

Example6: Search for a word which contains 3 to 4 ‘b’ between a and c character

grep –E ‘ab{2,4}c’ filename

Example7: Search for a word which contains 3 or more ‘b’ between a and c character

grep –E ‘ab{3, }c’ filename 
  
Categories: Commands Tags:

ERROR: Could not complete request. Query: SELECT “INBOX

July 31st, 2011 No comments

If you are getting following error while accessing squirrel mail

ERROR: Could not complete request.
Query: SELECT “INBOX”
Reason Given: Unable to open this mailbox.

You just need to follow this steps.

cd /home/UserName/mail/Domainname.com/emailIDUsername/
mkdir new; mkdir cur; mkdir tmp
chown username.username*

Now try to access your email ID you will be able to access it without any problem.

Categories: Email Issues Tags:

How to install SuPHP/phpSuExec on Plesk?

July 14th, 2011 No comments
How to install SuPHP/phpSuExec on Plesk?

SuPHP Or PHPSuExec is a module which increases the security of the server and executes PHP files under the ownership of the owner of the file instead of the Apache user i.e. nobody or apache.

The advantages of having suPHP are:

1. Files and Directories those need 777 permissions to write into, via the browser will now need a maximum of 755 permissions. The files/directories with 777 permissions will result in an “Internal Server Error”.

2. If you need to manipulate the value of a php directive for a domain, for ex. register_globals, it needs to be placed in the php.ini of a domain instead of the .htaccess file as it will result in an “Internal Server Error”.

3. All the files and directories uploaded using a script will have the ownership of the user instead of user ‘apache’ (i.e. the Apache user).

4.  User can edit or remove the files using Ftp that are uploaded via the browser.

In order to install SuPHP on the server, download and install the atomic script

# wget -q -O - http://www.atomicorp.com/installers/atomic | sh

Once the script is installed, install SuPHP module using yum

# yum install mod_suphp

The next step is to load the SuPHP module with Apache. The suphp installation automatically creates a “suphp.conf” file under the Apache configuration directory, if not create it.

# vi /etc/httpd/conf.d/suphp.conf

and insert the following lines:

#Load the Mod_SuPHP module
LoadModule suphp_module modules/mod_suphp.so
php_admin_value engine off
# Enable handlers
suPHP_AddHandler x-httpd-php
AddHandler x-httpd-php .php .php3 .php4 .php5
#Enable the SuPHP engine
suPHP_Engine on

Apache calls all the configuration files from the /etc/httpd/conf.d directory by default so there is no need to include the module in the httpd.conf file separately.

Now,  configuration file under /etc should be present (if not create it)

vi /etc/suphp.conf

copy/paste the following contents as it is:

[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=30
min_gid=30

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

Make sure the “handle_userdir” directive is commented or removed from the file since it is deprecated from the latest version.

At the end, we have to restart the httpd service for all these changes to take effect

# service httpd restart

Test the SuPHP installation: Create a phpinfo.php file with 777 permission and it should show you an “Internal Server Error” on browsing.

 

Categories: Installations Tags:

How to increase post_max_size and upload_max_filesize using htaccess

June 19th, 2011 2 comments

Many times we do not have access in servers main php.ini and if we create php.ini in our account it also not reflect in phpinfo page because of suphp or suexcec is not enabled on server.

In such case you just need to create file with name .htaccess where you want to increase above values.  After creating .htaccess open it in any of your favorite editor (vi, nano, pico …) and add following lines.

Read more…

Categories: htaccess Tags: