• Welcome to Web Hosting Community Forum for Webmasters - Web hosting Forum.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Kevin

#1
Hi,

I have few domains registered with Godaddy registrar. I have recently purchase Amazon EC2 service from Amazon. How can I point my Godaddy domains to my Amazon EC2 instance?

I am new to Amazon EC2 cloud.

Thanks!
Kevin
#2
How Tos / Rkhunter installation Guide
November 26, 2008, 10:48:47 AM
Rkhunter is a very useful tool that is used to check for trojans, rootkits, and other security problems. It is highly recommended to install it on your Linux base server. Below is the guide line to install it:

[1] Download Rkhunter from the below link:
http://sourceforge.net/projects/rkhunter/
[2] Untar the installation file using the below command:
tar -zxvf downloaded_file_name
[3] Go to Rkhunter using the below command:
cd rkhunter-version_numberJust type ls and you will get the name of rkhunter  directory.

[4] Install it using the following command:
./installer.sh
Now you can run it manually using the below command:
/usr/local/bin/rkhunter -c
You can setup in daily cron to run it automatically. To add it in daily cron follow the below steps:

pico /etc/cron.daily/rkhunter.sh
Now add the following line:
#!/bin/bash
(/usr/local/bin/rkhunter -c --cronjob 2>&1 | mail -s "Rkhunter Report" youremail@domain.com)

rkhunter.sh file should have execute permission. You can do it using

chmod +x /etc/cron.daily/rkhunter.sh
Regards,

Kevin
#3
How Tos / E-mail Alert on Root SSH Login
November 26, 2008, 10:35:22 AM
It is essential that you have been notified whenever someone login to your server. On the server, you can set an email alert when someone login to your server as root.

[1] Login to your server as a root user.

[2] Type the below command:
pico /root/.bashrc

[3] Scroll down to the end of the file and add the following line:

echo 'Root Shell Access on your [ServerName] on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" <a href="mailto:[email protected]">[email protected]</a>

[4] Save the file and exit from SSH. Now login to your server and check whether you are receiving the email alert or not.

Regards,

Kevin
#4
Linux / Newbie Linux Server Administration Guide
November 26, 2008, 10:28:25 AM
Hi,

Let us start a thread to describe some commonly used Linux commands to manage the server. Probably this will help to the newbie who have less knowledge.

[1] To check the running processes:
top
Description: This command will display the current running processes on the server. This will help to monitor the current running processes. For more options of this command go through the manual of this command.

man top
[2] To list the files and folders:
ls
Description:
This is command will list the files and folders which are in current directory. For more options of this command go through the manual of this command.

man ls
[3] To check running process by particular user:
ps
Description:
By adding some parameters to this command you can grep the processes owned by particular user:

ps auxf | grep username
Regards,

Kevin
#5
It is a good idea to disable root login via SSH. It reduces the security risk. It is also recommended to use SSH protocol 2 and disable SSH protocol 1. SSH protocol 2 is more secure than SSH protocol 1. Following are the steps to disable direct root login and to disable SSH protocol 1:

[1] Login as a 'root' to your server.
[2] Open /etc/ssh/sshd_config file.
Quotepico -w /etc/ssh/sshd_config
[3] Find the below text within file:
QuoteProtocol 2, 1
[4] Uncomment the above line and change it as follow:
QuoteProtocol 2
[5] Now, search the below text:
QuotePermitRootLogin yes
[6] Uncomment the above line and set as follow:
QuotePermitRootLogin no
[7] Save the file and restart SSH service using the below command:
Quote/etc/rc.d/init.d/sshd restart

Now, no one will be able to login as root directly. They have to use su - to get the root access. You will need to add your user to wheel group in cPanel otherwise you will not be able to use su command.

Regards,

Kevin
#6
How Tos / How to redirect using META Tags
November 04, 2008, 02:44:45 AM
Hi,

Sometime you may need to redirect your html or htm (static pages to another URL). You can do this using the META tag redirection. you just need to add the following code in your code to redirect the page:

<META http-equiv="refresh" content="1;
             URL=http://www.webhostingdiscussion.net">

Regards

Kevin
#7
One of the common error in cPanel after installation is:

/usr/bin/crontab permissions are wrong. Please set to 4755

An easy fix for this error is:

- Login to your server via SSH and shoot out the following command:
- chmod 4755 /usr/bin/crontab

Please note that you will require root access to the server to change the permissions of crontab.

Kevin
#8
It is simple process to install PHPMailer on Windows server. You just need to upload PHPMailer class file inside the 'includes' folder of your PHP installation. Generally the include folder in locate inside your PHP installation directory (c:\php\includes). Make sure you have added this include path in your php.ini files.

That's it.  :)

Kevin
#9
Other Web Hosting Stuff / Windows or Linux Hosting ??
October 05, 2008, 10:36:51 PM
Hi,

Which hosting platform are you using for your web site?

For me it's Linux.

Kevin
#10
How Tos / Disable manually update Awstats from cPanel
September 28, 2008, 08:45:19 PM
Many host allow to update the Awstats of the domain from 'Update Now' link on Awstats page. However, it consumes some additional server resources if you are updating the stats of some high traffic web site. This option should be disabled in shared hosting server. If you are unsure on how to disable it then the below steps will help you:

[1] Login to your WHM.
[2] Go to Tweak Settings.
[3] Uncheck the option "Allow users to update Awstats from cPanel" and save it.

Regards,

Kevin
#11
How Tos / Disable PHP mail function on cPanel server
September 28, 2008, 02:49:29 PM
There is a function available in PHP to send a mail via PHP script. The function is mail(). However, it is advisable to disable PHP mail() function on the shared hosting server to prevent spamming from the server and allow only SMTP authentication to send the emails via PHP script. You can disable PHP mail() function from WHM. You will just need to follow the below steps for that:

[1] Login to your WHM.
[2] Go to Tweak Settings.
[3] Select the option "Prevent the user "nobody" from sending out mail to remote addresses (PHP and CGI scripts generally run as nobody if you are not using PHPSuexec and Suexec respectively.)" and save it.

Regards,

Kevin
#12
How Tos / Disable BoxTrapper Spam Trap for cPanel server
September 28, 2008, 02:37:17 PM
There is a feature called BoxTrapper Spam Trap in cPanel. If you have enabled this option for your domain then whenever anyone sends email they will need to reply the automated mail generated by BoxTrapper Spam Trapper and then you will receive the email to your account. However, it is advisable not to enable this option. You can disable this option server wide by following the below steps:

[1] Login to your WHM.
[2] Go to Tweak Settings.
[3] Uncheck BoxTrapper Spam Trap option and save it.

Regards,

Kevin
#13
How Tos / Disable SpamAssassin for entire cPanel server
September 28, 2008, 02:31:51 PM
You can disable SpamAssassin for your entire server by following the below steps:

[1] Login to your WHM.
[2] Go to Tweak Settings.
[3] Uncheck SpamAssassin Spam Filter option and save it.

If you are not using SpamAssassin in your server, you can also disable SpamAssassin service. To disable it:

[1] In WHM -> Go to Service Manager.
[2] Uncheck Enabled and Monitor option for spamd.

Regards,

Kevin
#14
Linux / How to check and monitor memory usage on Linux
September 28, 2008, 11:37:57 AM
To monitor the memory usage on the server is essential in order to make your server stable. If your server goes out of memory then you may need to reboot the server to come back your server online again. There are few commands available to monitor the memory usage on the server:

vmstat
This command gives you the information about processes, memory, paging, block IO,  traps, and CPU activity. For all the options refer the manual of this command (man vmstats).

free -m
It displays the amount of free and used memory in the system.  For all the options, refer the manual of this command (man free).

cat /proc/meminfo
This file contains the information of current memory status (Free memory, used memory etc.).

Regards,

Kevin
#15
Google / Google Chrome for Windows - Google's own Browser
September 28, 2008, 11:07:21 AM
Hey,

Google has launched their own browser Google Chrome. They has used minimal design and many inbuilt features to make the web faster, safer, and easier.

For more details, http://www.google.com/chrome

Kevin
#16
To crate a MySQL database in HELM is an easy job. You just need to follow the below steps to create it:

[1] Login to you HELM control panel.
[2] Click on Domains.
[3] On very next page, click on your domain name.
[4] Now go to Database Manager and click on Add New button.
[5] Select the option MySQL and enter the desired database name that you want to create; save it.

The above steps are for HELM 3 version. If you are not able to see MySQL database then there is no MySQL resource allocated to your package.

Kevin
#17
Site and Server Administration / What is KVM - KVM over IP
September 07, 2008, 08:10:22 PM
What is KVM? KVM is an abbreviation for Keyboard, Video Display Unit, Mouse. A KVM switch is a hardware device that allows users to control multiple computers from a single keyboard, monitor and mouse. There are two types of KVM devices available. They are Local Remote and KVM over IP.

Local Remote KVM device allows users to control computers 1000 feet away from users console.

KVM over IP is to allow users to control the computers remotely by using the TCP/IP Internet infrastructure.
 
There are many providers available for KVM and based on the product the functunality may be changed.

Kevin
#18
How Tos / How to install PostGIS on Linux
August 30, 2008, 01:04:24 AM
Before you proceed to install PostGIS, make sure you have PROJ4, GEOS 3.0 and PL/pgSQL prodedural language installed on your server. Now download the latest version of PostGIS from their web site and follow the below steps:

tar xvfz postgis-1.3.1.tar.gz                             //File name may change according to version
cd postgis-1.3.1
./configure
make
make install
createlang plpgsql yourtestdatabase
psql -d yourtestdatabase -f lwpostgis.sql
psql -d yourtestdatabase -f spatial_ref_sys.sql

Regards,

Kevin
#19
How Tos / adding / create mysql database in cPanel/whm
August 21, 2008, 06:57:25 PM
How to create MySQL database from cPanel/EHM:

- Login to the cPanel of your domain.
- Click on 'MySQL® Databases'.
- Enter the database name in New Database field and click on 'Create Database' button.

KEvin
#20
Apache / 404 redirection using .htaccess
August 21, 2008, 06:49:08 PM
You can set 404 redirection using .htaccess file. You just need to add the following link in your .htaccess file:

ErrorDocument 404 /404.html

Replace 404.html with actual file name where you would like to redirect when page can not be found.

Kevin
#21
If you are facing trouble to connect to your MySQL database you can use the following code to check the database connection:
<?php
$dbhost 
'localhost';   // Your MySQL server host
$dbuser 'dbuser';         // MySQL database user
$dbpass 'password'// Password for MySQL database User

$conn mysql_connect($dbhost$dbuser$dbpass) or 
die (
'Error connecting to mysql');
$dbname 'database_name';
mysql_select_db($dbname);
?>

Regards,

Kevin
#22
Hi,

If phpsusex is not enabled on the server then it is bit difficult to identify which user high resource because you will get 'nobody' as process owner. If a particular httpd process is using high resource then you can check it which account is belonging to this process using the following command:

grep $(lsof -p PID | grep cwd | awk '{print $9}' | awk -F '/' '{ print $3 }') /etc/userdomains

Replace PID with actual process ID. This should work on cPanel server. I am not sure if it works with other control panel.

KEvin
#23
How Tos / Verify cPanel/WHM license
August 12, 2008, 10:08:27 AM
Sometime, you might get the error regarding cPanel license. You can verify whether your server is licensed or not from cPanel site. You can verify it from the following URL:

http://verify.cpanel.net

Additionally you can use following command to reverify your license:

/usr/local/cpanel/cpkeyclt

You will need to login to your server via SSH to run above command.

Kevin
#24
If you do not want to set 301 redirection (permanent redirection) using PHP or ASP code then you can set it using mod_rewrite rule. Please note that you will require Apache web server to set this redirection. Following is the code that you will need to write in your .htaccess file to set the permanent redirection:

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^yourdomain.com [nc]
rewriterule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc]

Add above code in your .htaccess file and place it in the root folder of our web site.

Kevin
#25
You can set 301 redirection (Permanent Redirection) using the below ASP code. It helps to search engines to redirect to the new web site:

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-web-site-location.com/"
%>
Kevin
#26
PHP / 302 Redirect using PHP - temporary redirections
August 10, 2008, 04:06:37 PM
Sometime, you may need to redirect your site to some other location. In such event, you may set 302 redirection (also called temporary redirection) using PHP code. Following is the sample 302 redirection using PHP:


<?php
header
("Location: http://www.your-web-site.com/temp-location/index.html");
exit();
?>



Kevin
#27
You can set 301 redirection (Permanent Redirection) using the below PHP code. It helps to search engines to redirect to the new web site:

<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.location-to-new-web-site.com" );
?>
Kevin
#28
Search Engine optimization / Search engine submission
August 03, 2008, 02:43:56 AM
Hi,

Do we really need to submit the sites to major search engines or they come automatically?

Kevin
#29
Hi,

You might have seen the error "Client does not support authentication protocol" in your application. This is due to version problem of MySQL.  For example, if you upgrade your server from MySQL 4.0 to MySQL 4.1 then you may face the problem to connect to your MySQL Database. You may receive the below error:

Client does not support authentication protocol requested
by server; consider upgrading MySQL client

To solve this problem, you can follow the below option:

- Go to command prompt of mysql using below command:
mysql -u root -p

- Then shot out the below command:

UPDATE mysql.user SET password=OLD_PASSWORD('somepassword')
WHERE user='someuser' AND host='somehost';

- Now flush the privileges using the below command:

flush privileges;

You are facing this problem because both the versions of MySQL use different format to store password.

Kevin
#30
Other Search Engines / Alexa traffic ranking
June 22, 2008, 08:06:56 PM
Hi,

Are you still using Alexa rank to measure site traffic for your domain. It was good in past years but now a days people are more reply on Google rank. What's your opinion?