Monday, January 10, 2011

The future. One vision. Memory sticks with our OS and programs terminal to the cloud

The cloud is the main working space and supercomputer. All you need to work is just a terminal. The role of a terminal can play any hardware that allows you to run your OS.

Everybody will have on a USB memory stick his terminal (OS). The terminal is an OS with all installed components of his choice. He can even cary with him OS VMware so he can switch between OSes. This is in fact our current computers. In fact even if you have a computer your drive is portable so you can plug it in another hardware that is going to work. SO you alwais will have your environment.

All his/her files program can be in Internet somewhere (cloud). He can keep as many files as he wants on his stick. The public places are ordinar computers that have some OS and browser. But everyone just plugs his stick and the system boots from his stik. He has his own environment everywhere on all hardware configurations. On your stick you can have Remote Access programs that allow you to connect to servers in internet and change something in the cloud. For the regular users all they will need is only a web browser and they will do everything trough the browser. They can have Web OS's on different URLs like "Lucid" for example or ExJS or another flash solutions.

One example:

I have created a bootable HBCD USB stick. I care with me only this stick on it I have all my programs passwords and things I can not share with anyone (my identity). When I have to work on somebodies computer I just plug the stick and reboot holdinf F2 (F11 - boot manager) during the boot. I load Windows or Linux from my stick. Once I have an operating system runing all I need is a remote connection to one of my servers if I want to develop web applications there. I have there the infrastructure. IDE's SVN or GIT etc. As a user I use a web browser to access my web mail, zoho for applications or desctop. So everythign is in the cloud. Not in only 1 central point. The memory stick is like my personality. On it I keep my private information, my passwords accounts etc. These files are ordinar text files so I don't need huge space. The memory stick can be even 1GB but it holds everythign you need to work.

Using the browser as a universal terminal to the cloud is even better. So you don't have to cary eneythign anymore. If everythign you do is spred on different servers in the cloud. You can move from one terminal (computer) to another all you need is just a web browser.

Thursday, January 6, 2011

Zend Framework on Portable Device Daily Use

The assumption is that you already have installed XAMP on a portable device. If not read my previous article on how to do that.

1) Stop any Apache IIS etc. httpd's on the system listening on port 80. Stop Skype just for any case. Do it from the Apache control Panel or Start->Control Panel->Administrative Tools->Services

2) Stop any running instance of MySQL server Start->Control Panel->Administrative Tools->Services Stop MySQL_Zend... for example

3) Insert your memory stick and make sure it shows up as a device

4) Start a terminal window (console) cmd.exe. Change the drive letter to the one assigned by the system. (for example G:) Type G:

5) type in the console
set PATH=/xampp/php
set ZF_INCLUDE_PATH=/xamp/php/pear
php --help
zf --help
az show version
pear help

make sure all these commands responde properly

you can create project add controllers etc.
zf create project /projects/MyProject
cd /projects/MyProject
zf create module Blog
zf create controller Post -m Blog
...
etc. Check Zend_Tool

6) Start Apache and MySQL by double clicking on the *.bat files from /xampp folder apache-start.bat and mysql-start.bat. You can close the opened by the *.bat files windows.

7) point your browser to 127.0.0.1 or localhost. Use the tools from XAMPP

Zend Framework on Shared Host Easy Simple Fast

1) Zip your project folder "myproject"

2) Start a console window cmd.exe. Go to your mysql/bin folder and dump your database into a file mysqldump -uroot -ppassword myprojectdb > myprojectdb.sql

3) Login to your Hosting company CPanel

4) Open the File Manger and create a folder "projects" in your home directory (/home/mydomain/). You should have /home/mydomain/projects

5) Upload the zip file from step 1 to your projects folder and unzip it there. remove the zip file. You will have /home/mydomain/projects/myproject

6) Open MySQL Databases from CPanel and create DB, User for your project and link the usr to the DB. You will end up having mydomain_myprojectdb as a database mydomain_myuser and grant all privileges ON mydomain_myprojectdb TO mydomain_myuser. You can change this later. All this done in CPanel MySQL Databases tool.

7) Open phpMyAdmin and import the DB from step 2. (myprojectdb.sql)

8) In the CPanel File Manager change the database, username, password in /myproject/application/config/application.ini file .

9) Create a subdomain to access the public folder of your project. In CPanel go to subdomains tool and enter as subdomain mysubdomain as a folder ~/projects/myproject/public/. "~" means my home directory on the system usualy /home/mydomain

10) Point your browser to http://mysubdomain.mydomain.com. If you can see the page - you are done. If you get error "Fail t load Zend/Auto..." that means yout hosting comapny doesn't have Zend Framework in the include path.

11) In the CPanel File Manager create a folder "library" in /home/mydomain/. So you will have /home/mydomain/library

12) Download the Zend Framework library or use yours and zip it for easy transfer. Use the CPanel file manager to uploaded to the folder /home/mydomain/library unzip it there and remove the zip file. So you will have /home/mydomain/libraryZend

13) Make a change in your public/index.php file and add to teh include paths the path to the library we just created. All our applications will share this library. Open public/index.php with the File Manager and add just after the include path section for "// Ensure library/ is on include_path"

...
// Ensure the common library/ is on include_path for my shared host
set_include_path(implode(PATH_SEPARATOR, array(
// realpath(APPLICATION_PATH . '/home/mydomain/library'), // for my shared host
realpath(APPLICATION_PATH . '/../../../library'),
get_include_path(),
)));
...


14) Refresh http://mysubdomain.mydomain.com. It should work now.

15) (Optional) If you want this project to be your main domain application move the content of public folder to your public_html forlder where the document root of Apache is pointing and change 1 line in your index.phtml file to point to the proper application folder.


// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../projects/myproject/application')); // change to point to your project folder


The usual filestructure is:
/home/mydomain/public_html - the folder where the Document Root of Apache points
/home/mydomain/library/Zend
/home/mydomain/projects/myproject

the folder where the subdomain points is
/home/mydomain/projects/myproject/public

For more details look my post "Zend Framework Shared Hosting" It is ready I just have to correct it a bit.

Tuesday, January 4, 2011

Zend Framework Realy Easy Simple Fast

1) Download and install XAMPP.
2) Start->Accessories->Command Prompt and type
zf create project c:\MyProject
3) Go to XAMPP installation folder and find the file httpd-vhosts.conf
xampp\apache\conf\extra\httpd-vhosts.conf
Add these lines

Listen 10099
<VirtualHost *:10099>
DocumentRoot "c:\MyProject\public"
<Directory "c:\MyProject\public">
Order allow,deny
Allow from all
AllowOverride all
</Directory>
</VirtualHost>

save the file
4) Start Apache from XAMPP Panel or restart it if it is already running to read the configuration file again
5) Point your browser to httP://localhost:10099 You should see the Zend blue new project welcome screen.

For more information read my blog Zend Framework Start in 2 easy steps . It is ready, I may publish it.