Saturday 21 December 2013

Cannot find the robot.txt anywhere in my file manager but the domain.com/robots.txt is working

In the wordpress website the robots.txt is automatically getting generated by the following script : function do_robots() {
header( 'Content-Type: text/plain; charset=utf-8' );

do_action( 'do_robotstxt' );

if ( '0' == get_option( 'blog_public' ) ) {
echo "User-agent: *\n";
echo "Disallow: /\n";
} else {
echo "User-agent: *\n";
echo "Disallow:\n";
}
}
in the file /functions.php which is under the /wp-includes/ folder. So you can modify the code to change the robots.txt settings.

If you do not wish to show the robots.txt file you can redirect it to the 404 error page using the .htaccess

Redirect 301 /robots.txt http://www.yoursite.com/404

Thursday 19 December 2013

Your website needs to be publicly accessible to use Jetpack: site_inaccessible Error

Below error occurred while trying to connect to the WordPress.com under jetpack plugin in wp-admin panel:
Your website needs to be publicly accessible to use Jetpack: site_inaccessible Error Details: The Jetpack server was unable to communicate with your site [HTTP 503]. Ask your web host if they allow connections from WordPress.com. If you need further assistance, contact Jetpack Support: http://jetpack.me/support/

Try disabling the maintenance plugins if you have enabled and try to connect it.
The maintenance plugins like : WP Maintenance Mode and ThemeFuse Maintenance Mode
Or try disabling all the plugins that you have recently added and try if it is getting connected.

Or try deactivating the Jetpack plugin and reactivate it again and try connecting it , this worked for me .

Also check if your domain name server is updated , or updated to the right hosting account. Also check if the A record is pointing correctly.

If this is not resolved the issue you will have to contact either the http://jetpack.me/support/ or the hosting provider to check if the port is blocked or the website is blocked.

Sunday 15 December 2013

MySQL database not appearing in cPanel but exists in the server

If a database exists but is not displayed in cPanel it likely is not being tracked by the db mapping system.

Check to see if database is listed in user.yaml by running the following command:
#cat /var/cpanel/databases/user.yaml 

If the result is as follows : 
No databases tracked:
root@server [~]# cat /var/cpanel/databases/tacct.yaml
---
MYSQL:
dbs: {}
dbusers: {}

Follow the below steps : 

To map missing databases and users run the following:

#/usr/local/cpanel/bin/dbmaptool cpanelusername --type mysql --databasename

#/usr/local/cpanel/bin/dbmaptool cpanelusername --type mysql –databaseuser

#/usr/local/cpanel/bin/dbmaptool cpanelusername --type mysql –databasename cpanelusername_databaseuser

After the above steps are executed check with the following command if the database has been mapped in the db mapping system.
#cat /var/cpanel/databases/abc.yaml
The result should be as follows : 
---
MYSQL:
dbs:
tacct_testdb: IP Address
dbusers: {}
owner: tacct
server: IP Address

Unable to create directory uploads/2013/12. Is its parent directory writable by the server?

Unable to create directory uploads/2013/12. Is its parent directory writable by the server ? Error while uploading the image under media in the WordPress admin panel.

Login to the WordPress admin panel

Go to Settings >> Media

Change the path to wp-content/uploads

The issue will be resolved.

If it did not resolve the issue , you can try changing the folder permission for the folders wp-content and wp-content/uploads to 777 in the cPanel .

Saturday 14 December 2013

How to check if the cron job is executed or not ?

Cron-related messages, including success and failure, are logged to /var/log/cron .

You can also take a look at /var/log/messages and watch the email account listed in /root/.forward as that is where cron error reports would usually show up.

The cron job path for the domain : /var/spool/cron/username

Tuesday 10 December 2013

Removing the mysqladmin root password for the MySQL


First stop the MySQL service by running the following command in the SSH
/etc/init.d/mysql stop

After that run the following command
mysqld_safe --skip-grant-tables &

After this the MySQL admin password will be removed and you can
directly access the MySQL with out the password.

Wednesday 4 December 2013

Setting the magic_quotes_gpc=off to install the Joomla


Login to the server of the account as a root.

Set the magic_quotes_gpc=off in the file /usr/local/lib/php.ini

For the shared server :
You can try creating the php.ini in the root document folder in the File Manager >> Public_html and add the code 
magic_quotes_gpc=off 

Warning: mkdir() [function.mkdir]: Permission denied in DrupalLocalStreamWrapper->mkdir()


Drupal is giving the following error while uploading the themes:

Warning: mkdir() [function.mkdir]: Permission denied in DrupalLocalStreamWrapper->mkdir() (line 639 of /home/username/public_html/includes/stream_wrappers.inc). 
รข€¢bootstrap-7.x-2.1 (1).zip does not contain any .info files. 

Try With the Following Solution :
  • Change the file permission for the /sites/default/ to 777
  • Create the folder called /temps/ in the /home/username/public_html provide the file permission for the /temps/ as 777
  • Login to the drupal admin panel >>Go to Configuration >> Media >> File System. Change the Temporary directory path to the following :
    home/username/public_html/temps
  • Then save the settings. 

     

The sub domain abc.domain.com is not working showing the >> server not found error


The sub domain abc.domain.com is not working showing the >> server not found error . 

Check if the sub domain is created by going to cPanel >> Subdomains, If the sub domain is created and it is pointed to the correct root document folder and try with following step to resolve the issue 

You will have to enable the rewritebase rule in the Apache. Since there is no RewriteBase enabled for the sub domain 

You can also add the following code in the .htacess directly. 

<IfModule mod_rewrite.c>

RewriteEngine On

# RewriteBase /folder_path/

RewriteBase /

Database Connection Error

Website showing Database Connection Error
If it is a wordpress website , it is a common issue

Check the following to resolve the issue :
Login to the cPanel >> go to File Manager >> Open the public_html directory >> look for the wp-config.php and open it using the code editor.
Save the database, database username , password.

Go to Mysql >> delete the database user (Note: Do not delete the database , delete only the database user ).
Then create the new database user again as specified in the
wp-config.php , then reassign the database user to the database.

Or, instaed of deleting the database user , you can click on the database user and reassign the privileges and save it. Some times it works.

If the above step did not work , check the database by clicking on the >> check DB under the Mysql .If you find the corrupted database tables , go to Mysql >> click on Repair DB. This will resolve the error.

If all of the above steps did not resolve the problem , contact the hosting provider to resolve the issue. If may also be the reason that server is down.

To enable the passive port range for ProFTPd


How do I enable the passive port range for ProFTPd?

To enable the passive port range for ProFTPd, perform the following via the command line as the root user:
  • Open /etc/proftpd.conf in a text editor, such as vi.
  • Add the following to the first section of the configuration file:
PassivePorts 49152 65534

  • Save the changes to the configuration file.
  • Run the command /usr/local/cpanel/scripts/restartsrv_ftpserver to restart the server.

Error: Connection timed out , Error: Failed to retrieve directory listing in the filezilla


Getting following error in the filezilla :

 PASV
Response: 227 Entering Passive Mode (119,18,57,237,6,29)
Command: MLSD
Error: Connection timed out
Error: Failed to retrieve directory listing 


Solution:

Open passive port range in iptables and also in pure-ftpd configuration file.

To open the passive port range in pure-ftpd configuration file:
  • Open the /etc/pure-ftpd.conf configuration file in a text editor, such as vi.
  • Remove the number sign (#) from the beginning of the line which contains the PassivePortRange test.
  • Change that line to the following :
PassivePortRange 49152 65534
  • Save the changes to the configuration file.
  • Run the command /usr/local/cpanel/scripts/restartsrv_ftpserver to restart the server.


To open the passive port range in iptables :
To open passive mode ports in your firewall, issue the following commands at the command line as root:
iptables -I INPUT -p tcp --dport 49152:65534 -j ACCEPT
  • /etc/iptables-save

If the server is loading slowly check the below stats in the server


$uptime
12:03:11 up 1 day, 23:23, 2 users, load average: 44.67, 37.02, 30.92

$free -m
it will check for the memory (RAM) available.

$nice top -cd3
It will show details regarding the process consumption.

$mysqladmin proc stat
It will check the mysql process stats
This will show the stats regarding the slow queries.


$attackers 80
It will check for the highest http connection at the port 80

Note : Ip with more than 50 connections to the httpd should be blocked.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 79 bytes)


Domain getting the following error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 79 bytes) in /home/username/public_html/libraries/joomla/database/database/mysqli.php on line 498


Solution: 

Step1 : Login to the root
Step 2: Create the info.php file and check the memory limit.
Step 3: If it is 64MB. Then go to php.ini. File and then change it to 256M according to the memory availability.

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings.


Website showing the following error :

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /home/username/public_html/../../flexycms_core/libs/smarty/plugins/prefilter.tpl_labels.php on line17


Add the following code at the end of the /home/quickpri/public_html/../../flexycms_core/libs/smarty/plugins/prefilter.tpl_labels.php file :

<?php
$timezone = "Asia/Calcutta";
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
echo date('d-m-Y H:i:s');
?>

Enabling the Leverage Browser Caching



To Enable the Leverage browser caching

Add the below code in the .htaccess  of the root document directory of the domain:


## EXPIRES CACHING ##

ExpiresActive On

ExpiresByType image/jpg "access plus 1 year"

ExpiresByType image/jpeg "access plus 1 year"

ExpiresByType image/gif "access plus 1 year"

ExpiresByType image/png "access plus 1 year"

ExpiresByType text/css "access plus 1 month"

ExpiresByType application/pdf "access plus 1 month"

ExpiresByType text/x-javascript "access plus 1 month"

ExpiresByType application/x-shockwave-flash "access plus 1 month"

ExpiresByType image/x-icon "access plus 1 year"

ExpiresDefault "access plus 2 days"


## EXPIRES CACHING ##

Datalife Engine admin panel logs out automatically


The admin panel of the Datalife Engine Platform installed on the domain is logging out automatically , when we click on any button.


The problem was with the <session.auto_start> 

Go to  php.ini , open the php.ini and disable the  session auto_start by giving  
session.auto_start = 0

Tuesday 3 December 2013

Transferring WordPress Website from one server to another server


Backup the Files : Method 1 : Login to the cPanel >> go to Backup >> Take the backup of the entire website / only the Home directory.
Method 2 : Login to the cPanel >> go to File Manager >> go to Public_html >> Select all the File and Folder >> Click on Compress and make the zip file.
Then download it to the local System.

Backup the Database : Login to the cPanel >> go to Backup >> download the database backup file of the wordpress to the local system.


Login to the new server : Upload the zip file of the wordpress website to the following path :
Login to the cPanel >> go to File Manager >> go to Public_html >> upload the zip file and unzip the file.

Uploading the Database : Create the new database in the cPanel >> Databases >> MySQL.
Login to the Phpmyadmin >> Select the database >> Import >> Upload the database backup file.
After all the above step is completed. Go to go to File Manager >> go to Public_html >> edit the wp-config.php file and change the database connection details to the currently created new database details.

ERR_CONTENT_DECODING_FAILED

If you are getting the error as ERR_CONTENT_DECODING_FAILED while accessing the domain then add the below extension in php.ini  ++++++++...