Technology, Uncategorized 0 comments on Installing DBD::mysql on OS X (10.4.11)

Installing DBD::mysql on OS X (10.4.11)

I was trying to get Bugzilla installed to act as my task manager on my local machine. It’s a new project that I’m trying out as part of my New Year’s Resolution of spending two hours everyday on a project of my own choice. It will help me to be organized, and give me an idea of priority over the tasks that I need to complete. It will also work better for me than using iCal or another calendar-based todo system. I’ve tried, they never work.

In the process, since Bugzilla is a Perl based application, I needed to make sure to update my CPAN modules to the appropriate versions necessary for Bugzilla. It was generally smooth sailing until I ran into DBD::mysql. It won’t install naturally from CPAN, and getting it to work from the command line takes a bit of finessing as well. I thought I should write up what I found in case anyone else runs into this problem. This solution is based on Perl 5.8.6, MySQL 5.0.45, and Bugzilla 3.0.2.

First, it turns out that the 5.* binary builds of the MySQL disk image distributed by the the MySQL Foundation for Mac OS X don’t come with shared libraries. Without these libraries, it seems that DBD::mysql won’t play along nicely. To build the shared libraries, you’re going to need the source directory for your version of MySQL, which for 5.0.45 can be found here. A very nice set of instructions for how to properly build these files is found here.

I’m not sure why DBD::Sponge is required, but without this package the tests failed, and make didn’t complete successfully. As a result, you’ll need to go ahead and run the following command to install DBD::Sponge

sudo perl -MCPAN -e “install DBD::Sponge”

At this point the following is assumed

  1. That you’ve got the MySQL shared libraries built.
  2. The DBI package is already installed
  3. That the DBD::Sponge package has also been installed

Go ahead and try to install DBD::mysql using the following command

sudo perl -MCPAN -e “install DBD::mysql”

It will attempt to install, but fail when it’s unable to complete the test steps. Next you’ll need to manually configure the Makefile parameters, and then run the make tools again. If you setup CPAN and MySQL to work with all of the default values, then the following set of commands should work for you. Also, as a note, this script assumes that your database user is root without a password with a database called test in the MySQL system. Otherwise, just change the directories as they are appropriate to your directory structure.

cd ~/.cpan/build/DBD-mysql-4.005-{*}
sudo perl Makefile.PL \
–cflags=”-I/usr/local/mysql/include -Os -arch i386 -fno-common” \
–libs=”-L/usr/local/mysql/lib -lmysqlclient -lz -lm” \
–testuser=root
sudo make
sudo make test
sudo make install

The {*} is a catch-all because I noticed that every time I tried to run DBD::mysql through CPAN it created a new random String that it appended to the end of the directory name. A simple tab at the point where you’ve reached the {*} should be enough.

Run these set of commands in your Terminal application and you should be off and ready to go with the DBD::mysql module on Mac OS X.

Summer of Zimbra, Technology, Uncategorized 5 comments on To Configure OpenLDAP on MAC OS X

To Configure OpenLDAP on MAC OS X

So it turns out that to install my development environment for Zimbra that I had to install OpenLDAP. The problem is that on Mac OS X the version of the Berkeley DB that comes installed isn’t high enough for the current version of OpenLDAP. As a result, I had to dig around and find some pretty intense command line tricks. I thought I should share these just in case anyone else would need them. The following command will configure OpenLDAP properly on Mac OS X.

env CPPFLAGS=”-I{/path/to/install/BerkeleyDB}/include” \
LDFLAGS=”-L{/path/to/install/BerkeleyDB}/lib” \
./configure –prefix={/path/to/install}/openldap-{version number]

just thinking out loud, Technology, Uncategorized 2 comments on Is Google going too far?

Is Google going too far?

I recently met a family friend for dinner, and she and I both have the bad habit of speaking Turklish – an interesting mix of our ethnic Turkish with our adopted English. In fact, we don’t just speak Turklish, we write Turklish. While the ability to change languages on the fly isn’t worth commenting about, a recent round of e-mails in Turklish caused a stir amongst our inbred language community. Look to the right to Google’s list of ads, and you’ll see “Buy Turkish CDs in the US!”, “Get Turkish imported foods online”, and other Turkish advertisements. Now with Google gathering information from Google Talk to build a Google Music site, I have to ask: Is Google going too far to gather information? Who is Google sharing this information with? Does Google know I have a freckle behind my left ear?

I know that others have commented on whether Google is pushing the limits of privacy by scanning its searches, e-mails, and whatnot, but I never felt invaded until I saw these ads in conjunction with this new Google Labs project. Technically, I’m sure it’s nothing more than a mapping of words to a dictionary. Should that alone worry me? No. I’m confident that no person ever reads my e-mail and then gets his Turkish buddy Mehmet to find ads in which I might be interested. That would be an ignorant understanding of how AdWorks functions. In fact, you would be quick to note that participation in Google Music is voluntary, and therefore my privacy is openly invaded through my acquiescence. However, once people have information, what they know, and can find out, about you is no longer in your control. Quick example. Let’s say we scrubbed all of the name/identifier data out of a survey on favorite book. If I can drill down and find out that 1600 Pennsylvania Avenue Washington D.C.’s favorite book is the Koran, then I know a lot about a specific person. Having this data someplace means someone at sometime can learn more about you than you intended.

I don’t think that Google is the danger here. In fact, the world might be a safer place if the biggest threat to our humanity is a flame war over a blog post, which we nerds will happily provide. However, to do business in China, where 1.1 Billion people live, Google has to cooperate with the Chinese government. Do you want extra information about you to be accessible to the Chinese government if you’re the Falun Gong because you shared a piece of information with Google? What about when the United States claims that because of National Security Requirements, they will need access to the data banks of major search engines? If information exists, then someone will want to find out how they can use it. Should Google be collecting this information if it can’t guarantee the independence of how this information is used?

To close, I find it very interesting how willing we all are to share about ourselves in order to create a more open society. Yes, that society is virtual, and people will know all about my fantasy football team without ever knowing about me. However, have we reached a point where sharing information about ourselves exposes us to the fears and chaos of prying governments?

Technology, Uncategorized 0 comments on MySQL: Startup Error 2002 (HY000)

MySQL: Startup Error 2002 (HY000)

I installed MySQL 5.0 on my MacBook Pro and got the following error when I tried starting the server after a computer restart:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

It turns out that others were having this problem, and I wanted to go ahead and post the solution that I found to work the best:

Type the following commands into a Terminal window:

$ cd /usr/local/mysql
$ sudo ./scripts/mysql_install_db –rpm
$ sudo chown -R mysql data

Note that the line /usr/local/mysql is looking for the symlink at which your MySQL installation points. I pointed mine to /Library/MySQL and changed the line appropriately for my setup. After this, make sure you set the root password to access MySQL, and you should be all set.

*Note* I haven’t investigated this all the way through yet, but I now have to start using

myqld_safe –skip-grant &

as my daemon starting command. I will research this to understand what’s going on, and update this entry.

Technology, Uncategorized 0 comments on Installing Tomcat 5.5.17 and Mod_Jk 1.2.5 on Apache 1.3 for Mac OS 10.4

Installing Tomcat 5.5.17 and Mod_Jk 1.2.5 on Apache 1.3 for Mac OS 10.4

I’ve seen a general lack of content on the latest versions of Tomcat and how to install it on the Mac operating system. This is really frustrating when you don’t know what you’re doing, and you just need some help. After compiling a bunch of how-tos into my memory, I decided to go ahead and post one myself that might help others out.

The latest versions of the software involved were found at these links:

I’ve posted this zip file which comes with all the files you will need for Tomcat including the deployer, admin-related folders, and compatibility package in case you’re still on Java 1.4

On to the install…

Installing Tomcat

  1. I’m assuming that you unzipped the zip package on your Desktop. Given that this is true, it’s probably best to move it to your /usr/local/ folder, and then create a symlink to it in your Library. This is pretty simple to do.
    • sudo cp -rf apache-tomcat-5.5.17/ /usr/local/apache-tomcat-5.5.17/
      • Note: You need to know your administrator password, and either su into the terminal or use the sudo command
    • ln -s /usr/local/apache-tomcat-5.5.17 /Library/Tomcat
      • This creates a symlink to which you can point any version of Tomcat as newer versions are released, or older versions need to be tested
  2. Next let’s go ahead and setup your bash environment
    • Head to your home directory and enter the following lines into a .bash_profile file
      • export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/
        Versions/CurrentJDK/Home
      • export CATALINA_HOME=/Library/Tomcat
  3. The environment is setup. Now we need to setup the start and stop files for Tomcat. This is borrowed from Apple’s how-to on setting up Tomcat.
    It’s suggested to go ahead and setup a bin folder in your home directory, and I did this because it starts organizing your scripts. The content of the files should look like this:
    • startup.sh
      • #!/bin/sh
      • $CATALINA_HOME/bin/startup.sh
    • shutdown.sh
      • #!/bin/sh
      • $CATALINA_HOME/bin/shutdown.sh
    • Then execute the following command
      • chmod ug+x start_tomcat stop_tomcat
  4. If everything has been configured correctly, then you can go ahead and go to http://localhost:8080 and see a running instance of Tomcat. Congratulations!

Configuring Mod_JK

So, it turns out that I was making this way too difficult. It is in fact quite simple to get mod_jk working on your computer. You do need some knowledge of how Apache works, and enough permissions to set some things ups on your computer, but I’m sure you already have that if you’re reading this tutorial. On with the installation:

  1. Move the mod_jk.so file that you should have downloaded as a binary into the appropriate folder with the following command:
    • sudo cp {CURRENT_PATH_TO_MOD_JK.SO}/mod_jk.so /usr/libexec/httpd/mod_jk.so
  2. To setup the workers.properties file, take the following steps:
    • cd $CATALINA_HOME/conf
    • sudo touch workers.properties
    • sudo vi workers.properties
    • Type in the following to setup the workers.properties file
      • worker.list={any_username}
      • worker.{any_username}.type=ajp13
      • worker.{any_username}.host={HOSTNAME_OF_SERVER}
      • worker.{any_username}.port=8009
    • Mine looks like this:
      • worker.list=tomcat
      • worker.tomcat.type=ajp13
      • worker.tomcat.host=localhost
      • worker.tomcat.port=8009
  3. Now let’s move on to setup the Apache HTTP server. Move to the Apache configuration directory to update httpd.conf.
    • cd /etc/httpd
    • sudo vi httpd.conf
  4. And now let’s add the following lines to the httpd.conf file
    • LoadModule jk_module libexec/mod_jk.so
    • AddModule mod_jk.c
    • JkWorkersFile {CATALINA_HOME}/conf/workers.properties
    • JkLogFile {CATALINA_HOME}/logs/mod_jk.log
    • JkLogLevel error
  5. Now let’s add the VirtualHost necessary to mount the paths. Type the following into your httpd.conf file
    • <VirtualHost {HOSTNAME_IN_WORKERS_FILE}>
    • DocumentRoot {DIRECTORY_YOUR_HTML_FILES_ARE_IN}
    • JkMount /{webapp_name}/* {any_username}
    • JkMount /{webapp_name} {any_username}
    • </VirtualHost>

There you go, now you should be able to restart Apache and have Tomcat working through Apache serving both your dynamic and static content.