Web Hosting


Hello,
PHP and Apache are not being able to track which users are sending out mail through the PHP mail function from the nobody user causing leaks in formmail scripts and malicious users to spam from your server without you knowing who or where.

Monitiring exim_mainlog doesn’t exactly help, you see th email going out but you can’t track from which user or script is sending it. This is a quick and dirty way to get around the nobody spam problem on your Linux server.

If you check out your PHP.ini file you’ll notice that your mail program is set to: /usr/sbin/sendmail and 99.99% of PHP scripts will just use the built in mail(); function for PHP - so everything will go through /usr/sbin/sendmail
Requirements:

We assume you’re using Apache 1.3x, PHP 4.3x and Exim. This may work on other systems but we’re only tested it on a
Cpanel/WHM Red Hat Enterprise system.

Step 1:

Login to your server with root.

Step 2:
Turn off exim before proceeding
service exim stop

Step 3:
Take the Backup of  your original /usr/sbin/sendmail file

mv /usr/sbin/sendmail /usr/sbin/sendmail_bak

Step 4:

You need to  Create the spam monitoring script for the new sendmail.
pico /usr/sbin/sendmail

Paste in the following:

#!/usr/local/bin/perl

# use strict;
use Env;
my $date = `date`;
chomp $date;
open (INFO, “>>/var/log/spam_log”) || die “Failed to open file ::$!”;
my $uid = $>;
my @info = getpwuid($uid);
if($REMOTE_ADDR) {
print INFO “$date - $REMOTE_ADDR ran $SCRIPT_NAME at $SERVER_NAME n”;
}
else {

print INFO “$date - $PWD -  @infon”;

}
my $mailprog = ‘/usr/sbin/sendmail.hidden’;
foreach  (@ARGV) {
$arg=”$arg” . ” $_”;
}

open (MAIL,”|$mailprog $arg”) || die “cannot open $mailprog: $!n”;
while (<STDIN> ) {
print MAIL;
}
close (INFO);
close (MAIL);

save and close

Step 5:
Now change the new sendmail permissions
chmod a+x /usr/sbin/sendmail

Step 6:

Create a new log file to keep a history of all mail going out of the server using web scripts
touch /var/log/spam_log

chmod 0777 /var/log/spam_log

Step 7:
Start Exim up again.
/etc/init.d/exim start

Step 8:
You can Monitor your spam_log file for spam, try using any formmail or script that uses a mail function - a message board, a contact script.
tail - f /var/log/spam_log

Reference taken from : webhostgear.com

Hello,

For taking backup of you database you have to make sure that you database is good enough. with shell access you can take the database backup in .sql format with following command

#mysqldump user_databasename > database.sql

As you are having database backup and want to restore it then use following command

#mysql user_databasename < database.sql

Hello,

To get the apache version on linux server we have to use following command.

# /usr/local/apache/bin/httpd -v

To get the php version on linux server we have to use following command.

#php -v

you can get the php modules install on server with command #php -m
To get the mysql version on linux server we have to use following command.

#mysql -v

How to install and configure the CSF (configserver) firewall.

CSF can be used on a wide range of Linux systems, including those running cPanel. Following are the steps to install and configure the CSF.

Installation is quite straightforward:

rm -fv csf.tgz

wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

If you would like to disable APF+BFD (which you will need to do if you have
them installed otherwise they will conflict horribly):

sh disable_apf_bfd.sh

That’s it. You can then configure csf and lfd in WHM, or edit the files
directly in /etc/csf/*

csf is preconfigured to work on a cPanel server with all the standard cPanel
ports open. It also auto-configures your SSH port if it’s non-standard on
installation.

To configure CSF modify the config files in /etc/csf/ - or if you are running WHM you can modify the CSF settings in WHM itself.

You should ensure that kernel logging daemon (klogd) is enabled. Typically, VPS
servers have this disabled and you should check /etc/init.d/syslog and make
sure that any klogd lines are not commented out. If you change the file,
remember to restart syslog.

See the readme.txt file for more information.

Uninstallation
==============
Removing csf and lfd is even more simple:

cd /etc/csf
sh uninstall.sh

For installing the SSL certificate you need to have a dedicated IP Address, and make sure that your domain is registred domain name and resolving perfectly

Step 1: You need to generate CSR (certificate signing request ) from your webhost nameger. which required following information.

———————————–
- Host to make cert for:
- Country(2 letter Abbreviation):
- State:
- City:
- Company Name:
- Company Division:
- Email:
- Password:
———————————–
Also please create webmaster@yourdomain.com (replace yourdomain.com with the domain that you want the SSL certificate to be setup for) and provide us with its password so we can complete the installation process.

After CSR generation you will get the CSR and RSA key

step 2: With the help of RSA key you need to purchase SSL certificate from any of SSL provider such as COMODO ,instant SSL

step 3: Once you got the SSL cerificate then you need to provide that certificate to hosting provider so the hosting provider will install SSL cerificate from WHM >> SSL/TLS >> Install a SSL Certificate and Setup the Domain option.

To stop other sites directly linking to your images and media files and stealing your bandwidth You need to add following code in your .htaccess file

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com(/)?.*$ [NC]
RewriteRule .*.(gif|jpg|jpeg|bmp|wmv)$ http://www.domain.com/image.jpg [R,NC]

Note: replace your website with domain.com

Note: Please don’t disable the Windows Firewall unless and until you have the other appropriate firewall software installed on your system

There are mainly three methods for disabling the Windows Firewall. The first method is for any user with administrative privileges on an individual machine not remotely or collectively managed in any way. The other two methods are for use windows Administrators on fully managed systems or windows servers.

1) Using the Control Panel

This method is for any user with administrative access to unmanaged systems

1. From the Start menu, select Control Panel, then select Windows Firewall.
2. Select Off, then click Ok.

2) Using Local Policy

This method is for administrators with administrative access to unmanaged systems or locally managed systems where the machine is not part of a Windows 2000 or higher domain.

Go to Start menu >> select Run, here enter gpedit.msc.
Expand the Computer Configuration folder, then the Administrative Templates folder.
Expand the Network folder, then the Network Connections folder, then the Windows Firewall folder.
Select the Standard Profile folder.
Double-click the Windows Firewall: Protect all network connections option.
Select Disabled, then click OK.
Select the Domain Profile folder.
Double-click the Windows Firewall: Protect all network connections option.
Select Disabled, then click OK.
Close the Group Policy dialog box.

3) Using Group Policy

This method is for administrators with administrative access to managed machines that are part of a Windows 2000 or 2003 Active Directory domain.

Create a new Group Policy object, and give the object a descriptive name (for example, ITS-Turn off Windows Firewall).
Select the newly created group policy.
Right-click on the newly created policy and select Edit.
Expand the Computer Configuration folder, then the Administrative Templates folder.
Expand the Network folder, then the Network Connections folder, then the Windows Firewall folder.
Select the Standard Profile folder.
Double-click the Windows Firewall: Protect all network connections option.
Select Disabled, then click OK.
Select the Domain Profile folder.
Double-click the Windows Firewall: Protect all network connections option.
Select Disabled, then click OK.
Close the Group Policy dialog box.
In the Security Filter section, click Add.
Search for the objects that this group policy will be applied to, then click OK.
Close the Group Policy editor.

Hello,

The process of booting a Linux system consists of a number of stages as follows

1) BIOS

2) Master Boot Record (MBR)

3) LILO or GRUB

4) Kernel

5) init

6) Run Levels

The process of booting a Linux system consists of a number of stages

1)BIOS: Basic Input/Output System is the lowest level interface between the computer and peripherals which load boot sector from one of following devices

Floppy
CDROM
Hard drive

The boot order can be changed from within the BIOS. BIOS setup can be entered by pressing a del ,F1 , F2, or F10 key during bootup.

2)MBR:
The first sector of the hard disk is reserved master boot record (MBR).

When we the Operating booting from a hard disk, the PC system BIOS loads and executes the boot loader code in the MBR. Here MBR needs to know which partitions on the disk have boot loader code specific to their operating systems in their boot sectors and then attempts to boot one of them.

Fedora Linux is supplied with the GRUB boot loader which is fairly sophisticated and therefore cannot entirely fit in the 512 bytes of the MBR.
The GRUB MBR boot loader merely searches for a special boot partition and loads a second stage boot loader.

This then reads the data in the /boot/grub/grub.conf configuration file, which lists all the available operating systems and their booting parameters. When this is complete, the second stage boot loader then displays the familiar Fedora branded splash screen that lists all the configured operating system kernels for your choice.

3)Boot loader (GRUB or LILO)

Lilo and Grub are installed or at the MBR (Master Boot Record), or at the first sector of the active partition.

Boot loader will ask for the OS label which will identify which kernel to run and where it is located (hard drive and partition specified). The installation process requires to creation/identification of partitions and where to install the OS. GRUB/LILO are also configured during this process. The boot loader then loads the Linux operating system.

LILO: (Linux Loader)
In case of a multi-boot config, LiLo permits the user two choose an operating system from the menu. The LiLo settings are stored at /etc/lilo.conf
-LILO does not understand filesystems
- code and kernel image to be loaded is stored as raw disk offsets
-uses the BIOS routines to load

Grub (GNU Grub Unified Boot Loader)
- Understands file systems
- config lives in /boot/grub/menu.lst or /boot/boot/menu.lst

4)Kernel
-The kernel verifies hardware configuration and initialise devices.
(optionally loads initrd, )
-The kernel tries to mount the file system and the system filesmounts root filesystem specified by lilo or loadin with root= parameter

The file system type is automatically detected. The most used file systems on Linux are ext2 and ext3. If the mount fails, a so-called kernel panic will occur, and the system will “freeze”.
System files are usually mounted in read-only mode, to permit a verification of them during the mount. This verification isn’t indicated if the files were mounted in read-write mode.

-kernel prints: VFS: Mounted root (ext2 filesystem) readonly.
* runs /sbin/init which is process number 1 (PID=1)
- init prints: INIT: version 2.76 booting
- can be changed with boot= parameter to lilo, eg boot=/bin/sh can be useful to rescue a system which is having trouble booting.

After these steps, the kernel will start init, which will become process number 1, and will start the rest of the system.

5) init process
The init process is the last step in the boot procedure and parent of all the other processes. This process is the first running process on any Linux/UNIX system, and is started directly by the kernel. It is what loads the rest of the system, and always has a PID of 1.

Init is responsible for starting system processes as defined in the /etc/inittab file.

The init process is never shut down. It is a user process and not a kernel system process although it does run as root.

Run Levels

0 halt
1 single user
2 Not used (user-definable)

3 Full multi-user mode (no GUI interface)

4 Not used (user-definable)
5 X11 Full multiuser mode (with GUI interface)
6 Reboot

Based on the selected runlevel, the init process then executes startup scripts located in subdirectories of the /etc/rc.d directory. Scripts used for runlevels 0 to 6 are located in subdirectories /etc/rc.d/rc0.d through /etc/rc.d/rc6.d, respectively.

Default is defined in /etc/inittab, eg:
o id:3:initdefault:
The current runlevel can be changed by running /sbin/telinit # where # is the new runlevel, eg typing telinit 6 will reboot.

Dedicated Server Hosting lessen your need to share hardware or software with other websites on a server. Dedicated hosting is exceptionally flexible and robust solution that significantly meets the needs of more sophisticated users for their high traffic websites with lot of interactions.

Due to steady growth in the hosting industry and competitive environment the rates of the servers decline gradually but apparently you are going to consider to choose a dedicated hosting provider that provide reliable service and 24×7×365 monitoring of the server and network availability. The dedicated server hosting is in greatest demand due to the incredible growths of online presence of both small and mid-sized businesses.

With a dedicated server you get Control and Reliability and Fully Managed dedicated service that enable you to make changes and updates the installed software on a server because you get full root access to the web server and technical support by a team of experienced professionals.

In addition the users get the option to install the software and other resources they need for their websites and optimize page loads speed and allocation of resources on server that truly helps you to run a server resourcefully in its most optimal configuration in secure environment.

Dedicated server amplifies the website overall presence and helps you in performance drives customer retention. If you start realizing that your site is growing in fast, and you are getting increasingly the traffic from different sphere, then dedicated server is the most appropriate decision to shift on from a shared hosting environment.

There are various reasons why an online sector individual suchlike you has decided to shift to a new web hosting providers. Your old web hosting provider be like has real impecunious specialized funding, or their web server is frequently down, or may be your old web hosting supplier cannot have your hosting requirements anymore or you could disclosed a cheaper web hosting assistance? like this many more. Disregarding of the reasons, now you are planning to move to new web hosting provider and you necessity to assign your website from your present web host to the new web entertainer. Below is the step-by-step pass that you can unconstrained of soaring to a new web hosting provider.

Transfer Schedule
Ideally, you should guidance the conveyance one month before you change your old web hosting counseling in organization to possess enough periods to fulfill a untouched soul. Doing channelize in inferior than one month clip under frame will put your website in assay of untracked.

New web hosting service registration
Now, sign-up your new web hosting bringing once you make definite the morpheme familiar mentioned above. Depending on your new web hosting provider, your new web hosting record ordinarily gift be set up within 24 hours.

Files Backup
While ready for your new web host accounting to be created, it is clip to duplication all your web files on the old web hosting provider. In most cases, you already jazz all the files of your website on your local computer. Yet, it is good corking strain to duplication all your files from the old web computer. In element to the usual HTML files, you may impoverishment to approving any script files, databases files, and yet computer logs files if it is required. You should create a directory system that is corresponding to the directory construction on your web server and download the files into the several directories.

Files uploading

Formerly you are notified that your new web hosting invoice has been created, you faculty get asking email from your new web hosting supplier. In that email, it contains all the information required to set up website, this including the FTP login details. With that FTP details, you can now FTP to your new web hosting computer and upload all your files. You should start by oldest creating the directory structures on the web server, and then upload all the files to the respective directory.

It is the time to set any play script files or databases if they are utilized in your website. Likewise, it is a benevolent moment to set up all the email accounts through the administration body.

Once you make smooth uploading all the files and installed the play script files or databases, you can now use the temporary URL to examine your parcel. The temporary URL can be initiate in the request telecommunicate from your new web hosting provider. The temporary URL could be in the stalking initialize: http://your-host-domain/~your-webaccountname

Testing

Using the temporary URL directory, you can now trial your web site online. Due to the fact that incompatible web hosting server may require different computer environs to execute. Hence, you condition to declare all the scripts (such as CGI, Perl) are working accordingly. In addition, you should run all the hyperlinks in the modal web pages if affirmable to secure no humble course. Piece you are investigation finished the temporary URL directory, your website hosted on the old web hosting supplier is move operative.

Channel field nominate

Formerly you score over investigating your new website on the temporary URL and verified it is working utterly. The next step is to get in touch with your domain name register (i.e. the company where you till have your domain register) to modify the old DNS (Domain Name Server) to lie to the new DNS of your new web hosting provider. Unremarkably, the DNS information is sent to you through telecommunicate after you indicate prospering with the new web hosting supplier.

Alternatively, you depart be fit to Field itemize servers test how a domain recite is resolute. Typically, the domain name servers are in multitude split as:

ns1.your-new-web-hosting.com

ns2.your-new-web-hosting.com

Some domain name registrar has need of the IP addresses of the DNS. In this case you have to give the IP addresses of your new DNS. For example:

NS1: 216.193.194.212

NS2: 216.193.207.106

Typically, it takes 24-72 hours to get the DNS record to commute and move through all the WHOIS servers. You can use WHOIS tools on the net much as whois.com to defender the position of the DNS transplant. Once the shifting is completed, you will see the change in your new DNS. Alternatively, you can variety a pardonable change to your internal tender (for instance, adding a new image or symbol) and upload to the new-fangled web hosting server. When you access your site using domain name (www.your-site-name.com) and make sure that DNS has been transferred successfully.

Final Investigating

Now, your website on the new web hosting supplier is officially transferred and online. You should recheck all the tests to assure it is full usable. Once you are official the new website is excavation aright, you can go forward to terminate your old web hosting story.

Next Page »