Friday, April 11, 2008

Insallation of Shoutcast

What is shoutcast?

SHOUTcast is Nullsoft's Free Winamp-based distributed streaming audio system. Thousands of broadcasters around the world are waiting for you to tune in and listen. You can start your own radio station and stream music and live shows. See an example of hundreds of world-wide stations at shoutcast.com

-------------------------------

How do we install shoutcast?

Generally you dont want to run shoutcast as root as that can be really bad and a security issue, instead we'll create a shoutcast user:

1.) Login to root through SSH on the server.
2.) adduser shoutcast
3.) passwd shoutcast

Now it will ask for a new password set this and remember it.

Installing shoutcast

Lets grab shoutcast from nullsoft:

1) wget http://www.shoutcast.com/downloads/sc1-9-2/shoutcast-1-9-2-linux-glibc6.tar.gz

Lets extract shoutcast:
2) tar -zxvf shoutcast-1-9-2-linux-glibc6.tar.gz

Lets tidy up the directory:
3) rm -rf shoutcast-1-9-2-linux-glibc6.tar.gz
mv shoutcast-1-9-2-linux-glibc6 shoutcast
cd shoutcast

Shoutcast has now been installed!


How to configure shoutcast?

Now we need to edit the configuration file.

pico sc_serv.conf
or you can use vi which I prefer, a bit more advanced to use.
vi sc_serv.conf

Ok lets set some important configureation options. Change these settings in the file:
MaxUser
Password
PortBase

uncomment AdminPassword and set an admin password.

Now at this point you can go threw the settings and change them to what you want or you can save and start shoutcast and it will work perfectly.

to save crtl+x (if using pico) or :wq if using vi

How do i start shoutcast?

./sc_serv sc_serv.conf

--------------------------------------------



Script to catch malicious perl scipts uploaded to /tmp

Following script can help you to catch malicious perl scipts uploaded to /tmp.

#!/bin/bash
#Script designed for http://dantechie.blogspot.com/. Its GNU,FREE,DISTRIBUTABLE

ROOTBADSCRIPTS=/root/badperlscripts
EMAILLOG=/root/emailperlscriptlog
LOAD=`cat /proc/loadavg | awk ‘{print $1, $2, $3}’`
HOST=`hostname`
TIME=`date`
ADMINEMAILS=”,admin@admin.com”
if [ ! -e $ROOTBADSCRIPTS ]; then
mkdir $ROOTBADSCRIPTS
chmod 700 $ROOTBADSCRIPTS
fi
rm -f $EMAILLOG
touch $EMAILLOG
for FILES in /tmp/*
do
if [ ! -d $FILES ]; then
if [ -w $FILES ]; then
#grep perl $FILES > /dev/null 2>&1
head -1 $FILES | grep perl > /dev/null 2>&1
if [ $? -eq 0 ];
then
echo “$TIME $HOST $FILES — perl script found Load : $LOAD ” >> $EMAILLOG
mv -f $FILES $ROOTBADSCRIPTS
killall -9 perl > /dev/null 2>&1
killall -9 perl > /dev/null 2>&1
killall -9 perl > /dev/null 2>&1
#//chown root.root $FILES
#//chmod 000 $FILES
#//chattr +i $FILES
fi
fi
fi
done
for FILES in /dev/shm/*
do
if [ ! -d $FILES ]; then
if [ -w $FILES ]; then
#grep perl $FILES > /dev/null 2>&1
head -1 $FILES | grep perl > /dev/null 2>&1
if [ $? -eq 0 ];
then
echo “$HOST $FILES — perl script found Load : $LOAD ” >> $EMAILLOG
mv -f $FILES $ROOTBADSCRIPTS
killall -9 perl > /dev/null 2>&1
killall -9 perl > /dev/null 2>&1
killall -9 perl > /dev/null 2>&1
#//chown root.root $FILES
#//chmod 000 $FILES
#//chattr +i $FILES
fi
fi
fi
done
if [ -s $EMAILLOG ]; then
cat $EMAILLOG | mail -s “Perl Script report on $HOST” $ADMINEMAILS
fi
exit

How to disable telnet access on server

Telnet should be disabled on all web servers, and you should use SSH. Telnet sends password in plain text passwords and usernames through logins, and ‘crackers/hackers’ can obtain these passwords easily as compared to SSH. TELNET server listens for incoming messages on port 23, and sends outgoing messages to port 23.

1. Login to your server through SSH as a root user.

2. open file
# vi /etc/xinetd.d/telnet

3. Look for the line: disable = no and replace with disable = yes

4. Now restart the inetd service:
#/etc/rc.d/init.d/xinetd restart

5. Turn off it through chkconfig as well because it can still start through that.
#/sbin/chkconfig telnet off

6. Scan your server to ensure port 23 is closed.
#nmap -sT -O localhost

Also run ps -aux | grep telnet and if you find anything other than “grep telnet” as result kill the process.

Difference between Linux and Windows

Linux is an open-source Operating System. People can change codes and add programs to Linux OS which will help use your computer better. Linux evolved as a reaction to the monopoly position of windows. you can't change any code for windows OS. You can't even see which processes do what and build your onw extension. Linux wants the programmers to extend and redesign it's OS. Linux user's can edit its OS and design new OS.

All flavors of Windows come from Microsoft. Linux come from different companies like LIndows , Lycoris, Red Hat, SuSe, Mandrake, Knopping, Slackware.

Linux is customizable but Windows is not. For example,NASlite is a version of Linux that runs off a single floppy disk and converts an old computer into a file server. This ultra small edition of Linux is capable of networking, file sharing and being a web server.

Linux is freely available for desktop or home use but Windows is expensive. For server use, Linux is cheap compared to Windows. Microsoft allows a single copy of Windows to be used on one computer. You can run Linux on any number of computers.

Linux has hign security. You have to log on to Linux with a userid and password. You can login as root or as normal user. The root has full previlage.

Linux has a reputation for fewer bugs than Windows.

Windows must boot from a primary partition. Linux can boot from either a primary partition or a logical partition inside an extended partition. Windows must boot from the first hard disk. Linux can boot from any hard disk in the computer.

Windows uses a hidden file for its swap file. Typically this file resides in the same partition as the OS (advanced users can opt to put the file in another partition). Linux uses a dedicated partition for its swap file.

Windows separates directories with a back slash while Linux uses a normal forward slash.

Windows file names are not case sensitive. Linux file names are. For example "abc" and "aBC" are different files in Linux, whereas in Windows it would refer to the same file.

Windows and Linux have different concepts for their file hierarchy. Windows uses a volume-based file hierarchy while Linux uses a unified scheme. Windows uses letters of the alphabet to represent different devices and different hard disk partitions. eg: c: , d: , e: etc.. while in linux " / " is the main directory.

Linux and windows support the concept of hidden files. In linux hidden files begin with " . ", eg: .filename

In Linux each user will have a home directory and all his files will be save under it while in windows the user saves his files anywhere in the drive. This makes difficult to have backup for his contents. In Linux its easy to have backup's.

What is Digg?

Digg is a popular social bookmarking and content discovery website. Although site management and maintenance is done the website’s paid staff, everything on digg is submitted by the digg user community. These submissions are subject to peer review and are voted upon by other site visitors. The stories receiving enough diggs is posted on the websites front page, for the millions of digg visitors to see. According to Alexa, Digg is one of the most popular websites on the internet, reaching 1 out of every 100 internet users daily.

How to submit stories?

Submitting stories to digg is very easy. To submit stories you have to be a registered member of the digg, once you have registered and signed in, just click on the option submit story and then enter the URL of the story which you would like to submit. Then enter the title of the story with a short description and select the proper category for the story. You are only allowed to digg only original story and not any duplicate entry.

What can you do as a digg user?

Every digg user can digg (help promote), bury (help remove spam), and comment on stories. You can even digg and bury comments you like or dislike. Digg also allows you to track your friends’ activity throughout the site.

Inatall NoBody Check

Download
Nobody Check is available for download free here: nobody_check.tar.gz


Installation Script: NEW
Install Nobody Check has never been easier.

1) Login to your server as the root user through shell
2) wget http://www.webhostgear.com/projects/nobodycheck/install.sh
3) chmod +x install.sh
4) ./install.sh
Wait for the installer to finish
5) rm -f install.sh
6) Open the /usr/local/nobody_check/nc.conf and put in your email address and select your options

Demo Nobody Check now!
While we can't run an actual demo of the script we can provide you with the output it produces so you get the idea of how it works.

- Email Detection Result
- Shell Scan Result


Documentation
- readme which answers many questions
- changelog


Licensing
Nobody Check is Copyright of Wave Point Media Inc. and WebHostGear. All rights reserved. We express no warranty or liability if you use this tool. This script may not be copied, altered or redistributed unless you have explicit written permission from Wave Point Media Inc.

Also feel free to ask questions in our forums in our official Nobody Check support thread here.

Stay Updated New Releases
Join our mailing list and get details when we make product changes. We're frequently changing this script, adding new features and fixing bugs - we highly suggest joining the mailing list. We will never send you spam or sell your address.

PhpMyAdmin Installation Step by Step

This is a step-by-step tutorial for installation of phpMyAdmin on your shared/reseller/dedicated hosting space using FTP access or shell access.

1.ftp::Download the latest version from http://www.phpmyadmin.net/home_page/downloads.php.

The latest version is at the top. You can download the .zip file.

Shell::wget
http://mesh.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.9.0-rc1.tar.gz

2. ftp ::Extract the contents of the .zip file using a program like winrar.

shell:: tar -zxvf phpMyAdmin-2.9.0-rc1.tar.gz

3. [Optional] You may want to delete unneeded language files. This saves time while uploading. Go into ‘lang’ folder and delete all files except a) all the .sh files and b) the three .php files having names starting w/ ‘english’.

4. In this tutorial scope, we are going to have phpMyAdmin access and control all the tables in a single database that you are going to create.

a. Create a DB using cPanel

b. Create MySQL username and a password for this user

c. Assign all privileges to this user to access the DB

5. Edit the config.inc.php file.

a. Usually it is ‘localhost’.

$cfg[’Servers’][$i][’host’] = ‘localhost’; // MySQL hostname or IP address

b. Enter MySQL user you created in step 4 b.

$cfg[’Servers’][$i][’controluser’] = ‘MySQL_user’; // MySQL control user

settings

c. Enter MySQL user’s password that you created in step 4 b.

$cfg[’Servers’][$i][’controlpass’] = ‘MySQL_pass’; // access to the

“mysql/user”

d. Save the file and close it.

6. ftp::Log into your web space using a FTP client and create a directory, say phpmyadmin under public_html. Upload all the content into the directory created.

Shell:: For the convient move the phpMyAdmin fodler to phpmyadmin using following command under your public_html folder

mv phpMyAdmin-2.9.0-rc1 phpmyadmin

7. Installation is complete. Simply point your browser to the directory where you installed phpMyAdmin and you should be able to start using it.

8. Important: Password protect the directory where you installed phpMyAdmin or else anyone will be able to access it! You can do that using the admin panel that your host provides.

-- Dhananjay

Install Bandwidth manager on linux server

Install Bandwidth manager on linux server

cd /usr/local/src
[/usr/local/src]#wget http://www.gropp.org/bwm-ng/bwm-ng-0.5.tar.gz
[/usr/local/src]tar -zxf bwm-ng-0.5.tar.gz
[/usr/local/src]#cd bwm-ng-0.5
[/usr/local/src/bwm-ng-0.5]#./configure; make; make install
/usr/local/src/bwm-ng-0.5]# bwm-ng

it will show you following action
bwm-ng v0.5 (probing every 0.500s), press 'h' for help
input: /proc/net/dev type: rate
/ iface Rx Tx Total
===========================================================================
lo: 0.00 KB/s 0.00 KB/s 0.00 KB/s
eth0: 8.24 KB/s 17.83 KB/s 26.07 KB/s
---------------------------------------------------------------------------
total: 8.24 KB/s 17.83 KB/s 26.07 KB/s


How to stop hotlinking using .htaccess

You can stop others from hotlinking your site's files by placing a file called .htaccess in your Apache site root (main) directory. The period before the name means the file is hidden, so you may want to edit your file as htaccess.txt, upload it to your server, then rename the txt file to .htaccess in your directory. Contact your web host on how to access your directories and configure your .htaccess file.


Example: Your site url is www.mysite.com. To stop hotlinking of your images from other sites and display a replacement image called nohotlink.jpe placed in your images directory, place this code in your .htaccess file:


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

The first line of the above code begins the rewrite. The second line matches any requests from your own mysite.com url. The [NC] code means "No Case", meaning match the url regardless of being in upper or lower case letters. The third line means allow empty referrals. The last line matches any files ending with the extension jpeg, jpg, gif, bmp, or png. This is then replaced by the nohotlink.jpe file in your images directory. This JPEG image is using the extension jpe instead of jpg to prevent blocking your own replacement image.


To stop hotlinking from specific outside domains only, such as myspace.com, blogspot.com and livejournal.com, but allow any other web site to hotlink images:


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

You can add as many different domains as needed. Each RewriteCond line should end with the [NC,OR] code. NC means to ignore upper and lower case. OR means "Or Next", as in, match this domain or the next line that follows. The last domain listed omits the OR code since you want to stop matching domains after the last RewriteCond line.


You can display a 403 Forbidden error code instead of an image. Replace the last line of the previous examples with this line:


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


Warning: Do not use .htaccess to redirect image hotlinks to another HTML page or server that isn't your own (such as this web page). Hotlinked images can only be replaced by other images, not with an HTML page.

As with any htaccess rewrites, you may block some legitimate traffic (such as users behind proxies or firewalls) using these techniques.

Cpanel Server and all domains seem to not resolve

It seems that named.conf is getting blown away on some builds...may be only particular to ones on CentOS.

here is what you can do:

/scripts/rebuildnamedconf
/etc/init.d/named restart

That should get things going again.

Here is the thread cpanel forums has open on it:

http://forums.cpanel.net/showthread.php?p=191301

Spamd failed

Here is possible way to fix this problem. It appears to happen because of some bad CPAN links setup through cpanel. This should clear it out and hopefully restart spamd.

Logged in as root via ssh do the following:

rm -rf /home/.cpan
rm -rf /root/.cpan
rm -rf /root/.cpcpan
/scripts/updatenow
/scripts/perlinstaller
/scripts/exim4