I’ve decided to rebuild and modernize the Recipe Manager application using NodeJS, MongoDB, and AngularJS for the UI. I’m also testing out Bootstrap 3 to see how well it handles stacking for mobile devices. So far I am quite impressed, at least on Android. I’ve also moved the project out of my SVN repos and into my GitHub: https://github.com/rhythmicdevil/recipe_manager
Today I had to create a MongoDB sharding setup on 4 VM servers. One of the servers would be the primary shard and also contain the MongoS process and the MongoD configdb process. You can find out more about Mongo sharding here. There were some things that are not spelled out in the documentation and were not obvious to me so I figured I would list them here for reference.
I have been working on a version of the PHP class autoloader. I have a config file that sets up the path information for the program. Generally you would want to include the config and the includes file in the entry point of the program. Continue Reading
MongoDB and Node.js together is better than peanut butter and chocolate. In order to use MongoDB with Node.js you need to install the mongodb module. To do this use the Node.js package manager or npm for short. I had to install that separately, but its quite simple: http://npmjs.org/ to do. Continue Reading
I wanted to set up some virtual hosts in my local environment. I found this very helpful page. Here is the lesson in a nutshell.
Assuming Apache 2.2 is installed in the default location open the following file:
C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
Find the lines that read:
# Virtual hosts #Include conf/extra/httpd-vhosts.conf
and remove the comment (#) so that it looks like this:
# Virtual hosts Include conf/extra/httpd-vhosts.conf
This enables virtual hosting in Apache. Note that it also shuts down the default host.
Open the following Windows file:
You should see something like the following:
Duplicate the line (keep the same IP number) and name a new host, for instance recipemanager and save the file.
Open the following file (this is the file you just enabled in Apache:
C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf
Added the following:
<Directory c:/vhosts> Options Indexes FollowSymLinks AllowOverride All Order Deny,Allow Allow from all </Directory>
This propagates the permissions you set in the directive to cascade to all foldes in c:/vhosts which means you can set up all your virtual servers under c:/vhosts.
Because the default localhost is disabled you need to create that like this:
<VirtualHost *:80> DocumentRoot c:/htdocs ServerName localhost </VirtualHost>
This points localhost at c:/htdocs
Then you can create your recipemanager host:
<VirtualHost *:80> DocumentRoot c:/vhosts/recipemanager/site ServerName recipemanager </VirtualHost>
Reboot Apache. Place a test file in c:/vhosts/recipemanager/site
Navigate with your browser to http://recipemanager/<TESTFILENAME>
And you should see the rendered file.