AppFog is a cloud hosting platform and they are offering unlimited applications with in 2GB RAM usage. This is the best place to experiment your projects, specially for beginners. This post explains you how to setup an application and upload files into the AppFog hosting platform.
Live Demo
Just create an account at AppFog.com and then you will find out the following screens.
Step 1
Choose an application technology.
Step 2
You can choose a cloud platform.
Step 3
Choose a subdomain
Mission Control
Here you can control the application instance.
Services
Choose database service.
CName Configuration
Go to your domain registration website and choose DNS settings and add new CName record.
Domain Names
Ruby
Install rubyinstaller for Windows
Update Source Code
Start -> Ruby -> Start Command Prompt
// Install appfog
C:\>gem install af
// Create a sample folder
C:\>mkdir test
// Copy files into test directory.
C:\>cd test
// AppFog Login
C:\test>af login
Attempting login to [https://api.appfog.com]
Email: [email protected]
Password: *******
// Upload files into AppFog could.
C:\test>af update app_domain_name // Eg: 9lessonsdemos
C:\>gem install af
// Create a sample folder
C:\>mkdir test
// Copy files into test directory.
C:\>cd test
// AppFog Login
C:\test>af login
Attempting login to [https://api.appfog.com]
Email: [email protected]
Password: *******
// Upload files into AppFog could.
C:\test>af update app_domain_name // Eg: 9lessonsdemos
dbconfig.php
Database configuration file for MySQL service.
$services_json = json_decode(getenv("VCAP_SERVICES"),true);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
$username = $mysql_config["username"];
$password = $mysql_config["password"];
$hostname = $mysql_config["hostname"];
$port = $mysql_config["port"];
$db = $mysql_config["name"];
mysql_connect($hostname,$username,$password);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
$username = $mysql_config["username"];
$password = $mysql_config["password"];
$hostname = $mysql_config["hostname"];
$port = $mysql_config["port"];
$db = $mysql_config["name"];
mysql_connect($hostname,$username,$password);
wp-config.php
If you want to setup Wordpress, just find and modify wp-config.php with below code.
$services_json = json_decode(getenv("VCAP_SERVICES"),true);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
define('DB_NAME', $mysql_config['name']);
define('DB_USER', $mysql_config['user']);
define('DB_PASSWORD', $mysql_config['password']);
define('DB_HOST', $mysql_config['hostname']);
define('DB_PORT', $mysql_config['port']);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
define('DB_NAME', $mysql_config['name']);
define('DB_USER', $mysql_config['user']);
define('DB_PASSWORD', $mysql_config['password']);
define('DB_HOST', $mysql_config['hostname']);
define('DB_PORT', $mysql_config['port']);
This is intresting...
ReplyDeletehello, is this have a ftp access, or by command prompt only?
ReplyDeleteThanks for this share Srinivas.
ReplyDeletecool
ReplyDeleteGood, thanks.
ReplyDeletethats great
ReplyDeletethanks for this... very helpful...
ReplyDeleteGreat to know about new APPFog Free hosting tool.
ReplyDeleteSrinivas Tamada, you are very good writer, but it is very long time to see you here.
This is really cool..
ReplyDeleteNice...Very helpful
ReplyDeletenice one there
ReplyDeletevery informative post :)
ReplyDeleteNice one. Could you please tell me how can I upload existing database dump?
ReplyDeleteHi. Found this useful. Can you write how to use af command in Linux. It isn't working on Linux.
ReplyDeleteits cool
ReplyDeletegrat.....
ReplyDeleteyeah, i'm using it right now..
ReplyDeletevery nice lesson
ReplyDeleteThanks for sharing, works for me!!!
ReplyDeleteError : <?xml version=”1.0” encoding=”u….
ReplyDeletei getting this error when i uploading php files can any one face the same problem .if any one with the solution please let me know .
Srinivas please help me if have solution of it
Error : <?xml version=”1.0” encoding=”u….
ReplyDeletei am getting this error when uploading a php project . if any one getting the same problem and have a solution please help.
Srinivas if u have any idea of the problem please share.
thanks for sharing does they support asp hosting as well?
ReplyDeleteGreat discovery;)
ReplyDeleteits really awesome
ReplyDeletei tried wordpress its working
thanks Srinivas for the info
is this free for life
In dbconfig.php
ReplyDeletethe username, password, hostname etc etc are given by Appfog or we can give our own information.
i think it will be useful when we have domain na
ReplyDeleteHo to configure and update existing database of mysql in for using ruby application to Appfog.
ReplyDeleteThis Information about Free Hosting is very useful for us. This is appreciated by my kind of new beginners. Thanks.
ReplyDeleteFinding a good web host is a task full of hazels. AppFog is really a good cloud hosting platform and the best thing about their service is they are offering unlimited applications with in 2GB RAM usage.
ReplyDeleteOh ...Very helpful.
ReplyDeletePlease help.
ReplyDeletewhen i'm applying this step "C:\test>af login"
i'm getting this message.
C:\test>af login
'af' is not recognized as an internal or external command,
operable program or batch file.
Note: Ruby192 was already install in my system.
Srinivas,
ReplyDeleteNice job. This was much more helpful than the quickstart at appfog.
need hosting website for java or jsp, will u pls say
ReplyDeleteIt is good plataform to learn but don't like because AppFog Doesn't have a persistent file system. you can't upload images or files with your CMS
ReplyDeleteeverytime i edited a file, i upload all project, how can i change that?
ReplyDeleteeverytime i edited a file, i upload all project, how can i change that?
ReplyDeleteis there anyone can help me?
How to add custom domain. It shows error while add custom domain.
ReplyDeleteI have purchased the theme from Name.com, how can I deal with it? can you please let me know
ReplyDeletenice...!
ReplyDeleteIt's no longer free
ReplyDelete