Posts

Showing posts from November, 2010

How to check linux ram usage

It is better use free -m instead of top. Here is why http://www.linuxatemyram.com/

Our server is getting attacked by DDOS

Recently our gamez.mn server is getting attacked by ddos. In the first I didn't know what to do. So googled and found this page http://www.topwebhosts.org/tools/apf-bfd-ddos-rootkit.php in short it will install APF - Firewall BFD - Brute Force Detection DDOS Deflate - DDoS Deflate for more detailed info  http://www.mydigitallife.info/2007/12/13/prevent-and-stop-dos-or-ddos-attacks-on-web-server-ddos-deflate/ Rootkit - Rootkit Hunter BFD and DDOS Deflate works great with APF so better install it over Iptables and then install others. And after that I started banning IPs like 67 with 67 connection like that. As you can see 67 is not a IP. So it seems attacker hid ip or is it using ipv6?  Then I've disabled ipv6 using this link. http://www.g-loaded.eu/2008/05/12/how-to-disable-ipv6-in-fedora-and-centos/   It seems quite right now. Dunno what will happen next. And Addition here is Apache Optimization tutorial http://kb.liquidweb.com/apache-optimization/ us...

I case some1 bored

Mishka r u stupid ? Noooooooooo http://www.youtube.com/watch?v=gRw-lfXy_tQ&feature=channel Rap dog http://www.youtube.com/watch?v=AWUkgwo-zJE&feature=related Even Better Mishka talking dog list http://www.youtube.com/watch?v=h4k6KNk_ywE&list=PLB596D05A243F93B3

My preffered Yum Repo

UtterRamblings is bestest out there. Maybe it just my opinion maybe everyone's. I'm updating from this repo about 2 years. Here is the link http://www.jasonlitka.com/, and here is the tutorial http://www.jasonlitka.com/yum-repository/ good luck.

My virtual host configration

This is my Virtual host configuration. #GAMEZ.MN <VirtualHost *:80>     ServerAdmin me_sor@yahoo.com     DocumentRoot /home/web/gamez.mn     ServerName gamez.mn     ServerAlias www.gamez.mn     ErrorLog /home/web/gamez.mn-error_log     CustomLog /home/web/gamez.mn-access_log common <Directory "/home/web/gamez.mn">     Options FollowSymLinks     AllowOverride All     Order allow,deny     Allow from all </Directory> </VirtualHost> It may have wrong configurations. If you think it may have some feel free to comment. I'd like to make this as web.conf and place it in /etc/httpd/conf.d/ folder

Excluding unwanted dependencies from yum update

If you like to use YUM (Yellow Dog Updater Modified) you may know unwanted bit dependencies always comes with updates and messes up things. To prevent unwanted i386, i586, i686 dependencies you just have to add exclude=*.i386 *.i586 *.i686 this line to /etc/yum.conf so it will never install or update this dependencies. As this configuration above it will only install and update 64 bit dependencies.

Preventing Root access VSFTPD

I like vsftpd (Very Secure File Transfer Protocol Daemon) than proftp. But you have to prevent exploring root folders on it. To do it just add chroot_local_user=YES this line at the end of the /etc/vsftpd/vsftpd.conf file. Sometimes this action described ass Jail root, and chroot

MySQL command source

Found a New way to import dumped sql file. It called source. Run source from mysql console window. the syntax is source folder/filename.sql  This command executes sql file as a script. Will create db insert update etc.

Set up RAID on Dell Poweredge 2850

Today I had a hard day. Our server HDD crashed (I think it had a bad sector or something? Friend of mine checked our server and said it's hard disk broken) and we had to change HDD. We got 4 SCSI HDD (72gb) for a cheap price. And decided to make a RAID. But it is way harder than regular PC RAID. I've followed THIS tutorial and settled up very good raid configuration. But real problem was just started. After setting up raid and installing nice clean centos 5.5 I decided to put a old HDD into server and copy files from there to new HDD. But server won't recognize my old HDD cause of RAID configuration. So I had to add old HDD as a RAID. And BOOM all Data is gone. It was very stupid step :( . I didn't find a way to add (mount or something) a HDD to RAID configured server. If you have solution for this pls share with me. Also I wanna restore my old HDD data. Is there a way? And again never ever try to add HDD to a RAID as a RAID

Linux Add User, Set Password, Remove User, change user folder

On linux it is very easy to crate user. adduser usernamehere passwd usernamehere userdel -r usernamehere that's all. And for changing user's folder go to /etc/passwd document and find your user and change their folder. I prefer WinSCP for SSH connection and file edition. It is very easy to use and works on all windows versions. I've tested it on XP 32bit, vista 64bit, win7 64bit. And for command line (also known as Terminal) I prefer Putty. I think everyone do.

Using Tar

And here is how to use tar tutorial link http://www.cs.duke.edu/~ola/courses/programming/tar.html in short 1. Create tar cps100 is target folder (to be compressed), foo.tgz is target file (to be created) tar cvzf foo.tgz cps100 2. Extract tar xvzf foo.tgz

Backing up all mysql DB and restoring

Every time when I wanna Backup and Restore DB I have to google again and again. So here is very good tutorial for doing this saving time http://www.webcheatsheet.com/SQL/mysql_backup_restore.php In short: 1. backup all database compressed mysqldump -u root -p --all-databases | gzip -9 > alldb_backup.sql.gz 2. restore all database + users gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]

phpmyadmin my preferred Auth Type

I love phpmyadmin. This powerful script can do on mysql database anything you want via simple web front end. In its default configuraion auth type is set to "cookie". But I prefer "http". Dunno but I like http auth.

Disable Selinux Temprory

There is many folder not found errors will come up if Selinux enabled. And if will make vsftpd stop working. For VSFTPD won't work with an issue like "oops Chroot" or cant upload anything. All you have to do is setsebool -P ftp_home_dir 1 and that is it. Many sysadmins recommends that dont Disable Selinux. But if you have to disable it run this command echo 0 > /selinux/enforce This will disable Selinux temporary until next reboot. If you wanna disable it forever open this file /etc/selinux/config and change to SELINUX=disabled. And then you have to reboot your pc