Filed Under (Web) by jc on 25-03-2008
I was looking into a solution for a customer and mod_vhost_alias came in handy.
Lets say you want to host blogs for several people and you want to host them on the following subdomain format: blogname.crazyblogs.com. Instead of having a separate virtual host for each one, you can do something like this:
<VirtualHost 123.111.222.123:80>
UseCanonicalName Off
VirtualDocumentRoot /var/www/%0/htdocs
ServerName *.crazyblogs.com
</VirtualHost>
Now, if you go to http://blog1.crazyblogs.com, it will look for a index file inside /var/www/blog1.crazyblogs.com/htdocs.
You can find further information on:
http://httpd.apache.org/docs/2.0/vhosts/mass.html#simple
http://httpd.apache.org/docs/2.0/mod/mod_vhost_alias.html
Filed Under (Databases) by jc on 13-03-2008
This week I had a customer ask me if MySQL or the file system on his server had a 4GB file limitation because he was getting a ‘table full’ type error on one of his large tables. I found posts ab out it everywhere on Google, including MySQL website (http://dev.mysql.com/doc/refman/5.0/en/full-table.html) but I am blogging it anyway.
Apparently it is just an easily fixable file pointer limitation with MySQL 4.x.
Here is the fix:
alter table_name MAX_ROWS = 10000000; (this can take a while)
To fix it for new tables, add this to you /etc/my.cnf:
myisam_data_pointer_size=6
This will allow tables to have up to a 256TB size limit. The default value is 4 which allows up to 4GB.
Filed Under (Crazyness) by jc on 11-03-2008
Alright. I really want to test FreeBSD 7 but I refuse to download 3 CD images instead of one DVD image. But they do not have it available in their mirrors.
I find it very funny they have this at their page:
” There are many options for installing FreeBSD, including installation from CD-ROM, DVD, floppy disk, an MS-DOS® partition, magnetic tape, anonymous FTP, and NFS. Please read through the installation guide before downloading the entire FreeBSD distribution.”
Anyway, no DVD ISO! Maybe I will just install it over NFS! (who da heck installs an OS from magnetic tape? or 2 thousand floppies?)
That’s my bitchin for the day.
–JC
PS: I still love you FreeBSD.
Filed Under (Crazyness) by jc on 10-03-2008
I was reading this article on debiantutorials.org (http://www.debiantutorials.org/content/view/224/1/) and I thought it was pretty interesting.
He makes some good points (and some silly ones :]) on how to rescue her from the evils of Micro$oft. The real secret is to make it simple and functional. He used a Debian box, replaced some of her Windows programs with web applications, and what he could not replace, he just distracted her with some silly games!
My only question is: “How do you make you grandmother switch to Linux?” Can you do it yourself or does your mom have to do it?
More power to open source software,
JC
Prerouting can be very useful if you need a quick fix and do not want to mess with the application itself. For example, if you need to have your MTA listen on port 587 and do not want to alter the configuration files (the daemon will not actually listen on port 587, iptables will redirect the traffic), you can use the following iptables rule to preroute traffic going to port 587 to port 25.
/sbin/iptables -t nat -I PREROUTING -p tcp --dport 587 -j REDIRECT --to-ports 25