I got Leopard (OS X) installed!!!!!

November 9, 2007 § Leave a comment

and then MySQL is broken… Damn…

There are quite a number of people giving suggestions on how to deal with this problem.

It turns out to be just permission problem. Below is what I did:

Fri Nov 09–at[~]–do–>sudo chown -R {my_username} /usr/local/mysql/data

Done.

Now I can start and stop MySQL via Preference Pane as usual.

Hopefully this help some readers who want to upgrade to OS X Leopard.

Zend Framework… (Part 1)

June 5, 2007 § 1 Comment

Is intriguing and disappointing (a bit) at the same time.

Disclaimer:

This is just part 1 of what’s going to be an ongoing reviews. I decided to do the review this way because I realize that 1-2 days is definitely not going to do the framework justice. The review would take weeks at the very least.

So, let’s talk about why it is intriguing:

It’s web development framework from the official PHP folks. Of course it’s gonna be great. There are lots of PHP developers who are excited with this very thought, me included. Granted I’m late in the party.

Zend framework finally reached version 1.0, it seems to be ready for prime time? Let’s give it a shot.

Reading at the manual and the source code a bit, everything is a component in Zend Framework. Awesome! It seems to have everything I need and more. Once I understand how the component gets called, I’m sure I can develop a component that’s also plug n play in CakePHP. One component to rule the web!

Lastly, My my my… The directory structure is very familiar. Reminds me of RoR and CakePHP… especially CakePHP.

Now let’s talk about what makes me iffy at first:

I swim in RoR, CakePHP style framework for quite some times now. Somehow, I’m starting to like to be hand-held. I know, i know, that sounds bad. Software developer must make their own tools! With their own conventions! and their own configurations! I’m a bad developer for wanting the tools to spoil me.

Ok, enough with the guilt trip. Zend Framework doesn’t force me anything. It seems that I would have to write my own index.php, initialize the Zend_Db or Zend_Cache myself. Not a big deal, I’ll just have to get used to the new mind set.

But that doesn’t mean Zend doesn’t have any conventions. From some tutorials I saw IndexAction function name inside Zend_Controller. That’s an interesting naming convention. Reminds me of Struts Action in JAVA world (Shivers…….).

But what would be the real kicker is:

How performant is it? I haven’t been able to find some data that shows the performance capacity of Zend Framework. If readers have some data, or personal experience with it, please share those to me :)

I have yet to see what it can deliver better than CakePHP. But! (This is a big But) This is just the first review. I have yet to complete an application with it.

Stay tuned. Second review will come after I created a blog engine with it and stress test it. That being said the second review would be about performance.

Battle against RoR: gem install mysql…

May 17, 2007 § 12 Comments

is simply broken. Broken as hell.

This is my development environment:

  • Mac OS X 10.4.9
  • MySQL 5.0 under /usr/local/mysql
  • gcc 4.0.1 or gcc 3.3
  • readline 5.2
  • ruby 1.8.5
  • rubygems 0.9.3
  • fcgi 2.4.0

Everything was installed properly except mysql binding.

1. This is the command I called to install that module:

sudo gem install mysql — –with-mysql-dir=/usr/local/mysql

2. Didn’t work. Next:

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Chose MySQL 2.7 (ruby)

3. Works. But “rake migrate” didn’t work. Next:

4. Changed gcc from 4.0 to 3.3:

sudo gcc_select 3.3

5. Then ran:

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Chose MySQL 2.7 (ruby)

6. Didn’t even compile. Tried MySQL 2.6 (ruby):

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Chose MySQL 2.6 (ruby)

7. Didn’t even compile. Damn!

Google search revealed this. Damn! Why some configurations work for some people? What The Hell???

8. So, I changed gcc back 4.0:

sudo gcc_select 4.0

9. Uninstall gem mysql:

sudo gem uninstall mysql

Now, obviously, “rake migrate” works.

Conclusion: RoR 1, me? Big Fat 0.
————————————————————————————————-

References:

References on how to install Ruby on Rails on Mac OS X

May 17, 2007 § Leave a comment

  1. http://hivelogic.com/narrative/articles/ruby_rails_lighttpd_mysql_tiger
  2. http://developer.apple.com/tools/rubyonrails.html
  3. http://locomotive.raaum.org/

Number 3 is interesting because it provide project containers to all of your Ruby on Rails application, but the 75 MB download is a bit too much though.

I cannot really add more insight to the installation process because RoR seems to be born inside Mac OS X. Installation is dead simple, documentations are plenty as well.

Apache & CherryPy Tutorial

May 16, 2007 § Leave a comment

I cannot write it better than his.

So, I’ll just include the original article here.

———————————————————————————————–

Other References:

Checklist when using Python for Web Development

May 16, 2007 § Leave a comment

  1. Download latest stable of Python (as of today version 2.5).
  2. Visit cheesecake for some module shopping.
  3. Before installing anything else, easy_install module is a must-have!
  4. If you are planning to use MySQL database, install module mysql-python.
  5. On top of MySQL,if you need ORM (Object Relational Mapper), download SqlAlchemy.
  6. If you are planning to do unit testing, install nose.
  7. If you need MVC Web framework you can either:
  8. If you are thinking of rolling your own architecture:
    • For getting up to speed in Web Server development, download CherryPy.
    • As you get large number of hits, you might be considering Lighttpd. To communicate CherryPy & Lighttpd, install scgi via: easy_install scgi.
    • If you need templating language for generating dynamic html, there are gazillion of them, I don’t know which one is good: Cheetah(PHP-alike), Kid(XML-ish), Genshi (XML + embedded Python), Mako (not XML), etc.

    Battle against LAMP (2): LAMP stack is…

    May 5, 2007 § 3 Comments

    LAMP STACK indeed.

    On Mac OS X:

    • apache 1.3/php4/mysql4.1 are default. Piece of cake. No big deal.
    • mysql5/apache2/php5 are giving me fits, but nothing I couldn’t handle. Piece of cake.
    • How about apache 1.3/php5/mysql4.1? Suddenly the STACK becomes somewhat a lot more difficult to configure. (apache 1.3/php4/mysql5 gives about the same annoyance).

    Why? Why is is so difficult to mashed old/new versions of LAMP? Some of the explanations I could come up with are:

    • In OS X, default LAMP configurations are located in funky places such as /private/etc/… That’s not very default compared to debian Linux.
    • /usr/sbin/apachectl is not symlink. Thus, finding the REAL apache 1.3 executable is not easy at all. Albeit finding httpd.conf was easy (Guess where? inside: /private/etc/…).
    • Of course, just to make life more difficult, apache 1.3 modules have to be placed here: /usr/libexec/httpd/…
    • Console.app is great, very useful. But it only keeps default logs. (e.g. apache 1.3 access_log located under /private/etc/…). If you want to see apache2 error log, create symlink that replace default log file.

    Besides configuration, more griefs are coming almost immediately:

    • Why libphp5.so is not compatible to apache 1.3? that’s just pure WTF. Or maybe… There’s different libphp5.so for different Apache version?
    • Soon after, Apache2 gives me this error: LoadModule mod_rewrite is default, thus cannot be loaded.

    Default my ASS, if I have to specify ./configure –enable-rewrite then it’s not default configuration. At least it was an easy fix, simply commented out LoadModule mod_rewrite.

    As I thought I have won the war, WHAM!!!!

    Permission denied: couldn't grab the accept mutex

    What the… Apparently Apache 2 for Mac OS X doesn’t like listening to more than 1 port. Adding this on my httpd.conf fix the problem:

    AcceptMutex flock

    Done. What else you got punk!?! Seems like I managed to silenced Apache2 once and for all.

    Victory, is mine…..

    Battle against LAMP (1): mod_rewrite on Apache2…

    May 5, 2007 § Leave a comment

    sucks ass big time.

    Why?

    • It is not part of default ./configure (surprise, surprise…).
    • When configuring apache2 with such flag: enable-rewrite=shared, mod_rewrite is still not working (Apache2 -> 2, me ->0).
    • When flagging ./configure with only enable-rewrite, magically it decided to work. The console output says: Enable mod_rewrite: yes(default). WTF??????

    Marching on…

    Configuring Apache2 and PHP on Mac OS X for Development

    April 23, 2007 § 4 Comments

    This article would serve as public cheat sheet on how to configure everything from scratch. Again…

    1. Grab the latest Apache 2.0 / 2.2 as well as PHP5
    2. Unzip them with this command: tar -xzf [your_file].tar
    3. Go to the created httpd directory (for apache) or php directory.
    4. Run: sudo ./configure. This is the crucial part. It is better to set installation path here instead of fiddling around later.

    Sample .configure for PHP5:

    $prompt: ./configure –with-curl=/usr –with-mysql=/usr/local/mysql –with-apxs2=/usr/local/apache2/bin/apxs

    As you can see from –with-apxs2 flag, I installed apache2 on default location. It’s easier to find help and online documentation if you keep most installation on default location, IMHO.

    The biggest problem with installing Apache is the httpd.conf monkey work. Below are things you might want to set:

    • Listen 80 (and/or other port number. This is needed for VirtualHost setup)
    • DocumentIndex index.php index.htm (add more if you need them, e.g. index.rhtml)
    • DocumentRoot /Users/{username}/Sites/{your_project} (This path is accessible by default)
    • <Directory /Users/{username}/Sites/{your_project}> </Directory>
    • AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps
    • <VirtualHost *:{your port number}> {This tag can handle almost all Apache’s directives} </VirtualHost>

    Mac OS X has Apache1.3 by default. That can be seen as both blessing and curse :P. If you would like to run Apache2 this is what you might do:

    • Stop Personal Web Sharing via System Preferences…
    • type: sudo /usr/local/apache2/bin apachectl start

    AGAIN and AGAIN… If that aggravates you then this is what you could do:

    • cd /usr/sbin
    • mv apachectl apachectl1.3 {–> This rename default apache1.3/apachectl command}
    • ln -s /usr/local/apache2/bin/apachectl apachectl {–> This creates symlink for Apache2/apachectl command}

    Quick Note: Symlink is something like Alias or Shortcut on the GUI realm.

    There you have it. Hope the list is handy for you.

    OS X as the ultimate Web Dev machine!

    April 22, 2007 § Leave a comment

    Below are blogs, tutorials, and articles that help me configuring OS X to be the ultimate web development machine:

    1. Before doing anything, first execute command: “periodic weekly”. This allows you to use “locate” command.
    2. Fink! Before installing your favorite Linux tools/packages, get this one first. This app contains apt-get and much more.
    3. While you are installing Fink, why not FinkCommander?
    4. This guy presents dead-on tutorial on how to install Apache, MySQL, & PHP.
    5. This is my take on how to install Apache2 & PHP5.
    6. This guy shares us the joy of Python via this easy, breeze, beautiful blog.
    7. In case you have amnesia, or simply didn’t know SVN… Read this!
    8. What about Text Editor you say?
      • The hardcore side of me says “Use VIM my friend…”
      • The easy-to-use-but-resource-hog side of me says “How about Eclipse?”
      • Though TextMate still rules the realm of Darwinian.

    More is coming up, if only I could find some of yesterday’s online tutorials (del.icio.us hasn’t solved my problem yet).

    Where Am I?

    You are currently browsing the install category at RAPD.

    Follow

    Get every new post delivered to your Inbox.