Archive for the 'Linux' Category

Multi-Domain Linux Mail Server

Linux, Software, Technical No Comments »

Over the last few weeks, I’ve done a lot of blogging on my new provider, Slicehost, and the steps I’m taking to move away from Windows Server hosting to the Linux platform, at least for my personal sites and client development.  I still have to use some Microsoft technologies at my day job, but I am even in the queue to switch to Linux on my workstation at work too as new machines get ordered.  I plan on running XP in a VM for necessary things on the new workstation.

Well, so far with Slicehost, I’m now up to 3 Slices.  The 512mb one for the websites, a 256mb for development which will turn into another webserver once the 512 is “full”, and now a new 256mb one as a mail server.  I found a good tutorial on how to setup Postfix, Courier, MySQL & Squirrelmail with Spam Assassin and ClamAV in a multi-domain virtualized setup. (LINK)

This took a few hours to get working as intended, there were a few minor details missing, but I was able to track them down and get it working.  Most of it was just copying and pasting commands and changing a few details to my configuration.

The only part I really changed during this installation is NOT to use Spam Assassin and ClamAV, at least for the near term.  Both of these programs take up large amounts of RAM even with the base setup.  With the 256mb Slice, it was going into the swap memory as soon as I booted up and accessed anything.  Without these programs and with a bit of Apache tweaking, I got the memory down to around 116mb while idle.

Also, instead of SquirrelMail, which is “ugly” compared to modern web interfaces, I chose Roundcube, which has really gotten better over the last year.  It is still simplistic, but is very nice and functional.  With my setup, any email user just logs into the Roundcube interface with their email address and password.

Since all the usernames/passwords for this mail server are stored in the database, I was able to quickly write up a little PHP web interface to add/remove/modify email accounts and domains.  Once it is more stable to functional, I will release it here on this blog for others who have a similar setup.

As a test, I’ve been forwarding all my email on my primary account to a test account on this new server and every email has been received properly.  No problems whatsoever.

I plan on moving a few of my friends and family onto this to see how it works for them, if good, then all my customers will be migrated.

Moving away from Windows & IIS (ASP) to Linux @ SliceHost

General, Software, Technical, Technology, Ubuntu 2 Comments »

I have, for years, been developing web apps and so on using ASP (Classic) on IIS.  It’s a “fine” platform, but I have, over time, become weary of the Microsoft bloat that accompanies running a Windows Server… Especially in a colo/dedicated/VPS environment.

Over the last few months, since my major GoDaddy Windows Dedicated servers got hit by a worm or something, I’ve seriously started learning PHP with MySQL.  I used MySQL quite a bit with ASP and am quite familiar with it, but PHP experience was rather limited.  In the last few weeks, I’ve written a few things and ported a customer’s website over from an ASP CMS I wrote to PHP (still need to finish the CMS in PHP).  The site runs so much faster and I am now able to host it on my new Slice VPS that I setup earlier this month.  In 15 minutes or so, I can have an entire new Slice setup with Apache or Lighttpd and PHP/MySQL and, with a little tweaking and securing, have a server up and serving sites.   Can’t do that with Windows that quickly.

Slice is still running strong and I’m going to do my best to get ALL my ASP sites “ported” over to PHP over the next few months.  I’ve been using ASP/PHP cross reference sites like Design 215 and a few others and have been able to do things very quickly.  The database part was the only part I really needed to find good samples  for, but they aren’t even too hard once you use them a few times.

SliceHost has inspired me to really learn Linux and abandon the Microsoft OS, but there is still one caveat to Linux that I am very disappointed with.  There is not a single (that I’ve found), reasonably priced, multi-domain, domain level administratable email server with a nice webmail interface for users and administrative functions.

I know there are a ton of “pieces” that I can put together to get something like that, like Postfix, EXIM4, Dovecat, etc., but I just simply don’t have the time to wade through the massive pile of config files to get all those pieces working together in a nice secure and highly reliable fashion.

So, I am going to continue moving all my websites over to Linux/Apache/Lighttpd/PHP/MySQL and keep a small (30gb, 768mb RAM) Windows Virtual Dedicated server running with SmarterMail 5.x mail server on it. SmarterMail is probably one of the BEST email servers for a web hosting environment.  It is a snap to setup, backup and move to a new server if needed (Trust me, I know!). I already own an Enterprise license and am just waiting for one last very important domain to move off a temporary dedicated server before I move it to a new Windows VPS to serve the remainder of my customer’s email needs.  SliceHost isn’t a fully “managed” solution, but with the Slice Backup capability, you can have daily and weekly images made and restore to them quickly at anytime in case anything happens…

Mosso is good and is finally rectifying the Compute Cycle issue I mentioned previously,  I may keep them if I can break even with the few sites I still host on there, but their servers aren’t nearly as responsive as a VPS or Dedicated server probably due to the massively clustered setup they run.  I don’t really need individual site scalability… If a site has high requirements, I’ll just stick them on a new slice and charge the customer accordingly.  Most of my sites that would need to scale are Wordpress Blogs and could easily handle being Digg’ed etc, by installing WP-Supercache.

Ultimately I plan on hosting all websites and blogs on Ubuntu 8.04 @ SliceHost and email on a Windows VPS @ GoDaddy (for now) until I find a Windows VPS provider as excellent as SliceHost is (hint hint to SliceHost)…

That’s all for now…

If anyone knows of any turn-key type mail servers that are free/inexpensive (< $500) for Linux please leave a comment.

My New Provider… SliceHost.com!

Cool Stuff, Linux, Review, Software, Technical, Technology, Ubuntu, Web, Wordpress 6 Comments »

I’ve been moving my blogs and the other’s I host through a lot of transitions lately after having a HORRIBLE experience with GoDaddy and then Compute Cycle concerns with Mosso.com.

Mosso’s new compute cycles are heavily counting Wordpress and other DB driven site hits.  5 relatively low hit blogs, ~150,000 TOTAL hits, were taking up as many Compute Cycles as one of my non-DB driven sites getting > 2,500,000 hits with lots of graphics.

I still like Mosso and most of my sites are still using email on them, but a bit more predictable monthly bill is nice.

So I happened to run across SliceHost.com yesterday… The site is simple and clean and I was impressed at the speed of their own website. Some of the hosting providers I find while searching around have sluggish sites, which really makes me question their server/network capacity and so on.

Here is their basic blurbage from the front page of their site.

BUILT FOR DEVELOPERS

We’re just like you. Sick of oversold, underperforming, ancient hosting companies. We took matters into our own hands. We built a hosting company for people who know their stuff. Give us a box, give us bandwidth, give us performance and we get to work. Fast machines, RAID-10 drives, Tier-1 bandwidth and root access. Managed with a customized Xen VPS backend to ensure that your resources are protected and guaranteed.

  • No contracts, no setup fees.
  • Upgrade, downgrade, add a slice or remove a slice anytime.
  • Billing is monthly, cancel at anytime.
  • Payments of $240 or more receive a 10% credit.
  • Full root access and rebooting
  • Choice of Linux distro
  • Dedicated IP address and Tier-1 redundant bandwidth
  • RAID-10 disk storage
  • Reserved RAM
  • Guaranteed CPU share and more when available
  • 4-core servers running Xen virtualization instances
  • Slicehost management portal for reboots and software installs
  • Mobile management portal for smartphones
  • Ajax console access
  • Bootable rescue mode
  • Machines running with fixed usage limits, below full capacity

So I decided to go ahead and give them a try and signed up for a 256mb Ubuntu 8.04 Hardy “Slice”.  That slice is a virtual machine running on a nice large powerful server.  For $20/mo I get a VM with 256 RAM, 10GB space, 100GB bandwidth.

Some may think that’s so little, but it’s plenty to run a quite a large handful of decent sized Wordpress blogs or other similiar CMS systems.  10gb is plenty for people who aren’t uploading massive uncompressed images, videos and other media.  100gb is also good especially if your web server is using mod_deflate to compress output.

Provisioning only took like 5 minutes, it was assigned a static IP and a default (hard) random root password that I went in and changed to my harder password.

I ran the apt-get install commands I used to get the lighttpd setup running on it like in my post back in April.

Basically in about 30 mins I was setup, I went ahead and moved over idude.org here and then 5 of my other friend’s blogs and am in a “testing phase” now.

Back to SliceHost…

I really like their control panel, it is very simple and sweet and has pretty much everything you need to manage your VMs.  The backup is very simple and can be automated to daily as well as a weekly. These backups are FULL VM snapshots to take your entire machine back to a previous state.

A Unique feature is an AJAX powered console to your server.  I don’t think it really full supports CTRL functions and stuff, but it’s enough to change some permissions, delete some stuff, create new folders, etc.

If you outgrow the 256mb/10gb/100gb Slice, you can scale it up, without losing data and minimal downtime, up to a 4096mb/160gb/1600gb Slice, which is 16x the power/space at only 14x the cost.  ($280)

There are also nice stats to show CPU use, CPU time, disk I/O, and network I/O.    You can do soft/hard reboots as well plus much more.

A few months ago, I had a VM of about the same size at GoDaddy running CENTOS 4 (only Linux option at the time) and it was horribly sluggish and had all kinds of “default” crap on it.  This Ubuntu install on SliceHost is virtually a base install allowing me much more flexibility over what goes on it.

The performance of it was also generally lightning fast.  I’ve used Ubuntu directly on a powerful server and it appeared just as responsive both in the console running commands and hitting the sites remotely.

Network speed was excellent as well… Got 16mbps uploading some files to it, which again, isn’t bad for a VM.

One last thing.  SliceHost is running out of St. Louis.  After pinging it from a web-based “multiping” site, it got excellent low latency from all parts of the country, as compared to hosts I’ve used on either the left or east coast, due to it’s central location.

More updates will follow as more is experienced.  I think I’ve finally found a long term home for my Linux sites.

If you are interested in signing up, click here!

Clark Connect Community Edition as a Gateway

Controversy, Cool Stuff, Humor, Linux, Review, Software, Technical, Technology No Comments »

I’ve always have used simple WiFi routers to be the “first device” connected to my network here at home.  Over the last year or two, I have been experimenting with SveaSoft Talisman Opensource Router Firmware, on my Buffalo WHR-HP-G54, as well as DD-WRT.  DD-WRT has been my favorite and seems the easiest to use firmware with the slickest interface.

But it just didn’t feel like “enough” protection.

Enter Clark Connect Community Edition 4.2

Clark Connect Community Edition, CCCE for simplification, is the free edition of this OS.  It is a Linux firewall based on Red Hat Linux and contains many excellent features to protect your network and give you services that only much more expensive solutions offer.

I grabbed one of my “old” Dell servers, an SC430 Dual Core machine that I’ve used for reviews here in the past and started install of the ISO I burned (~487mb).  To utilize the firewall “gateway” mode of the OS, I installed a second old 100mb NIC card to be the external WAN side and kept the faster GB NIC for “internal” use.

Installation was a breeze, as most are these days, and within 20-25 minutes, I had the core system up and running.  It took a little bit of configuration to get both cards recognized and to get my cable modem provider to reset the ARP table (by rebooting the cable modem) for the external WAN side to kick in.  I just put a ping from a commandline on the gateway and watched it.

Pings were replied to…

The console interface is limited and mostly allows you to do simple things like configure NICS, view a traffic monitor (IPTraf) and other minor things.  There is a relatively new “graphical” GUI that lets you see some more, but it is still mostly limited.

The best way to configure the gateway is by logging into the web interface.  The web interface can be accessed by the URL https://yourgwIP:81 and entering the root password you chose during installation.  Once in, virtually every feature can be configured, services started/stopped and a full statistical interface can be seen.  More stuff can be installed/configured from the commandline via SSH or direct console access.

As stated above, in my network, this CCCE gateway replaced my DD-WRT WiFi router as the “first device” connected to the internet.  I then plugged the internal LAN NIC into a 24 port gigabit switch and connected my nearby workstations to it.  For my “remote” WiFi devices like my Laptops and iDudette’s Mac Mini, I reconfigured the DD-WRT router to be an internal device on the network.

The CCCE machine become the primary DHCP server on the network and the DD-WRT provides a seperate subnet that is not routable directly to the CCCE. I may change this in the future to make sharing a bit easier between the two networks.

I also run a 4 node Meraki network directly off the CCCE gateway and now I can better control the bandwidth and service usage of possibly “unknown” people to limit torrenting and other “illegal” activities.

There is so much more I can say, but you gotta see it for yourself.  This is the simplest of all the linux firewalls I’ve tinkered around with, even those who aren’t familiar with all these things should be able to figure it out.

Clark Connect also has a subscription level which will give you more features within the gateway, like Exchange Connectors and so on, and online DNS and other services.  See their website for more.

Here is the feature list from the site.

ClarkConnect provides all the necessary software and tools required for an organization’s server needs.  The details of the following features are described below:

Gateway and DNS Services
To complement the ClarkConnect feature set, we offer a suite of services to help deploy, manage and maintain a ClarkConnect system:

* Gateway Services
* DNS Services

Firewall, Networking and Security
ClarkConnect provides several levels of security.  At the network level, the firewall restricts access to your systems and provides advanced features, including DMZ, 1-to-1 NAT and Port Forwarding.  At the protocol level, the Peer-to-Peer detection system lets you manage peer-to-peer file sharing usage.  At the application level, the Intrusion Detection and Intrusion Prevention systems provide another layer of defense against threats to your network.

Multi-WAN
With the Multi-WAN solution, you can connect two or more Internet connections to your ClarkConnect system.  The solution not only increases your available bandwidth, but also provides automatic network failover.

Bandwidth Management
Some applications are more important than others.  The Bandwidth Manager lets you prioritize network traffic — downloading the latest Windows updates will no longer interfere with your Voice-over-IP (VoIP) calls.

1-to-1 NAT - DMZ - Peer-to-Peer Management - Intrusion Detection - Intrusion Prevention - Multi-WAN / Dual WAN  - Bandwidth Management - DHCP Server - Caching DNS Server

VPN / Virtual Private Networks
With the PPTP VPN solution, you can use the built-in VPN client that comes with Microsoft Windows to connect remote desktops and laptops to your network.  There’s no need to purchase and install expensive third party software — the PPTP VPN solution works right out of the box.

VPN - Connecting Local Area Networks
If you need to securely connect two or more networks via the Internet, using our unique Managed/Dynamic VPN fits the bill.  The VPN solution not only makes connecting remote networks easy, but also more reliable.  This solution is based on the standard IPsec VPN protocol, so you can count on industry standard encryption and authentication technologies.

Web Proxy and Filtering
The Web Proxy server reduces bandwidth usage and speeds up web browsing.  In addition, the proxy can be configured with user authentication.  With authentication enabled, you can control and monitor access to the web.

Content Filter
Whether you are concerned about students accessing pornography or employees checking their personal webmail during office hours, the Content Filter provides a flexible way to enforce web usage policies for your network.

Banner Ad and Pop-up Blocker
If you find that banner ads and pop-ups are slowing down your network, you can enable the Banner Ad and Pop-Up Blocker to speed up web page loading times.

E-mail
ClarkConnect has integrated the same scalable and reliable POP/IMAP and SMTP servers used by large organizations.  Thanks to the open-source revolution, it is possible for a small business to enjoy an enterprise class e-mail system.

Webmail, Outlook and More
End users can access their e-mail using any number of standard e-mail clients.  Though Microsoft Outlook is the most popular way to access mail on a ClarkConnect server, you can also use the built-in Webmail module and other popular e-mail software packages.

Multiple Antispam Engines
Our server solution provides several different antispam techniques to maximize the spam detection effectiveness.  The antispam engines include the SpamAssassin, Dspam and Greylisting.

Affordable Antivirus Protection
Expensive antivirus solutions are a thing of the past.  The Antivirus solution not only detects viruses, but also phishing attempts.  In addition, both antispam and antivirus scanning can be configured in Mail Gateway Mode so you can protect existing mail servers (including Microsoft Exchange) on your network.

Groupware
The suite of groupware features allows your organization to share and manage information.  With the Microsoft Outlook connector, you can share Calendars, Contacts, Tasks Lists and Notes.  Whether you need a company calendar or a sales contact list for a few members of your staff, sharing information is simple and affordable.

Flexshare
The powerful Flexshare feature allows people in your organization to share files and helps bring out the value of of all the information in your organization.

Database and Web Server
Do you need to install a web-based application on your network?  ClarkConnect provides the LAMP application engine with easy-to-use web-based administration tools:

* Linux
* Apache Web Server
* MySQL Database
* PHP

File and Print Services
The ClarkConnect solution provides both an FTP and Windows/Samba file server solution.  These two file server modules coupled with Flexshare Groupware gives you a powerful tool for sharing files in your organization.

Backup, Backup, Backup
There are two kinds of people — those who have lost important data, and those who will lose important data.  Backup is often overlooked, but it is one of the most important tasks for any organization.  The comprehensive LAN Backup and Recovery solution provides all the necessary tools to protect against disasters.

My first look at Ubuntu 8.04 LTS as a Desktop and Server

Cool Stuff, Linux, Microsoft, Software, Technology, Ubuntu, Uncategorized, Wordpress 2 Comments »

Last week, after much waiting by myself, Ubuntu 8.04 LTS came out. Before the release, I didn’t have the time to really mess around much with the BETAs or the last Release Candidate, but the morning it was released, torrenting commenced and went to work.

Got home, burned it to a CD and installed it on my primary Windows workstation (running Vista) using the Wubi Installer.

For those of you not familiar with Wubi, here is the blurb from their website:

“Wubi is an officially supported Ubuntu installer for Windows users that can bring you to the Linux world with a single click. Wubi allows you to install and uninstall Ubuntu as any other Windows application, in a simple and safe way. Are you curious about Linux and Ubuntu? Trying them out has never been easier!”

So basically, you can install Ubuntu into C:\ubuntu then when rebooting your machine, you will have another option to boot to besides Windows… The Wubi Installer by default only created a 12gb “container” for the Ubuntu installation. If you plan on actively using Ubuntu under Wubi, make it as large as you can do without, space wise, in Windows. It can get a bit geeky to add more space to the Wubi side after the fact. I didn’t realize it at the time and went with the 12gb, but then I wanted to run XP inside a Virtual Machine, which didn’t leave me much space left. I ended up Googling around and found a method to create a second Wubi disk and copy over your /home/ folder to it and changing your fstab to use it. So I had the 12gb for system stuff and another separate 25gb /home/ disk image.

The best thing about Wubi is that it allows you to test out Ubuntu on your machine without wiping out anything, no re-partitioning, no real impact on your system at all. You do take a slight performance hit since you are running this off a file on the NTFS file system, but the hit isn’t anywhere near as much as running it from VMWare, which doesn’t help if you are looking to see if Ubuntu is truly compatible with your hardware.

First Install as Desktop

Here are my basic system specs of my first install:

Lenovo something…
AMD 64 X2 3800+
2048mb RAM
250gb HDD
nVidia GeForce 8600GT XFX XXX w/ 256mb RAM
22″ Samsung wide screen @ 1680×1050
19″ Samsung @ 1280×1024

The installation was a breeze and all I had to do was set my network information to get online (I don’t use DHCP on my router).

The nVidia “restricted” driver took a few minutes to download and install due to the mass deluge of downloaders hitting Ubuntu’s (and mirror) servers. Response time for all APT-GET queries were a bit slow over the weekend. It calmed down some on Sunday and I was able to get things done quickly.

Setting up the Beryl/XGL effects were easy once the aforementioned driver was enabled, but Ubuntu leaves out the “advanced” configuration options for the effects. Again, googling around, I was able to find the “apt-get” commands to get those utilities installed.

Probably the longest thing to get working was the true dual display.

Just after installing Ubuntu, both monitors had the same output. After installing the nVidia drivers, the secondary screen dropped out, but there was no explanation for it and no setting in the display properties would bring it back. Googling mentioned a program called “nvidia-settings” which I ran and after much tinkering was able to get a solid xorg.conf created to have the 22″ monitor primary and the 19″ as a secondary span to the first.

Needing to work a lot in the Windows world, I keep a Raw XP VM Machine around that is patched (mostly) and ready to unzip and load to install the few Windows based utilities I need like Adobe Photoshop (doesn’t work well under Wine) and Microsoft Expressions/Visual Studio. Installing VMWare Player took a bit of hacking around, but installed fine. I used the secondary monitor to full screen XP while keeping Ubuntu on the primary.

Overall, things are MUCH better under 8.04 than any of the previous Ubuntus in my opinion. Googling around for things was key for me. Be sure to include “8.04″ in your search queries to limit the number of older pages from being returned. Some of those instructions are way out of date with 8.04.

Later this week, I am going to try my “dad test” on Ubuntu to see if he can handle it, I did install it on his machine, but had trouble getting his Wireless to connect to one of my many access points (He lives across the street with a WiFi repeater in his office). I think the driver is just flaky.

Might end up just putting an Ethernet bridge on his PC so it’ll just use his ethernet port which looked fine.

Second Install as Server

System Specs:
Dell SC430 Server
Intel Pentium D Dual Core 2.8ghz
1gb RAM
160gb SATA HDD
Integrated Video
17″ Viewsonic LCD

As has been usual with the later Ubuntu builds, Installation was a breeze. This time, I wiped out the parition completely and installed it directly on the box which made it very fast compared to the Wubi install above, which isn’t bad to begin with.

For this installation, I was more server focused, but did not install the “server” version of Ubuntu. I opted to use the same “desktop” version and install all the packages I needed to make it a “server”.

Doing a lot of Wordpress Installations, I chose to get a Virtual host WP environment setup.

I’ve been hearing a lot of good about LighttpD lately and decided to apt-get that instead of Apache2.

LighttpD is a VERY fast alternative to Apache2 (up to 50% faster in some cases). Setting it up was as easy as “apt-get install lighttpd” (After removing Apache2).

# apt-get remove apache2.2-common
# apt-get install lighttpd mysql-server php5-cgi php5-mysql

I also grabbed PHP-CGI and did a little tweaking to get lighttpd to parse the PHP files using FastCGI which was not difficult.

# lighty-enable-mod fastcgi

Had to edit the /etc/lighttpd/conf-enabled/10-fastcgi.conf to get my paths correct.

Googling around gave me the conf file lines I needed for the Virtual host config:

For a single hostname like yourdomain.com

$HTTP["host"] == “yourdomain.com” {
server.document-root = “/your/www/path”
}

for anything.yourdomain.com use this…

$HTTP["host"] =~ “(^|\.)yourdomain\.com$” {
server.document-root = “/your/www/path”
}

Put as many as you need in there. I used a spare domain and pointed *.MyDomain.com over to it and setup a few virtual hosts to test them.

Restart Lighttpd using:

/etc/init.d/lighttpd force-reload

I had a LLMP (Linux, Lighttpd, MySQL, PHP) server setup and ready to go.

Download the latest WP files:

curl http://wordpress.org/latest.tar.gz -o latest.tar.gz

Uncompress them to the virt root of your choice and be sure to chmod the folders correctly so WP can run the setup and create the wp-config.php file.

To make Permalinks (friendly URLs) work, just add this into the lighttpd.conf before (or within) the virtual host directives…

server.error-handler-404 = "/index.php"

This will allow the permalinks to work correctly, mod_rewrite rules are not necessary.

There may be a little more to all this than the above instructions, depending on your configuration. The information provided was to just provide basic guidance.

My plans are to eventually backup all the WP blogs on host on my dedicated server and curl them over to this Ubuntu box, uncompress them, drop and restore the databases and have a mirror of them offsite from the dedicated server in case anything ever happens. This should be easiest enough to do in a few hours in one script file on the server to do the backups and database dumps into one compressed file, then another cron’ed script on the local Ubuntu to curl it down and restore everything. If anything ever goes wrong, just change the DNS for the domains and point them to my local Ubuntu which can be DMZed on my router. :-)

An iPhone Powered Apache Web Server with PHP

Apple, Cell Phones, Cool Stuff, Gadgets, Linux, Software, Technical, Technology 16 Comments »
iphone4b.jpg
iphone4b.jpg
Over the last month or so that I’ve had the iPhone, I have enjoyed just the original base features included with it. But, being the geek that I am, I had to extend it further… Much further.

A week or so ago, I went ahead and decided to do my “first” hacking of the iPhone. I went to the JailBreakMe.com website and followed the simple instructions and the Installer.app which is basically a “one touch” utility to install 3rd party apps and Linux ports such as PICO and a terminal program.

I was a bit surprised to find a port of Apache 1.3.37 and PHP 5.2.3 in the repository, so I went ahead, installed them both and with a little configuration using PICO (after installing and logging in through SSH), got a functional webserver with PHP support.

I created a PHPINFO() page which shows the extensions that are activated by default, which are pretty much just the core PHP functions and started thinking what to do with it…

Of course I could use it for impromptu testing of code from anywhere, showing simple mockups offline to clients one-on-one, and other things like that, but it wasn’t enough for me…

I put the thoughts on the backburner for a few days, last night I figured I’d try something new.

Here goes…

Apache/PHP was working so I decided to go ahead and copy a full PHP site with full graphics and a PHPMail script on it.

To get this all over to the phone, I TARred up just the most necessary files, filtering out anything not directly referenced (limited amount of memory on the phone for this type of stuff).

Then I FTP’ed, using NCFTP installed from the Installer.App repository, into the machine that had the TAR, downloaded and unTARred it into Apache’s document folder (/Library/WebServer/Documents).

At that point, once all the files were in the correct place and so forth, I hit the website directly on the phone (http://127.0.0.1) and it came right up and was rather speedy. I then hit it from a workstation on the same WiFi network using the DHCP assigned IP and it came up perfectly.

Ok, so far so good, the website comes up just fine locally and remotely, lets take it a few steps further.

I decided to, from work today, to VPN using PPTP built into the iPhone into my DD-WRT router at home (It has a static IP) and then proceed to port forward port 80 from the external IP to the Internally assigned VPN IP of the iPhone. Then I proceed to add a DNS entry for it…

I also VPNed into the DD-WRT over EDGE and it worked just fine as well. Of course it was MUCH slower, but still worked fine.

It really was this easy to do something that I don’t think has ever been done before with a cellphone.

NOTE: Apache was setup to just start 1 httpd instance and I believe a max of 7, which slowed stuff down a lot with a graphical site, so I set it from 1 to 10.

If anyone has questions, feel free to leave a comment and I’ll reply as soon as I can.

iDude.org now on VMWare Server Virtual Machine

Cool Stuff, General, Linux, Software, Technical, Technology No Comments »
vmware.gif
vmware.gif
I decided to actually go all out and test to see how well my blog here would run on a virtual machine. I started by downloading VMWare Server (Free), and then grabbed a VMWare Appliance from their “Virtual Appliance Marketplace” that provides a nice, minimally sized LAMP server… I picked up one simply called “LAMP Server” from Virtual Appliances.

The whole process only took around 30 minutes, including the downloading of the software and migration of my blog.

I installed VMWare Server and rebooted, double clicked the LAMP Server appliance and started it and set it to a static IP I had laying around idle… I then changed all the default passwords and SSH’ed into it.

On the former iDude.org server, I tarred up the root, backed up the database and CURLed it all over to the Virtual LAMP server… Un-tarred the content, restored the MySQL Dump file, linked it all up and was done. Then finished it off by change the DNS to the new static IP.

Very simple and it seems to be working fine. The virtual machine is running under a Windows 2003 Server host using most of the available memory on the host. I could set it lower, but have no need to at the moment, the 2003 server is just a mostly idle secondary DNS server and isn’t doing much.

Innotek Virtualbox Virtualization Software

Cool Stuff, Linux, Microsoft, Software, Technical, Technology No Comments »
vbox_logo2_gradient.png
vbox_logo2_gradient.png
I recently ran across a “new” (to me) virtualization software that is very similar in function to VMWare workstation.

I downloaded Innotek’s Virtual Box software, which quickly and painlessly installed, seeming to be a little faster to install than VMWare and MUCH less bloated… The entire self-extracting install is only 13.3 mb. I restarted my XP (Media Center) laptop and created a virtual machine with 512mb RAM, 64mb Video memory (I don’t remember VMWare having this feature), and a 10gb Virtual HDD, which should be more than enough for a CDR of Xubuntu 7.04.

I am typing this from the Xubuntu installation right now. I just got done installing the “VBoxAdditions” which are basically contains the same enhancements that VMWare tools offer. It was also much simpler and easier to install in Linux than VMWare tools. After I reboot, they should become active.

So far, this Virtualization product seems very stable, and is free for personal and evaluation use. I didn’t see any pricing structure on the website for companies, but I’m sure it would be reasonable.

Automated Backup (dated) BASH script with cron execution

Cool Stuff, Linux, Software, Technical, Technology 1 Comment »
penguin.png
penguin.png
Linux isn’t as hard as it looks to do some cool things…

This server was down earlier today due to, I believe, a power outage.

Even though the server has pretty massive battery backups, I think the momentary kick over to battery might have caused it to poop out.

In any case, the server issues made me want to consider running some regular backups, but without using some packaged software or whatever, it could get complicated and annoying to run all the time.

So I decided to use some command-line tools to accomplish the task. I created a new script called “backup-www”. (Be sure to chmod it 755 so it’ll execute).

Each line is a separate single line in the BASH script.

#!/bin/bash

cd /var/

TheDate=$(date +%m-%d-%Y)

mysqldump –all-databases -h localhost -u root -ppassword >> /var/www/ALL-DB-$TheDate.sql
tar -cvvf ALL-WWW-$TheDate.tar www/

gzip ALL-WWW-$TheDate.tar

mv /var/ALL-WWW-$TheDate.tar.gz /var/www/idude.org

curl -T /var/www/idude.org/ALL-WWW-$TheDate.tar.gz -u username:password –URL ftp.TheFTPServer.com

Here is a brief description of what the above script is doing:

  • “cd /var”
  • Set Date Variable
  • Do a MySQL Dump of all my databases into the /var/www folder to be backed up in a next step
  • TAR up the entire WWW folder (recursively) under /var which contain my websites (all of them).
  • GZIP the TAR file I just created to save some space.
  • Move it to my webroot (personal preference, no necessary)
  • Then I CURLed the newly created gzipped tar file up to a different machine on the same network. Since the network here is gigabit, it takes less than a minute for me to upload the ~215mb file via CURL FTP upload. (Longer if you are using a remote server on the net)

Now, instead of manually running this script every day, I decided to look up cron jobs on WikiPedia and figure out how they work.

I proceeded to create a .crontab file called “backup-www.crontab”… I wanted to schedule this task to run every night at 11:50pm, so I entered the following information into the file.

50 23 * * * /var/backup-www

The “50″ is the minute, the 23 is military time for 11pm, * * * are for the other time increments. I only entered the pertinent ones then put the command I wanted to run… /var/backup-www

After saving the “backup-www.crontab” file, all you have to do to schedule it is type “crontab backup-www.crontab” and it the crond will run it every day at the specified time.

I then waited until just before 11:50pm and started watching the filesystem and remote FTP server for the activity and wa-la, It worked like a charm.

If this might seem a bit novel to you Linux gurus, remember, I’m a bit of a noob when it comes to these command line things.

My First Look at Ubuntu 7.04

Linux, Software, Technology 2 Comments »

I downloaded Ubuntu 7.04, the “Feisty Fawn” the other day, installed it on my spare 40gb drive, as usual, and booted it up.

Installation is a “Live CD” type install, it boots into the OS, therefore making sure it will boot on your system before wasting time to install it. If you successfully boot off the CD, you will then have the option of installing it to a hard drive.

I was successful, so I started the install. It took around 15 minutes on my AMD X64 3000+ machine with 2gb DDR SDRAM.

The must really say that I like the GNOME desktop manager, it overall hasn’t changed much, but the icons are smoother and it overall feels much more stable.

I took a few minutes to go download my favorite Mac OSX background image and set the GNOME theme to “Glossy” which is a bluish color scheme and The OS now looks just like I like it.

I just got done downloading the VMWare Player and Server for Linux and am going to fire up Windows XP SP2 to see how it works. I’d prefer to use Ubuntu on this machine and keep the VMWare Player for XP.

Also turned on the Compiz Desktop effects. They’re relatively subtle by default, but I’m sure there are more settings I can tweak. To use them, I had to install the nVidia driver for my 6200 OC and even that was fairly painless on this Ubuntu build. Couple clicks on a button and it was install. Rebooted and the effects were active.

I plan to keep this version around for a little while.

idude-ubuntu7-desktop-s.jpg
idude-ubuntu7-desktop-s.jpg