The following command can be used to repair and optimize all tables in a MySQL database. This can be useful on a busy server with many tables after a hard reboot or otherwise unclean shutdown.
mysqlcheck -u root -p --auto-repair --optimize --all-databases
When switching from DSO to SUPHP in cpanel (a must for anyone who takes security seriously on a public webserver), one must pay careful attention to the insecure permissions of user’s public_html folders. The following commands will look in every user’s html folder and make the appropriate CHMOD to allow php to properly execute under SUPHP. Don’t forget to also check for files owned by ‘nobody’ or ‘root’ — they will also fail with a 500 error.
find /home/*/public_html/ -type d -print0 | xargs -0 chmod 0755 # For directories
find /home/*/public_html/ -type f -not -name "*.pl" -not -name "*.cgi" -not -name "*.sh" -print0 | xargs -0 chmod 0644 # For files
find /home/*/public_html/ -type f -name "*.cgi" -print0 -o -name "*.pl" -print0 -o -name "*.sh" -print0 | xargs -0 chmod 0755 # For CGI/Scripts
UPDATE: Part 2 – Fixing Ownership
UPDATE: File permission command updated to exclude Perl/CGI. These still need to be 755 (not 644).
UPDATE: Exclude files in 644, add another for scripts/cgi. These still need to be 755 (not 644).
Work getting you down? Do what I do and listen to some internet radio without any commercials. One of the better sites I’ve come across is myfreenetradio.com
The following command can be used to create a .tar.gz archive, commonly referred to as a ‘tarball’ file.
tar -pczf name_of_your_archive.tar.gz file1 file2 directory1 directory2 ect...
I am tired of searching for ‘csf download’ in popular search engines and getting results that are either imposters or have nothing to do with ConfigServer’s CSF Firewall software. Well, here it is, a direct link:
CSF Download (Right click and Save As…)
You can read more about CSF Firewall and ConfigServer at:
We have a unique setup at my work. All of the webhosting appliances have built in spam-filtering software. However, we have external spam-filtering appliances that are 99% more effective. It makes sense to keep CPU intensive spam filtering off of the webhosting servers which should be focusing their efforts on serving up PHP and MySQL queries.
It seems spammers are getting more and more savvy (or should I say desperate?) and have developed several means to bypass spam-filters. One of those which seems to be getting more popular lately, is to completely ignore a domain’s MX records and deliver spam directly to the website’s IP address. For most virtual hosting and some dedicated hosting setups using an external or 3rd party spam-filtering service, this can be quite effective. Lately it has been plaguiing several of our clients who are reporting an increase in spam, but cannot find copies of it in the spam filter interface.
To make a long story short, I was able to coerce Exim into rejecting these direct delivery attempts.
Log into WHM and click “Exim Configuration Editor”
Then click “Advanced Editor”
Add the following to the empty box at the top:
domainlist relay_domains = lsearch;/etc/secondarymx
Now we need to tell Exim to be nice to our spam-filtering appliances (don’t reject the clean mail coming in from them) by adding a list of their IPs in to /etc/alwaysrelay.
Restart Exim, done!
So this issue has been plaguing some customers ever since I started migrating sites from older Ensim boxes to new Cpanel servers. It seems 50% of the email users (or more, haven’t heard from everyone yet) is getting authentication errors on their outbound mail – even in Webmail. So the first solution I’ve been telling people for the past few weeks is to remove then re-add the email account in Cpanel. It works…but it’s like using an axe instead of a scalpel. For those who rely solely on webmail, this cannot be done as all their email would be lost.
So I happened along this thread.
The problem ended up being the permissions of everyone’s /home/<user>/etc/<domain>/shadow files. For some reason the Ensim migration script leaves them as 0600 when they need to be 0640. This single command fixed all 300+ domains in one fell swoop:
chmod 640 /home/*/etc/*/shadow
So rather than use a single axe, I took 300+ scalpels at once the problem.
I just added an image gallery to the site. There aren’t any pics yet but hopefully I’ll get around to adding some.
So I spend nearly half of an otherwise productive day fighting dependency hell with LiquidSoap. I haven’t tested it yet but here’s a cleaned up and organized command history of how it happened:
## Liquid soap install
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
yum install automake pkgconfig ncurses ncurses-devel ocaml ocaml-camlp4 ocaml-labltk libtheora libtheora-devel libao libao-devel /
portaudio portaudio-devel alsa-lib alsa-lib-devel glib2-devel avahi avahi-devel /
libmad libmad-devel taglib taglib-devel lame lame-devel faac faac-devel faad2 faad2-devel /
ladspa ladspa-devel soundtouch soundtouch-devel doxygen
rpm -ivh *.rpm
### Misc audio stuff, libshout, ect
### Compile libshout/speex from source because packaged version of speex is too old for liquidsoap.
tar -zxf speex-1.2rc1.tar.gz
tar -zxf libshout-2.2.2.tar.gz
tar -jxf jack-1.9.2.tar.bz2
tar -zxf gavl-1.1.0.tar.gz
### OCAML stuff
tar -zxf pcre-7.6.tar.gz
tar -zxf ocaml-ladspa-0.1.1.tar.gz
tar -zxf ocamlnet-2.2.9.tar.gz
tar -zxf xml-light-2.2+findlib.tar.gz
echo /usr/local/lib >> /etc/ld.so.conf
tar -zxf liquidsoap-full-0.9.0.tar.gz
So it’s been raining for like 8 days straight here in Maryland. Is it ever going to stop? Is Noah on his way just in case my house floats away? I should have bought that flood insurance…