Archive for the Category »Uncategorized «

Joomla “404 component error”?

While browsing Joomla site “404 component error” message refer following steps to resolve issue.

Login into Joomla admin section

Then select Menus >> Menu Item Manager

Check box “Home” option from list and then only click on the YELLOW star icon in the upper-right corner.

Now browse your site and if you are still having any problem then refer Joomla thread to sort out your issue.

Joomla “Not a valid image” issue?

While uploading images we are receiving “Not a valid image” error message. To resolve error message refer following steps.

First login into Joomla admin section and check box following option.

Global Config > System
- restrict uploads = No
- check mime types = No

Second edit configuration.php file and change.

From

var $ftp_enable = ’1′;

To

var $ftp_enable = ’0′;

Third comment following line in php.ini file if you are using customize php.ini file (mostly used on SuExec server).

;upload_tmp_dir = tmp

And now try to upload the image.

Database sizes shows zero in cPanel?



Once we upgrade from cPanel 11.24 to 11.25 version. We are receiving lots bug. One of them is database size showing zero in cPanel. To resolve this issue you have to edit following file /var/cpanel/cpanel.config

root@support[~]vi /var/cpanel/cpanel.config

Search line “disk_usage_include_sqldbs” in file “ /var/cpanel/cpanel.config and change it

From

disk_usage_include_sqldbs=0

to

disk_usage_include_sqldbs=1

And run script

-/scripts/update_db_cache





How to install Webmin?



You can install webmin by using following steps.

root@gunjan[~]#cd /usr/local/src

root@gunjan[~]#wget http://sourceforge.net/projects/webadmin/files/webmin/1.500/webmin-1.500-1.noarch.rpm/download

root@gunjan[~]#rpm -Uvh webmin-1.500-1.noarch.rpm

warning: webmin-1.500-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID xxxxx
Preparing… ########################################### [100%]
Operating system is CentOS Linux
1:webmin ########################################### [100%]
Webmin install complete. You can now login to http://server.domain.com:10000/
as root with your root password.

Stop hotlinking from outside domains by using .htaccess?

How to stop hotlinking from outsides domains.

You can stop the hotlinking from outsider domain by using following rule in .htaccess

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+.)?domain.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+.)?domain1.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+.)?domain2.com/ [NC]
RewriteRule .*.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

You can also display a 403 Forbidden Error page instead of an image (nohotlink.jpe)

Replace last line on above code with the following code

RewriteRule .*.(jpe?g|gif|bmp|png)$ – [F]

WordPress default .htaccess file?

The default wordpress .htaccess file code is as follows

# BEGIN wordpress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_fileNAME} !-f
RewriteCond %{REQUEST_fileNAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END wordpress

How to patch openssl version?

You can patch openssl version by using following steps but make sure that you are able to SSH server as root user user.

root@gunjan[/usr/local/src]#cd /usr/local/src
root@gunjan[/usr/local/src]#wget http://www.openssl.org/source/openssl-0.9.8h.tar.gz
root@gunjan[/usr/local/src]#tar -zxf openssl-0.9.8h.tar.gz
root@gunjan[/usr/local/src]#cd openssl-0.9.8h
root@gunjan[/usr/local/src]#./Configure –prefix=/usr debug-linux-pentium (or choose right os)
root@gunjan[/usr/local/src]#make
root@gunjan[/usr/local/src]#make install

To check openssl version simply run openssl version

root@gunjan[/usr/local/src]#openssl version

Simple cgi script to check the Server uptime?

The following script you can use to check the Server uptime?

root@Gunjan [/usr/local/apache/cgi-bin]# nano loads
#!/bin/bash

echo Content-type: text/plain
echo

echo $(hostname)
echo “=>”
echo $(uptime)

Three command to check Servers uptime?

Yes its always good to know uptime for Server.You can check Server uptime by using following commands.

root@gunjan [~]# uptime
04:34:25 up 20 days, 14:31,  1 user,  load average: 0.15,07.33,0.76

root@gunjan [~]# w
04:34:20 up 20 days, 14:31,  1 user,  load average: 0.15,07.33,0.76
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT

root@gunjan [~]#top

top – 04:36:17 up 20 days, 14:33,  1 user,  load average: 0.15,07.33,0.76
Tasks: 290 total,   1 running, 283 sleeping,   0 stopped,   6 zombie
Cpu(s):  2.6%us,  1.4%sy,  0.0%ni, 78.9%id, 16.9%wa,  0.0%hi,  0.2%si,  0.0%st

What is Core Files in Linux?

A core file created when ever a program terminates unexpectedly and its also useful for determining what caused the termination. In many Linux server by default they do not produce core files when programs crash or terminates unexpectedly.

On  most of the Linux server core file size limitation is set to 0.You can check the core file size limit set in server by using following command.

root@gunjan [~]# ulimit -c
1000000

In above command core file size limit is 1000000 if output occur empty then it means core file size limit haven’t set on server and you can set it as

root@gunjan [~]# ulimit -c 1000000

or

root@gunjan [~]# ulimit -c unlimited

If you want to test core file limit is working on your server or not? then run following command

kill -s SIGSEGV $$

This above command will crashes your shell and produces core file in the current directory. as core.*

If core file is taking lots of disk space on server and you want to disable it then follow the steps one by one.

root@gunjan [~]#which httpd

/usr/sbin/httpd

root@gunjan [~]#pico /usr/sbin/httpd

And following line in /usr/sbin/httpd

ulimit -c 0

And then restart the Apache server