What I wanted to do specifically was to have my current hosting provider dish out any requests to example.com and www.example.com, but send requests for mail.example.com, docs.example.com, and calendar.example.com to the Google Sites application. I don’t know why the web hosting part of Google Sites is so bad, but it’s really bad. But the mail, docs, calendar, chat…those are all really really good.
I have my domain names with name.com. They give you an option to enable Google Apps for your domain, so the DNS setup was pretty simple. Just a couple of tweaks to it gave me the kind of setup I described above. The DNS settings created by enabling Google Apps included the following MX records:
example.com 3600 IN MX 5 ALT1.ASPMX.L.GOOGLE.COM
example.com 3600 IN MX 1 ASPMX.L.GOOGLE.COM
example.com 3600 IN MX 5 ALT2.ASPMX.L.GOOGLE.COM
example.com 3600 IN MX 10 ASPMX3.GOOGLEMAIL.COM
example.com 3600 IN MX 10 ASPMX2.GOOGLEMAIL.COM
It also creates some A records and some CNAME records: docs.example.com, calendar.example.com, mail.example.com, and www.example.com, all pointing to ghs.google.com. The key to getting this setup is to blow away the A records, you want your A records for example.com and @.example.com pointing to your hosting server. In my case I just used the IP address listed in my hosting company’s control panel. That at-sign one is weird but it is working for me…you’d expect an asterisk instead if it’s supposed to be a wildcard. Finally, you will need to delete that www.example.com CNAME record and put in a new CNAME with www.example.com and the web server’s IP address.
This is great and something that I’ve been trying to setup for quite some time. All this DNS stuff is complicated and often you have to wait days for it to propagate. Not sure why, but it was all instant for me tonight. Now I am going to run through all of my other websites and do the same setup.
Rebuild Project Notes #14 »« Rebuild Project Notes #13
Going through the UI of my site a little more and fixing CSS, trying to make some sort of presentable design. I’m trying to get the jQuery rounding corners working by using the corner() function. Soooo easy with jQuery.
I also got a couple more Firefox plugins for web development. YSlow and SenSEO. These are both really cool. The SenSEO made me recognize that I need to change the Site Name in the Joomla admin global configuration. This will help a lot. The grade, starting off for the homepage of the Joomla site is an E (60/100). The YSlow grade for this same homepage is an D (65/100). I am using “choreographers theater directors union” as my input string for SenSEO.
I pulled in Blueprint CSS framework tonight. One tip: when you use the $html->css() function make sure that you call it with the options array and specify the media type. Like this: $html->css('screen.css',array('media'=>'screen'));
I turned down the debugging level to 1 which removes the sql output. I also went through the directory and made my image heights multiples of 18px. This is to accomodate Blueprint. It likes to set the line-height to 18px and I guess this looks good when you adjust your images.
The rounded-corner jQuery script I’m trying to use can’t be found by Cake, and I’m getting a weird error that says JsController cannot be found. I hope that it’s just a matter of some missing .js files…as this guy over here says was the case for him. That did seem to fix it…
Setting up google email hosting for your domain »« Rebuild Project Notes #12
Working on getting the directory functionality to a point where it can be presented. So I need the browse and search actions to work well.
Cutting up my views and making some elements…I made an element for the small-box view of a member’s profile. When I made the new file and added my $this->element('small_profile') call, I encountered some errors…the variables needed by the element were not available so I needed to pass in these variables as the second parameter like this: $this->element('small_profile',array('class'=>$class, 'member'=>$member) and the errors were gone.
I like the whole layout/view/element thing…it is quite elegant and allows me to organize my code in a way that promotes separation-of-concerns.
I need some better user data…I think that I must work on the import stuff before I can REALLY dig into search. I think that the Excel-based import is the best way to go for now, because with excel I can filter the data more easily…but I guess that’s not REALLY true…I can easily use SQL to work with the data and find the members with profile pictures. So I am going to carry on with the SQL-based import.
For now, this import will drop all records from the Members table and refill the table with imported records.
I am getting discouraged. I think the reality is that once I am “done” with this…I will need to rewrite the whole thing to implement testing to verify that it works correctly. There is more work here than I can do…
Rebuild Project Notes #13 »« Rebuild Project Notes #11
Well, I have my login stuff working now under Cake 1.3. That’s pretty nice. I just had to pull in the session helper and session component in my app_controller.php file. That seemed to fix things…
The next issue that I had was my navigation element was not showing up. I’m not sure if this changed or not, but I had to echo it…I know that one change to 1.3 was that flash() is no longer auto-emitting…you now must echo the flash(). This just makes it consistent with the rest of the platform.
Then I had a couple of issues with the del() function on my models…this was changed to delete(). No biggie.
So one more re-deploy to see if this is solid, and then I can move on to the front-end work, preparing for a meeting next Wednesday.
Ok…that worked. Now I am going to sit for a minute, have a smoke, figure out what my next step is. The migration to 1.3 is complete, and my redeploy script runs well.
Part II
Just banging around on this some more…I’ve created a new datasource for the whole member-import stuff…I noticed in my jos_comprofiler table that there are no users who’ve used the message/email system that I installed…ever.
I ended up creating a whole new DataSource and Model for the Joomla users, the other two that I have are more for keeping track of the Joomla sessions.
I also started to separate out the layouts into a default layout and an admin layout. I went through my controllers and added in a $this->layout = ‘admin’ for my admin actions…this worked (so far as I can tell), but it did cause a problem when hopping back over to the non-admin actions. I just got no layout for those. So I added a line to my AppController::beforeFilter() which sets $this->layout = ‘default’. I don’t know if this is the best way to do it, but it looks like it works…
BUT….now I cannot view the directory when logged in as sa. I broke something…I will fix it tomorrow.
Rebuild Project Notes #12 »« Rebuild Project Notes #10
Well, the data import can wait for a bit, I am going to try and get this CakePHP 1.2.6 stuff moved onto CakePHP 1.3. So consider this a post about migrating cake 1.2 to cake 1.3. I will start with a clean install of my local files to the remote server…
So far so good. I moved everything that was NOT in the config folder over…this gave me an app without any extremely glaring errors, but there are a couple of things to work out still.
I sent an email to a student in my class, it was about Cake and I think it deserves repeating.
so the thing to recognize here is that the cake folder contains a BUNCH of templates for you to use…basically the cake folder is a full-on cakephp application which you can copy from. if you want a new feature in your site, look through the cake folder to see if there is a model/view/controller that you can copy over and use, or at least copy over and re-use to start your own feature.
So yeah Cake is a very complete solution.
Having some troubles now with login in my CakePHP 1.2 to 1.3 migration…I even went into app/config/core.php and transfered the Security.salt value over…that did not fix things…
So a few problems…I think the thing to do is to remove my install…bring in the files which i updated into my master copy of the application…then once that is done clear out the htdocs folder, reinstall cake 1.3 RC4…bring the SQL file in…delete the database, run the SQL, then do cake bake once more….take those files and bring in my controllers’ actions by-hand. That SHOULD work.
Rebuild Project Notes #11 »« Rebuild Project Notes #9
So I am struggling with the Auth and Acl stuff once again today.
Tip for tots: always call the parent method when overriding a base class’ method. In my case, I needed to call parent::beforeFilter();.
I made good progress today. I went through almost all of the admin-side forms and made sure that everything was working. I learned a bit about how to use $this->set() properly in my controllers, and worked a bit with pagination. It wasn’t too bad.
I also tried to re-install my app from my source code. This is going well, but there are a couple of regressed bugs re-appearing in my site. In particular I am having trouble creating new subscribers. Their username/passwords are not getting setup when the create() method is invoked. This turned out to be a problem with my signup() form. The field names did not follow the naming convention…all lower-case with underscores for the word separators.
And I ran through the Paypal code again, which looks like it’s working just fine. So a pretty good day.
Rebuild Project Notes #10 »« Rebuild Project Notes #8
I was having some trouble with admin routing today. I made a nav.ctp element for a basic navigation and anytime that I went into any of my admin pages the links to Home/Login/Logout were borked. These were with the HtmlHelper::link() calls…the fix was to include ‘admin’=>false in the array of config params to the link() call.
I started to work through any part that I could. Was adding the Containable behavior to my models to try and cut down on the amount of stuff included in my query results. I finally got it figured out. I will write about it some more tomorrow. Up too late already and I have to be up early tomorrow for a trip to Philadelphia, for fun.
Rebuild Project Notes #9 »« Rebuild Project Notes #7
So I have 3 things I’d like to accomplish.
Migrate in some user data from joomla
This is interesting. I was going to start off with just a mysqldump style sql script import, for speed. Now I am starting to write some PHP to do this inside of cake. I think that I will need to do this anyway for the admin-side of my application.
I found lots of examples of this, including one which works with Excel.
I am currently trying to push as much of this into my model-classes as I can. So I am writing a Behavior based on the instructions here.
Get access to my jungledisk network drive on this dev server.
I wasted a lot of time trying to work through this. I think that I am going to try with the desktop edition tomorrow, just like I set this up on my mini 10. I needneedneed to access that network drive from all of my machines.
I setup an alias for safe rm (srm) and uploaded this bash script to make it work. I have to do more to make sure that I never lose work.
More tomorrow…
Rebuild Project Notes #8 »« PHP is Subpar…So Says its Creator
“I don’t know how to stop it, there was never any intent to write a programming language [...] I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way. ”
But what are you gonna do? Write C# in classic-ASP syntax? Have at it. I love C#. But PHP is the least-common-denominator. That is the saving grace of PHP. I don’t hate PHP, it is love/hate.
http://en.wikiquote.org/wiki/Rasmus_Lerdorf
Rebuild Project Notes #7 »« Rebuild Project Notes #7
Ok, after a few days of being a party animal, I am back on the job.
It seems like my project is working out…I’m not entirely sure that I even need to extend the built-in AuthComponent…
It looks like it will be enough to just add in a beforeFilter() call to my Controller. This will call a function that checks the user’s cookies and the Joomla database to determine if the user has an active session.
It seems TOO easy. I am relatively confident now. This was the second BIG THING that I was trying to work through. This is a a good milestone.
I can start to work on all the rest of the stuff that will go into this project now. This behind-the-scenes stuff never impresses the client as much as the razzle-dazzle front-end bullshit.
The rest is just typing…
PHP is Subpar…So Says its Creator »« Rebuild Project Notes #6