I created a WordPress site for a client who needed to support both English and Español versions of their content, which involved using a plugin called MultilingualPress that creates relationships between sites for each language.

I developed the site locally on my server, and then after they created some content, migrated it to their hosting service.

Continue reading

 

Glassfish_logo.svgI manage a small application that is hosted on a single Linux virtual machine and have noticed some occasional performance and stability issues.

The server runs CentOS, MySQL and a GlassFish server. I chose GlassFish several years ago because at the time it was the only EJB3 container around, as well as being very well integrated with the NetBeans IDE.

Like most JavaEE containers, it also makes clustering and scaling easier. Continue reading

logoStashPNGI was having a problem where Stash (which was installed as a service) wasn’t starting up properly and giving me a page that made it look like there was a problem with the database.

I have a local MySQL on the same machine as the Stash server, and both that service and the Stash server are set to automatically start up. Continue reading

I was helping out http://www.pmi-sfbac.org whose web site was down.
The server was being unresponsive, and Larry Van Cantfort (the Director of Operations for PMI SFBAC) sent me this clue:
It appears that httpd has a lot of running processes and when I try to kill them I am unable to. THis is causing the server to sloooow way down. There are also error messages from mysqld with a corrupt table:

I couldn’t even get into the control panel to get things going, so the cleanest approach was to simply rebuild the server.
So I shut down the database and started to try and get it backed up so we’d at least save all the hard work of the volunteers.
So I tried to run the dump, with the following command that I got from the Parallels support site:

But that gave me the same error:

A quick Google search and I found the “fix” for this is to run a repair on the tables: http://www.daveperrett.com/articles/2009/06/18/mysql-table-is-marked-as-crashed/

That fixed the issue, and I was able to create the “dumpall.sql”.

Once I had ALL of the tables fixed, I simply rebuilt the server and migrated it into a new database as described in the Parallels KB article mentioned above (a lot more steps to make sure the backup was good, but once it was the newly imaged server was able to run without incident).

Enhanced by Zemanta

I was thinking about this as I drove to work this morning: what is the real business value to Oracle of buying Sun ?

It occurred to me that part of the many benefits to Oracle are the products that help them compete better with the Microsoft offerings. Could this be another in a long line of acquisitions by Larry Ellison in his quest to make Oracle a more successful company than Microsoft ?

Microsoft has owned this market for some time now, and has had some tools that Oracle has tried to compete with over the years. Microsoft had Access, which is at a surface level a database, but has over the years served much better as a front-end tool for database access. Oracle has tried to  address this over the years, first with Oracle Forms, then with JSF and ADF, and now APEX (formerly known as HtmlDb).

These tools, while extremely capable, have never had the low entry to use that has been available in the Microsoft product line, and now with the rapid introduction of Silverlight, Microsoft is threatening to dominate the RIA market.

There is tremendous buzz (hype?) in the market about the RIA competition, with both Adobe and Microsoft claiming a market penetration of over 70%. Sun has similar figures with Java, and has recently entered this market full force with JavaFX.

JFX combined with MySQL looked to have the potential for introduction of new products that would displace both the rich media and rich data driven applications that have been dominated by Flash (Flex).

With the acquisition of Sun by Oracle, it is entirely possible that a solid Flex and Silverlight competitor could emerge due to the capabilities of the Java platform for producing UI, combined with the simplification in coding provided by JavaFX. This could also give rise to an easy to use tool that could replace Access as the easiest way to build an application, by integrating the JavaFX UI capabilities with the Oracle developer tools.

The only missing piece in this puzzle for me is that focus on the end user as being capable. Oracle has great tools for developers, and they help build applications extremely easily, but they haven’t done a great job with figuring out how to bridge the gap between the technical types and the consumers. I don’t think it’s a vast chasm to cross, but they would need to focus on improving the ease of use to compete head to head with Microsoft and Adobe.

Not only does the Sun acquisition continue to strengthen the web tools that Oracle has recently improved with their WebLogic tools, expand their hold in the database market, and solidify their place in the SOA market, but it also allows them to compete better in the hottest area of competition at the moment: Rich Internet Applications.

What will Oracle do with these capabilities ? Only time will tell.

I have been running my development for VolunteerCake with a database on my Windows box which sits in my office with my Mac. I went to meet some people at a coffee shop, and realized that I couldn’t show them the app running on my MacBook because I was no longer on the same subnet with my Windows box, so I decided to move the database to the Mac to allow me for this.

Since I had everything in place to run Cake on my Mac except for MySQL, the first step was to install MySQL. This turns out to be pretty painless. Just grab the DMG from the MySQL site, and voila, new MySQL running on my Mac. Checked everything out using the MySQL administration tools, and it all looks good (I can access the DB, set up users, etc.)

Next I need to put the data in the database, so I just do a quick export from the phpmyadmin page on the PC. I end up with a file that is the SQL needed to replicate the entire database on my Mac. I run this SQL into the Mac MySQL, and now I have an exact copy of the database on my Mac.

After that, I go to the SQL administrator tool and make sure I have the user set up to give access to that database and make sure the username and password are the same as I was using on the PC (if I were more of a DBA, I’d probably have done this with command line MySQL, but I like GUIs, especially for things I don’t do every day, and the MySQL tools are pretty cool).

Then I need to change my database.php to point at the local database in order for VolunteerCake to get the data from the Mac. This should be as easy as changing the name of the host name to ‘localhost’ from ‘monet’ since I’ve set up the user and access to the database exactly the same as what I had on the PC.

Finally, all that’s left is to fire up the same URL that I have established for my app on my Mac (http://test.lctd.org/VolunteerCake) and … wait, that didn’t work. It says it can’t find the table acos for the Aco model …

Weird, the table is there, I can connect just fine, what could this be? A quick trip to the IRC channel, and I get the suggestion of clearing my cache. OK, try that … But hit the URL again and no change.

OK, now I’m confused, so I try running ‘cake bake’ … Now something interesting: I get an error that tells me that it was unable to connect to /var/mysql/mysql.sock – what does that mean? I thought I was connecting with a TCP socket, why does it want a file? Is this some sort of file permissions issue ?

Back to the IRC chat for some guidance, thinking maybe it’s a common problem, a permissions issue or something, of course they tell me to do exactly what I’d tell somebody else to do: verify that you can connect from PHP first. Good idea – so I whip up a quick connection test page, and get the same error. So now I’ve confirmed that it’s a PHP problem, and not a Cake issue.PHP can connect to a remote DB, but not the one on my local Mac …

Now it occurs to me that I often have problems that end up being related to the open source software that came bundled with the Mac, so I do some Google searches on PHP connection to MySQL for Mac OS X, and with the connection error messages. Eventually I find what looks to be the issue: for some reason the MySQL configuration sets the socket file to /tmp/mysql.sock but the PHP that comes with the Mac is looking somewhere else (at /var/mysql/mysql.sock to be specific). So I basically have three choices, edit the php.ini, edit the mysql config file, or build symlinks to make the file accessible at both locations.

I decide to change the php.ini file, which turns out to be another excercise in hunting, since Mac OS X likes to hide the files you’d expect to find in the /etc directory. After some more Google searches, I find that the PHP5 install that comes with Leopard puts the php.ini file into /private/etc, so I edit that file, changing the part of the file that looks like the following:

To be:

In order to have PHP find the mysql.sock in the location that MySQL is actually creating it. Check my URL again, and voila, everything is working !!!

So, to make a long story even longer, I relearned that mixing actual open source with vendor open source is often problematic. It was suggested by at least one person (Mark Story) on the IRC channel that the best way to set up for Cake development on the Mac is to use MacPorts, since then you end up with matching versions of the software all in a “normal” open source location.

Enhanced by Zemanta

I have a new open source project at VolunteerCake that is using their recently released web hosting service. This service includes the typical LAMP stack with MySQL, Apache and PHP, so I thought it would be a great place to keep a demo of the site running.

It was working fine, and then one day I noticed that the pages were being over aggressively cached. For instance, if I clicked the login button on the front page, and logged in successfully, I expected to see a “logout” button and my user name, but instead was seeing the original page. By hitting “shift-refresh”, I was able to get the right page to display, but obviously that wasn’t a good way to demonstrate the software.

 

During my work on figuring out my Plaxo problem, I found a really cool tool called Fiddler2 that acts as a web proxy and lets you do nifty things like see the headers on web requests. Using this tool, I was able to look at the cache headers being sent by the server which looked like:

HTTP/1.1 200 OK
Server: nginx/0.6.31
Date: Tue, 18 Nov 2008 22:02:49 GMT
Content-Type: text/html
Connection: keep-alive
X-Powered-By: PHP/5.2.6
Set-Cookie: CAKEPHP=b7pvoorvj11tb45micnfqhc4b2; path
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Cache-Control: max-age=172800
Expires: Thu, 20 Nov 2008 22:02:46 GMT

Content-Length: 444

The part marked in red was the problem, the Cache-Control and Expires headers were being set to 48 hours in the future for my pages, so the browser was displaying the cached version of the page instead of asking the server for a new copy.

Knowing this, I opened a case with the SF.net support team to see if they could help figure out why the server was setting these headers for the PHP pages. I had a suspicion it had to do with the fact that Cake uses a new file extension of “.ctp” for the view files, but I really had no proof of this.

The SourceForge.net guys told me that their service had just been moved to some new servers, so it was possible this was related to that. They suggested that my application was responsible for setting the cache headers. While Cake does do some caching, it didn’t fit with what I knew. This exact same setup was working on my hosting service at http://volunteer.lctd.org/, which didn’t send those same headers.

I did some research on the Apache settings for cache, and while it is generally something you do at the server level, I found that it is possible to override these settings in the .htaccess file for a particular directory. Having had to tweak this file before to get Cake to work properly, my .htaccess file looked something like:

So what I needed to do was to tell the server not to set the Cache-control or Expires headers. After some experiments, I ended up with a new .htaccess file that looked like:

Which basically turned off the whole caching on the http://volunteercake.sourceforge.net site. Since this is just a demo application, I figured that was good enough, so I didn’t spend any more time on figuring out how to restrict the change to a specific type of file (which would be important if this were a large application).

Enhanced by Zemanta
Posted in Web.