acloudtree

Category PHP

Agapage : A web startup

Agapage LogoWow!

As I write this, it is close to midnight, and this has been a common work hour for these last four months. I can’t believe that Agapage is finally here, that it is finally launching. A lot of work went into this endeavour and it seems surreal to sit here and watch as something you poured your heart into, has been brought to life.

There are a lot of people who made it happen, a lot of people who cared and suggested. Who steered and paved the way for Agapage’s completion. I am amazed and humbled that all these people believed in me.

If you are wondering what Agapage is, let me share.

* * *

Concept:

So I was sitting in Church back in February, when the Children’s minister came up on stage. She mentioned that the Church’s current 60 pager paging system (retailing for $3k) was no longer adequate. The church had grown and needed about 100 more pagers to meet its need. Unfortunately, the pagers cost about $90 a piece (totaling $9k).

Pagers are used to notify parents when their child is having an issue. It also helps the flow of the whole church service by finding parents easily.

For the rest of the service, my brain was in a trance. It started working on a solution, and that night I began coding the beginnings of it. I went to sleep wanting to think of a good name, and like clockwork, I awoke with the “a good name”. By the end of that week I had a semi-functional program (though it looked like crap), and thus Agapage* was born.

*Agapage is a combination of two words. Agape is the Greek word for unconditional love and page just means “to notify or make known”

So what does Agapage do?

Well, it allows the church or organization to have their own personal website.  And at their site, the organization members will register for an account (Same sign up process as in most online services). Once their account is created, the user will add all their parent or guardian information (Image, First Name, Last Name , Cell Phone Number), and they will add all their children’s information (Image, First Name, Last Name). Once all the information is filled out, the user will only have to go back into the system for routine maintenance.

Here is where it gets interesting. The staff at the church can log in, and if their credentials are correct, can now SEARCH for a child, pull up their record, and click the PAGE button. It will send a txt message to ALL the Guardian’s cell phones attached to the child. As the parent, you could also attach grandma, grandpa, auntie or uncle, and it would PAGE everyone.

Benefits:

  1. No hardware loss, theft, or maintenance. Basically the Organization doesn’t have to buy batteries or charge them, or order pager replacements.
  2. Piggy backs onto existing infrastructure. Most churches have laptops and wireless, and according to SNL Kagan, a leading mobile research firm. the U.S.A will reach 100% market saturation by 2013. That is one cell phone for every man, woman, and child. This affirms the thought that most families will have at least, 1 cell phone.
  3. Scalability
  4. No risk to the organization
  5. Not limited by distance
  6. Custom txt messages can be sent so that the Guardian gets some idea of what exactly is going on
  7. Pictures can be uploaded by the members so when staff or volunteers use Agapage to search, they can actually see who they will be paging

Standard System:

Startup = $3000
Annual maintenance = ($200 +/- N%) batteries and replacement units
Growth = ($90 +/- N%) per additional unit as well as annual maintenance going up rapidly

Total = Anitoch’s projected cost in just under 4 years of existence > $10k

Scalability:

I was reading about a large church in the Detroit area, they grew from 1997-2005. At it’s height, the church attendance was over 4000 people. I speculate their paging system (600-800 pagers) would easily have cost them $50k over that 7 year period. Now the church is in decline because there is a mass exodus from the area as people leave in search of jobs. The church’s numbers are way way way down. With Agapage, instead of having the church’s money tied up in a large piece of infrastructure, they could just scale back their usage and pay less.

And it works in the other direction, seamlessly scaling as your Organization grows.

Basic Goals:

  1. My church needs it, so I know it will get used if only by one organization
  2. Resume / Portfolio weight
  3. Low startup cost and NO debt (If I wasn’t a programmer this would not be the case)
  4. Potential to show a proof of concept along with case study and prove/see if there actually is a NEED in the world

* * *

So that is Agapage, and I hope anyone or organization that needs it, will see it’s value. The best thing is that I am saving people a lot of money in a recessionary environment, while also offering a superior product. I feel really good about that.

-jared

http://www.agapage.com

(Nerd) How to: Setup Virtual Hosts on Ubuntu 9.10 using Apache2 + MySQL5.X + PHP5

I have been working on a couple projects that are hosted on gitHub. As the scale and scope of the projects grow, I ended up needing to setup multiple virtual hosts on my development machine. It wasn’t hard, but the information online that I found was fairly dated, so I created this tutorial.

This entire tutorial is done after entering the ‘sudo -i’ command which allows us to act as the SUPER-USER for the entirety of our terminal session. You’ve been warned.

sudo -i

NOTICE!!! I am aware that we could use the ‘a2ensite’ and related commands. But for the sake of understanding the entire process, I will not be using it.

1) Install the required modules from the command line

apt-get install apache2 mysql-server mysql-client php5 php5-cli php5-mysql

2) Change the directory to /etc/apache2/sites-available

cd /etc/apache2/sites-available

3) If you run the ‘ls’ command while in the sites-available directory you should see the following

ls

Output

default  default-ssl

4) Copy the ‘default’ config to a site specific config. For this tutorial I am using dev.acloudtree.com.

cp default dev.acloudtree.com.conf

5) Make the application directory

mkdir /var/dev.acloudtree.com

6) Open the file with an editor of your choosing. I prefer VIM.

vi dev.acloudtree.com.conf

The output below is the entire file but I will discuss certain parts that we will need to edit.

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
 
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
 
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
 
        ErrorLog /var/log/apache2/error.log
 
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 
        CustomLog /var/log/apache2/access.log combined
 
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
 
</VirtualHost>

7) Add the name of the server. This will be the name that you type in the URL field of your web browser (IE: Firefox)

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
	ServerName dev.acloudtree.com
...

8 ) Point the Virtual host to the correct directory

...
        DocumentRoot /var/dev.acloudtree.com
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
...

9) Also make the change here.

...
        <Directory /var/dev.acloudtree.com/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
...

10) So this is what your dev.acloudtree.com.conf file should look like when you are done. Write/Quite the file and we will move on.

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
	ServerName dev.acloudtree.com
 
        DocumentRoot /var/dev.acloudtree.com
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/dev.acloudtree.com/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
 
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
 
        ErrorLog /var/log/apache2/error.log
 
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 
        CustomLog /var/log/apache2/access.log combined
 
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
 
</VirtualHost>

10a) IMPORTANT! Make a symbolic link in the sites-enabled directory

ln -s /etc/apache2/sites-available/dev.acloudtree.com.conf /etc/apache2/sites-enabled/000-dev.acloudtree.com.conf

11) We need to edit our /etc/hosts file

vi /etc/hosts

Output

127.0.0.1       localhost 
127.0.1.1       servername
 
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

12) Right beneath the ‘localhost’ definition, add the following

127.0.0.1      dev.acloudtree.com

13) The complete file looks like this.

127.0.0.1       localhost
127.0.0.1       dev.acloudtree.com
127.0.1.1       servername
 
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

14) Create an index.php file in /var/dev.acloudtree.com for testing purposes.

vi /var/dev.acloudtree.com/index.php

Contents of .php file.

<?php
 
        echo 'Jared Folkins\' tutorial on acloudtree.com really works!';
        phpinfo();
 
?>

15) Reboot the apache2 process.

/etc/init.d/apache2 restart

16) Now open up your web browser and enter dev.acloudtree.com into the URL bar and it should work!

UPDATE: I forgot to mention that in this environment, I like to configure log files for each virtual host. This is our current dev.acloudtree.com file.

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
	ServerName dev.acloudtree.com
 
        DocumentRoot /var/dev.acloudtree.com
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/dev.acloudtree.com/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
 
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
 
        ErrorLog /var/log/apache2/error.log
 
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 
        CustomLog /var/log/apache2/access.log combined
 
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
 
</VirtualHost>

Just change the ErrorLog and CustomLog names to match the virtual host.

...
        ErrorLog /var/log/apache2/dev.acloudtree.com_error.log
 
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 
        CustomLog /var/log/apache2/dev.acloudtree.com_access.log combined
...
</VirtualHost>

(Nerd) Ubuntu + Vim + ZendFramework-1.9.2 + .pthml syntax highlighting

1) From the command line ‘cd’ to your ‘home’ directory


test-box@jbuntu:~$ cd

2a) Check to see if the .vimrc file exists


test-box@jbuntu:~$ ls .vimrc

If the terminal outputs nothing, then that means the file does not exist.

2b) If you get the following


test-box@jbuntu:~$ ls .vimrc
.vimrc

It means that the file does exist and we just need to edit it.

3) If the file does not exist just ‘touch’ the file. If it DOES exist, just skip this step.


test-box@jbuntu:~$ touch .vimrc

4) From this point, ‘vi’ the ‘.vimrc’ file. You primarily need the following lines and you are more than welcome to copy/paste. Write/Quite when finished.


if has("autocmd")
autocmd BufEnter *.phtml set syn=php
endif
syn on

Now the next time you open VI it should have the desired highlighting for .phtml files found in the Zend Framework.

Below is my ‘.vimrc’ file in it’s entirety. Just for the record. It also allows for syntax highlighting to occur in CakePHP .ctp files along with some other settings that I prefer.


set tabstop=2
set shiftwidth=2
set expandtab
if has("autocmd")
autocmd BufEnter *.ctp set syn=php
autocmd BufEnter *.phtml set syn=php
endif
syn on
set ai

Let my dataset change your mindset

If you follow the link provided. It will take you to a brilliant video by Hans Rosling. My hope, is that anyone watching at least begins to understand the power of data. Maybe not the exact method to manipulate the stuff, but at least the desire to know more about it.

This video is quite timely for me. For I have thought long and hard about putting together a series of posts on data analysis. Particularly on the work I have done in looking at the Deschutes County Clerks Data.

For those of you who don’t know. In the fall of 2007 I created a program that went to the county website and would pull public records and sales data concerning housing. It would throw this data into a usable database.  And I would use this data to educate family and friends on when our housing bubble was started, and how bad it really was.

I built a small website with this data, but stopped my work on it because of several complex reasons.

Anyway, if people are interested in how to analyze data, or would appreciate an ongoing conversation about it, let me know.

Copyright © Jared Folkins
Programming, Computers, Writing, Economics, and Life

Powered by WordPress