Hoaxblog.com
Pages:
Categories:
- Apache (6)
- backup (1)
- cache (2)
- Cpanel/WHM (11)
- ddos (1)
- exam (1)
- file hosting (2)
- General (11)
- Hosting (1)
- It’s me (2)
- linux (1)
- Linux Shell (14)
- Make Money Online (2)
- Mysql (2)
- mysqldump (1)
- php (1)
- Programming (3)
- proxy (1)
- Reseller (1)
- SEO (1)
- Servers (21)
- VPN (1)
- Windows (6)
- wordpress (1)
Blogroll
Meta:
Archive for February, 2008
02 11th, 2008
Today i was working on protecting the server from ddos. While experienting on the network, i found that the banned IP log is being too big and needs to be reduced. It looks like the easiest way according to me is to use the tail command to void or emptying the file.
I was trying to void the ignore.ip.list file, which leads to the following command:
tail -1 ignore.ip.list > ignore.ip.list
If you want to keep last 5 lines and delete all others, then you can try this:
tail -5 ignore.ip.list > ignore.ip.list
Isn’t this handy?
Its really great when you need to void files like error_log, access log and some more logs in the linux server. It is better than deleting basically, if that file is going to create again.
02 8th, 2008
I have to say, Xcache works very perfect for bulletin boards. I was using eaccelerator for around 4 weeks now, and the performance from eaccelerator was quite good. But as eaccelerator doesn’t work with suphp, i converted my php caching system to Xcache. Now i can see, Xcache works the best. It reducing a forum load with around 150 users online to 3.5% cpu
While it was taking over 10% cpu a few hours ago. I have to say, xcache works perfect for forums. Though, i haven’t got enough profit for wordpress blogs by using xcache. I have seen a plugin for wordpress where it says, xcache cant prove the highest on general wordpress installations. Some caching objects needs to pass and wordpress needs to be made on a way so that it uses the xcache on its best. I m still testing this module and expecting a great result ![]()
02 8th, 2008
Today, i was forced to conver the php mode to suphp from dso. Generally php runs as the apache processes. While apache runs as nobody, thats why all the php files are run as nobody too. Yesterday night, i got a huge ddos attack on the server running from the user nobody. So i wasn’t able to track who is doing the stuffs and whats wrong with it actually. Later on i found that, one of the video site hosted is being used to spam the server. One of my primary concern regarding suphp was, it doesn’t allow users chmod 777 their files. I have seen, there are some scripts which needs 777 permission to run perfectly. I have one thing in mind that convering those files to nobody user, so that a 755 chmod does the same like 777. Though, i m still working on the issue to fix it up. But, i have to say, for a shared hosting server, suphp is quite good, just need to some tweak to fix its problems ![]()
02 6th, 2008
After upgrading my linux kernel to 2.6, i saw the basic apf is not working with it. While starting apf it says the following:
1 | Unable to load iptables module (ipt_state), aborting |
It happens due to the ipt_state has been changed to xt_state on the new linux kernel. To fix this problem, just edit the following file:
1 | /etc/apf/internals/functions.apf |
FIND:
1 2 | ml ipt_state 1 ml ipt_multiport 1 |
REPLACE TO:
1 2 | ml xt_state ml xt_multiport |
Now start the apf:
1 | service apf start |
or
1 | apf -s |
I have seen, lots of my customers see the 2002 phpmyadmin error while connecting from cpanel. After some small researches, i found this that, phpmyadmin by default tries to connect via tcp. And if you have query cache enabled, then for cache buffering it wont allow new tcp connections. So the best way to solve this problem is by resetting tcp connection into direct socket connection. A general Cpanel server can get fixed by following the steps written below:
Login as root and edit /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php. To do this, do the following;
1 | nano /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php |
Find
1 | $cfg[’Servers’][$i][’socket’] = ”; |
Change this settings to:
1 | $cfg[’Servers’][$i][’socket’] = ‘/var/lib/mysql/mysql.sock’; |
On the next line also change the following settings:
1 | $cfg[’Servers’][$i][’connect_type’] = ‘tcp’; |
To
1 | $cfg[’Servers’][$i][’connect_type’] = ’socket’; |
Have a nice reading
and work tight :p
02 6th, 2008
Today was the toughest day in my system administration life
After awaking up from bed, got around 14 tickets saying, my mysql database isn’t working, having problem with phpmyadmin (#2002 error). First time i thought it was happened due to query cache. But later on, after some investigation i found that, this is happening due to the temporary directory. Though, i wasn’t too sure about this, as there were two problems occuring. One, mysql databases wasn’t showing in cpanel and secondly, Mysql databases was giving the temporary file creation errors. As i was using a custom location for the temporary directory, so i immediately changed the location to default /var/tmp and changed the ownership to nobdoy with the group nobody. It fixed the mysql database access problem, though it didn’t fix the cpanel issue. Cpanel was still not showing the databases.
So after doing some small research over mysql behaviour i found that, the socket file needs to be symlinked from temporary directory to the original mysql.sock file which is usually located /var/lib/mysql/mysql.sock in cpanel servers. I have immediately run /scripts/mysqlup –force from shell to re-install mysql database server and create the socket file on temporary directory. But as i was using the old temporary directory configuration, so it created a socket file under /root/tmp, and i dont know why, for some reason last night, somehow my root directory got deleted. I do believe it was due to a lack of security ensurance from myself, as i changed the ownership of root directory with its subdirectories to nobody user. And most probably one of my client fucked it up by running php exec on the server
Though, on the next attempt, i have just edited the my.cnf file and changed the location of temp directory to /var/tmp and ran /scripts/mysqlup –force, and as you can expect, it fixed my problem
Though, its looking too simple to fix it, but it took around 3 hours for me to find the reason why it really got screwed up
Have a reading :D, and i dont expect you to face the same i faced today