-
Apache, PHP and MySQL in 10 Minutes
Posted on June 11th, 2011 No commentsWhether you want to start developing web applications for the first time, you’re wanting to make better use of your local computer or a virtual machine to streamline development, create a development or staging server, or just checking back as a reference for a new platform, welcome to…
Apache, PHP and MySQL in 10 Minutes
In this guide you will find the resources needed to build a web development environment on the platform of your choice
- Choose Your Platform – Mac, Windows or Linux.
- Mac OS X Instructions
- Easy - Using MAMP
- Intermediate - Using built-in Apple Apache
- Windows Instructions
- Install WampServer
- Install XAMPP
- Linux Instructions
- CPanel
- CPanel comes with Apache & PHP already installed, so here’s how to customize your install
- Note – make sure your config comes with WHM (Web Host Manager)
- Many ISPs call this a Reseller account
- How to use the EasyApache script
- Plesk
- Plesk comes with Apache & PHP already installed, so here’s how to customize your configuration
- Parallels Plesk Apache Configuration Guide
- Mac OS X Instructions
- Install any PHP Extensions you might need
- The one PHP extension that Kohana requires you that doesn’t come by default (See Kohana 3.1 in 5 minutes) is mcrypt:
- How to create a VirtualHost
- Find your Apache Config file
- Find your Apache VirtualHost config file
- Sample VirtualHost container
<VirtualHost *:80>
ServerName website.dev
DocumentRoot "/Users/username/Sites/website.com"
</VirtualHost>- More from the Apache VirtualHost documentation
- How to edit your hosts file
- Start Apache
- Start Apache
- Mac OS X:
- Terminal
sudo apachectl start
- or start Web Sharing in System Preferences
- Terminal
- Windows
- WampServer – start all services using the taskbar tray icon
- Linux
- Debian/Ubuntu
sudo /etc/init.d/apache2 [start | stop | restart ]
- Fedora
service httpd [start | stop | restart]
- ArchLinux
/etc/rc.d/httpd restart
- OpenSUSE
apachectl [start | stop | restart]
- Debian/Ubuntu
- Mac OS X:
- Start Apache
- Test your install
- Go to http://localhost in your browser
- Are you seeing the Apache start page?
- If so, you are done. Congratulations! You just installed a web server.
- Install MySQL
- Mac OS X
- Windows
- Linux
Now that you have a development environment, why not install a fantastic web development framework, such as Kohana.
Ready for round two? Kohana 3.1 in 10 Minutes
- Choose Your Platform – Mac, Windows or Linux.
-
Git Resources for Subversion Users
Posted on June 11th, 2011 No commentsI’ve been using Subversion for years, but lately I’ve been thinking it’s time to get into Git more. Plus, A lot of new GUI tools are out there and some of the older ones are still there, too, so maybe Git has matured enough for production use.
Why would I want to use Git?
Flavio sums it up quite nicely:What’re the advantages?
Since Git is a distributed revision control system (while svn is a centralized one) you can perform commits, branches, merges… on your local working directory without being connected to internet. Next time you’ll be online, you will be able to “push” your changes back to the central svn server.In a tech video from Facebook, one of the things they mention is that their developers us Git on local workstations for managing changes, and Facebook overall uses Subversion for managing the source tree centrally. I thought it was interesting that Facebook, one of the most advanced, largest and high-powered software applications on the planet, uses both Git and Subversion. Here’s an article about Using Git and Subversion Together.
I’ll be posting links to the resources I find here.
Three Part Intro to Git Series
1-2 hours • First, take the Git Crash Course.
2-4 hours • Next, read Git for Subversion Users, Part I and Git for Subversion Users, Part 2. These two articles at IBM.com give you a really good overview of the main differences between Subversion and Git.
4-6 hours • Finally, you should read Pro Git. This is an awesome free online book about Git.
After you complete these you should be a total Git.
-
How to install Memcached Memcache PHP on OS X
Posted on May 9th, 2011 No commentsThis Guide is the best resource I’ve found yet. I had to also look up how to fix pear installation errors.
-
Wolfram|Alpha Implemented My Suggestion
Posted on March 15th, 2011 No commentsWe have received your feedback regarding Wolfram|Alpha.
The issue you reported has been fixed on the site. See http://www.wolframalpha.com/input/?i=%24250+is+75%25+of+what%3F
Thank you for helping us improve Wolfram|Alpha.
Best wishes,
Delores
The Wolfram|Alpha Team
www.wolframalpha.comInput: 50 is 75% of what?
Name: Salient Digital
Country: United States
Occupation: Web Developer
Organization:
Id: 109996
Date Received: 2010-08-03 22:07:45
Message: Can you make it solve this input?`50 is 75% of what?`
‘what’ = var x;
‘of’ = operation ‘*’; // times
50 = x * 0.75
50/.75 = 33.33 -
Adobe Excuse the Interruption, but…
Posted on January 20th, 2011 No commentsOkay, Officially I hate Adobe worse than Microsoft now. Get ready for this, guys…
I just got my computer back from being repaired (1), during which time I had a loaner computer from Fry’s Electronics. I’ve been working from a Time Machine backup on the loaner computer (2) and now have my original restored laptop with a fresh motherboard back again (3).
I launch Photoshop to edit some vacation photos, since I haven’t seen the computer they were on for the last 20 days, and I’m greeted with this:
Bullsh!t. Two other computers? How about my old one, a loaner and my repaired one (new motherboard surely generates a new Gestalt value which Creative Suite thinks is a new computer, which technically it is.) Okay well, I’ll try the “I already have deactivated the other computers” option and see what it does.
Oh come on! What’s ridiculous is that I’ve only ever used this serial number on two computers. I formatted the loaner before returning it and now don’t have possession of it. Oh is some offshore call center person going to get an earful from me.
Welcome to 2011.
-
MySQL won’t start on Snow Leopard
Posted on December 31st, 2010 6 commentsI recently spent a lot of time scratching my head over this. Partial solution only at this point, any additional ideas would be most welcome.
I restored a Time Machine backup from an older 32-bit MacBook Pro onto a new 64-bit MacBook Pro. Apache & PHP worked fine, but I had compiled the 32-bit version of 5.1 on the 32-bit box. I had problems with MySQL starting after the restore, which led me to rm -rf everything related to MySQL including the /Library/StartupItems/LaunchDaemon, reboot, and install the 5.1.54 from the 64-bit dmg download installer.
After this, I figured I’d be fine, The MySQL preference pane in System Prefs shows “stopped”. Clicking start has no effect.
ps aux | grep mysql
shows only my grep command.
I had to do a few things to get MySQL partially working.
1) I had to
chown -R mysql:wheel mysql-install-dir/bin chown -R mysql:wheel mysql-install-dir/data
2) I discovered I can only start MySQL if, from terminal, I do:
sudo /usr/local/mysql/bin/mysqld_safe --user=root
I can’t connect to mysql from the command line with the dreaded
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I do another
ps aux | grep mysql
and see it’s starting with
/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=root --log-error=/usr/local/mysql/data/MacbookPro.local.err --pid-file=/usr/local/mysql/data/MacbookPro.local.pid --socket=/var/mysql/mysql.sock
So I make a symlink
ln -s /var/mysql/mysql.sock /tmp/mysql.sock
and try again
mysql -u root -p
Yes! Now I can use MySQL from the command line. After Googling for hours, I’ve seen others with similar install/starting problems on the latest Snow Leopard. I think it all has to do with file permissions on the /bin and /data directories.
-
Get MySQL Certified For Just Under Four Grand
Posted on November 15th, 2010 No commentsOracle just sent me an email with a “soft offer” to get 20% off MySQL Certification. I’m using GMail in Safari. I click to see the pricing. The click-through sent me to this page.
The page requires you to pick your country, and then breaks. Second time, I get an error message: The packages couldn’t be received. Third time it worked.
Normally, $4,635 – act fast and get MySQL Certified for only $3,708.
So let me see if I understand this correctly… in a down economy, when the average guy is just lucky to have food on the table… I can pay just under four thousand dollars to be certified to use a free database? Hmmm. I’ve never been asked by any employer for such a certification.
I think I’d rather eat this month.
Great email campaign though – generated three clicks. D’OH! Fail.
-
Twitter API Snowflake and MySQL
Posted on November 13th, 2010 2 commentsI’ve been looking at APIs lately, and in particular, the Twitter API.
I managed to stumble into an advanced discussion on the Twitter developer forums about Twitter’s “Snowflake” update. One of the primary changes of the Snowflake update is the use of 64-bit integers for their ID.
As a PHP & MySQL developer interested in learning more about the Twitter API, I want my database schema to be optimized properly.
On this page of the MySQL website, it says, in part:
Some things you should be aware of with respect to
BIGINTcolumns:- All arithmetic is done using signed
BIGINTorDOUBLEvalues, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting aBIGINTvalue to aDOUBLE.
Does that mean I cannot use a BIGINT to store a Tweet’s primary key?
Surely VARCHAR(64) will be much slower…
- All arithmetic is done using signed
-
How to embed Windows Media Files on your Website
Posted on November 7th, 2010 No commentsThis article over at Microsoft explains how to embed .WMV (Windows Media Video) as well as .ASF files on the web.
The thing is, their method seems crippled (even wrong) as it explains how to create an additional text file for every WMV video, and to save it with a .wvx or .asx extension… which is quite strange, in addition to being totally time consuming and redundant.
While that may be the official method, I found this post at MediaCollege which has a simple object embed tag for WMV, but it doesn’t validate, since <embed> tags are deprecated.
In the end, I went with this technique at A List Apart . You may want to try this one first, because it’s more effective in more browsers, and is the only way to do it if you want your document to validate under a strict XHTML doc type.
Now you know how to embed .wmv — the right way. Enjoy!
-
LVS-TUN How To on RackSpace Cloud
Posted on October 6th, 2010 No commentsI have to hand it to the sales/techs over at RackSpaceCoud.com.
After just a few minutes with their Online Chat Sales, I was intrigued enough to create an account. Heck, it was free, and would give me a chance to experiment with server configuration via one of the hot topics today – virtualization.
One of the first things I mentioned to Zack (I think that was his name) was that I was interested in making a more fault-tolerant web server setup. My client at the time had a dedicated server, but was planning on a few different television appearances, and didn’t want his site to go down with the surge of traffic.
Load Balancer How-To using Apache Mod_Proxy (Easy)
The RackSpaceCloud tech linked me to this article by Brandon Woodward on how to set up a simple load balancer using Apache. I followed that article to the letter, using one CentOS VM for the load balancer, and two CentOS VMs for web heads.
Well, I have to admit, it was not as difficult as I thought it would be. Now granted, it’s not super robust, but for a simple round-robin load balanced setup, it only took an hour or two to setup and configure, and it is still in place on the client’s domain. Not bad, considering it’s the equivalent of 3 servers for less than $50/mo.
Load Balancer How-To using LVS-TUN (Intermediate-Advanced)
Having found the RackSpaceCloud article on setting up a load balancer with Apache just a few months prior, I was interested in learning more when I saw this new article by the same author on installing and configuring LVS-TUN.
I was intrigued, because even though I believe having a mod_proxy-based load balancer solution on 3 servers in the cloud is preferrable in many ways to a single server with no load balancer at all, I could still see some areas for improvement and wondered what else was out there.
Woodward explains it like this:
LVS-TUN is a tunneling load balancer solution that will take all incoming requests through the load balancer and forward the packet to the web nodes. The web nodes will then respond directly to the client without having to proxy through the Load Balancer. This type of solution can allow for geo-load balancing, but will more importantly allow a customer use the bandwidth pool available from all web nodes, instead of relying on the limited through put of the load balancer.
In other words, whereas the mod_proxy-based load balancer is quick and easy to set up and manage, the load balancer itself is a single point of failure, since it is acting as a proxy for the two web heads behind it. LVS-TUN on the other hand, enables the load balancer itself to be distributed, and also takes advantage of the web heads serving content directly back to the client.
Whether you’re looking at a load balanced setup for scalability or just your own hardware architecture experimentation, without a doubt, the cloud is the best playground.





