Heroku Free PHP Hosting-512MB Ram,custom domains and WordPress on Heroku

Heroku is a cloud platform as a service(PAAS),and has been around since 2007.It is popular due to its support for variety of languages, including Ruby, Python, Java, Node.js, Scala and PHP. Heroku supports an ephemeral filesystem. This means that installing plugins or addons should be done and tested locally.

In this tutorial we will be hosting a WordPress blog on Heroku. It will require the same procedure as involved in setting up PHP application.Heroku will provide you with a URL of the form yourapp.herokuapp.com. You can bring your own domain name and attach it to this URL.

 

For more Free PHP Hosting,you will like:

  1. Openshift Free PHP, MySQLand phpMyAdmin Hosting-512MB RAM and 1GB disk
  2. SourceForge.net project web service-Free Web Hosting with PHP, MySQL,SFTP

How to Deploy WordPress on Heroku With Heroku-WordPress template

Sign up for a free Heroku account. Go to Website:https://www.heroku.com/,and sign up for free.

 

In the Dashboard,Click ’new’to create a new app.

 

Then Set App Name ,Runtime Selection (Your app can run in your choice of region in the Common Runtime).

 

In Personal apps ,You can set Overview ,Resources ,Deploy ,Metrics ,Activity ,Access ,Settings .

 

There are three Deployment methods to Deploy app on Heroku:Heroku Git (Use Heroku Toolbelt),GitHub (Connect to GitHub),Dropbox (Connect to Dropbox).

Deploy using Heroku Git 
Install the Heroku Toolbelt.Download and install the Heroku Toolbelt or learn more about the Heroku Command Line Interface. 
If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.

$ heroku login

Create a new Git repository
Initialize a git repository in a new or existing directory

$ cd my-project/
$ git init
$ heroku git:remote -a howsvps

Deploy your application
Commit your code to the repository and deploy it to Heroku using Git.

$ git add .
$ git commit -am "make it better"
$ git push heroku master
--------------------------------------------------------------------------------

Existing Git repository
For existing repositories, simply add the heroku remote

$ heroku git:remote -a howsvps 

In Setting,You can change App’s Name,Config Variables .

 

You could see app Info:Region \Stack \Framework \Git URL \Repo size \Slug size .

 

Deploy WordPress Build Pack With Heroku-WordPress template

  • 1. https://heroku.com/deploy?template=https://github.com/technomile/Heroku-WordPress
  • 2. https://heroku.com/deploy?template=https://github.com/ellefsen/wordpress-heroku-php/tree/master

Go to Heroku-WordPress and set app name.

 

Config Variables ,You should set up AWS account.Keys marked with * require a value.

 

Deploy WordPress on heroku successfully .

 

You should now be able to finish WordPress setup .

 

Heroku-WordPress template Add-ons include:ClearDB MySQL(Ignite,Free ),SendGrid(Starter,Free ),MemCachier(Developer,Free ),Papertrail(Choklad,Free ),New Relic APM(Wayne,Free).

 

WordPress on Heroku.

 

How to Deploy WordPress on Heroku With Heroku toolbelt

In this tutorial, I’ll be deploying WordPress, that we’ll deploy on Heroku using the toolbelt.

 

Set up Heroku Toolbelt.,PHP,Composer,Git

Before you continue, check that you have the prerequisites installed properly.Firstly you should install the Heroku Toolbelt,which provides you access to the Heroku Command Line Interface (CLI).

 

Heroku Toolbelt support for Mac OS X,windows,debian.On Windows, start the Command Prompt (cmd.exe) or Powershell to access the command shell.Using :heroku login to Connect to Heroku account.

heroku login
Enter your Heroku credentials.
Email: dz@example.com
Password:
...

Then type each command below and make sure it displays the version you have installed(How to LNMP:How to use OneinStack to deploy LEMP/LNMP/LAMP on VPS).

#php 
php -v
PHP 7.0.5 (cli) (built: Apr 26 2016 04:39:48) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

#composer
composer -V
Composer version 1.1-dev (135783299af0281db918c103cceb2b202ae154f2) 2016-07-27 13:14:01

#git 
git --version
git version 2.2.1

Deploy WordPress on Heroku Guide,Run the following from the terminal:

 
git clone git@github.com:bkvirendra/wordpress-heroku.git #Clone the repository as `wordpress-heroku`
cd wordpress-heroku
heroku create
heroku addons:add heroku-postgresql:dev  #add the database add-on to your app
heroku pg:promote HEROKU_POSTGRESQL_COLOR_NAME --app APP_NAME #promote the database attached to the app

Now edit the `wp-config.php` file and update the unique keys:

define('AUTH_KEY',        		 'put your unique phrase here');
define('SECURE_AUTH_KEY',  	'put your unique phrase here');
define('LOGGED_IN_KEY',    		'put your unique phrase here');
define('NONCE_KEY',        		'put your unique phrase here');
define('AUTH_SALT',        		'put your unique phrase here');
define('SECURE_AUTH_SALT', 	'put your unique phrase here');
define('LOGGED_IN_SALT',   	'put your unique phrase here');
define('NONCE_SALT',       		'put your unique phrase here');

Commit the files:

git add .
git commit -m “first wordpress commit”
git push heroku master

Conclusion

Images and files on Heroku are temporarily and deleted when your dyno is restarted.As a workaround you can subscribe to AWS storage and write a bit of code which saves media on AWS instead of Heroku when you upload the file.

 

For instance, when you upload images or install plugins it will store them in the wp-content folder, but heroku is read only, so your data will be deleted every time the server reboots.

Setup AWS – S3 to store images on heroku.

Log In from AWS services dashboard select Identity & Access Management to create a user.Click on Users then click on Create New User in input type nameofapp click create to generate special keys and save the keys keep in safe place.

 {
    "Version": "2016-07-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::BUCKETNAME",
                "arn:aws:s3:::BUCKETNAME/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": "s3:ListAllMyBuckets",
            "Resource": "arn:aws:s3:::*"
        }
      ]
   } 

Going to the app/settings config vars click edit and name and insert keys. example use AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY this will be called from your wp-config.php file in your app so the variables should be named the same.

Setup Sendgrid to send emails from wordpress on heroku.

Your sengrid username password in app/settings config vars.Simply copy those sendgrid vars and navigate to Sendgrid in wordpress dashboard and paste them in the username password inputs there and save.

Openshift Free PHP, MySQLand phpMyAdmin Hosting-512MB RAM and 1GB disk

OpenShift is a platform-as-a-service from the open source leader, Redhat.OpenShift’s hosting platform makes it easy to run container-based web application in the cloud, and it has a free tier, which has enough power to create a WordPress site.

Openshift Hosting free account doesn’t have a time limit  and it doesn’t require a credit card to sign up.For a free account with OpenShift, you get 512MB RAM and 1GB storage. You can use your own domain name for your WP site.

You can host a WordPress website free of charge on OpenShift, an open source PaaS service by Red Hat. It’s truly free and can be set up using your own domain name. The free hosting is good enough for small or personal sites without big traffic.

More Free Web Hosting:

Create An OpenShift account and Application

1. OpenShift is just a PAAS like many others,comes with a free plan of 3 small gears.Small gears provide 512MB RAM and 1GB disk quota under the free plan.You need to get a OpenShift hosting account, which can be signed up for free.

OpenShift website:https://www.openshift.com/

2.Just go to Openshift website and register using your email, no credit card is required.

3.Log in to the online console of OpenShift.Choose Applications from the top menu.

4.Choose a type of application.Choose a web programming cartridge or kick the tires with a quickstart.

5.After clicking on QuickStart its start a new page where some essential settings for your QuickStart, Enter your application name, OpenShift will automatically register this domain name for your application. You can add your own domain name later.

6.After setup, it’s open a page where you find your credentials. Please make note of database credentials for your application.

Get Your Openshift WordPress Up

1.You’ve started a WordPress application on OpenShift ,but it’s still not completely configured.We need to configure the necessary options. Choose Applications from the top menu.

2.Click on your app’s public URL given at the top.

3.Open your Blog URL and its open WordPress Famous Five Minute Installation.

4.Setup All Setting:Site Title,Username,Password,Your E-mail.

5.Click on the ‘Install WordPress’ button. WordPress should greet you with success!Your Blog is now Ready to Show.

6.Congratulations for successfully setting up your free WordPress blog.Openshift WordPress WP admin web interface .

Openshift Mysql and PHPmyAdmin

1.Openshift WordPress is composed of cartridges – each of which exposes a service or capability to your code.

2.Click PHPmyAdmin 4.0 to add to you Openshift WordPress .

3.Go back to application page,You can see PHP 5.4 , MySQL 5.5 and PHPmyAdmin 4.0.

4.Once it’s installed, launch it, you will be asked for MySQL username/password.Managing a MySQL database with phpMyAdmin.

Attach Your URL In OpenShift WordPress Blog

1.On your app summary page, next to your URL, there’s a small link “change”. Clicking on that link will take you to a page where you can set up your own domain name.

2.Then, you need to set up a CNAME record with your DNS provider.

3.Go to WordPress Dashboard and select Settings >> General. Change WordPress Address(URL) and Site Address(URL) with your new domain.

Connect to OpenShift server with putty (ssh)

2.First download PuTTY and PuTTYgen:http://www.putty.org/.Open PuTTYgen and generate an SSH-2 RSA key with 2048 bits.

3.Then,Open OpenShift settings page to add your newly generated Key.Click on Add new key… button.

4.On next page, you paste your public key .

5.Open your WordPress Application page which was created in the previous tutorial.Copy Source Code.

6.Now open putty and past it there.

7.Go to Connection -> SSH -> Auth and set Private key file for authentication.

8.Now save putty session and connect to OpenShift application.

Connect to OpenShift server with Winscp

1.OpenShift requires rch setup for communicating with your OpenShift application but it’s difficult to step for a newbie to setup this using git. Using below steps, you can setup SFTP in the easiest way.

2.Open winscp:File protocol-sftp(select from dropdown),Hostname: your  SSH Address,Username:your username for openshift(the full email id),Password: your openshift password you use to login.

3.Private key: select the .ppk file (generate by putty key gen) for authentication.

4.After login,you can drag and drop your war files and do whatever you want in the servers directory.Everything will be live updated and deployment will be reflected live.

Conclusion

Now, you’ve a fully functional WordPress website that’s hosted for free on Openshift and you’ve full access to your gear in case you want to access anything. OpenShift suggests installing a WordPress plugin that stores all media files to a third party service such as AWS S3 or Dropbox.

By default, such emails will have a sender address like no-reply@rhcloud.com, which tends to be delivered to people’s spam folder. OpenShift suggests using third-party email services such as SendGrid (can be signed up and used for free) to handle emails.

SourceForge.net project web service-Free Web Hosting with PHP, MySQL,SFTP

SourceForge is a free and well-established open-source project repository. It currently hosts over 430,000 open-source projects.SourceForge allows you to store your project’s source code under revision control. SourceForge can provide you with a Git, Mercurial, or Subversion repository.

All open source projects may use free web hosting with PHP and MySQL.You can set up web pages to describe your project – SourceForge can host your web site for you with sourceforge.net subdomain or your own domain name.

SourceForge.net project web service support for PHP, Perl, Python, Tcl, Ruby, and shell scripts. You can upload to SF through a SFTP client. You also get the option of using Git, Subversion (SVN) and Mercurial (Hg) .

SourceForge Project web servers frequently handle more than 50M hits per day.

The project web platform has been standardized on CentOS 5.x Linux, running Apache 2.2.x.

Support for PHP (via mod_php), Perl, Python, Tcl, Ruby, and shell scripts.

Support for MySQL , DBM, and SQLite.

Project web content may be uploaded using File management service or be managed directly using our Shell service.

Each project is allocated the UNIXNAME.sourceforge.net VHOST (virtual host), which is used to serve their project web content.

Common web server features are provided, such as mod_rewrite, Server-Side Includes (SSI), HTTP Basic Auth, and custom error handler support.

In this article I will provide an overview of SourceForge.net project web service and the free web hosting features.More free web hosting read:Free Vultr servers-VULTR $50 gift code for new account Linux & Windows VPS.

 

Set up a SourceForge account

SourceForge.net project web service allows you to host HTML content, expose Doxygen or JavaDoc API documentation or create an informative and enticing entry point for your project.

 

Before you can create a project on SourceForge, you’ll need an account.

 

Visit https://sourceforge.net.Click Create,Enter your name, email address and select a user name.

How to Create a SourceForge project

Click My profile and my projects,Enter a project name and a URL,Select your initial set of tools e.g. forums, blog, wiki, tickets, and your preferred revision control tool e.g. Git or Subversion.

SourceForge will automatically create for you a project site available via a URL determined by your project name, e.g. http://sourceforge.net/projects/howsvps .

 

SourceForge Custom VHOSTs and Mysql

Project web sites may additionally be served using a domain you register. SourceForge.net will route this traffic to your project web site when configured through Custom VHOST service.

Connecting to Sourceforge.net MySQL database.

You can create Mysql database with PHPMYADMIN .

SourceForge File Transfers

In addition to using the web based File manager, SourceForge also provides access to various filesystems using the ssh protocol suite for securely managing content for your project using SCP, SFTP, and rsync.

You can log into SourceForge and upload web pages using secure FTP.

Connection Settings:

Host: web.sourceforge.net
Protocol: SFTP
Port: 22
Username: Your Login Name (User Name) 
Password: Your Login Password
Upload path: /home/project-web/youproject/howsvps 

You may perform a basic copy operation to transfer a file from your workstation to the remote server.Click on the remote server pane, and change to the desired destination directory,Click on the filename of the file and drag it from the local workstation page to the remote server pane.

Uploading Project web content using rsync.An example session might look like (where Username=”howsvps”, Project URL name=”youproject”):

Host: web.sourceforge.net
rsync -avP -e ssh site/ howsvps@web.sourceforge.net:/home/project-web/youproject/htdocs/
building file list ... 
4 files to consider
./
image1.png
       73342 100%   38.69MB/s    0:00:00 (xfer#1, to-check=2/4)
image2.png
       34694 100%   33.09MB/s    0:00:00 (xfer#2, to-check=1/4)
index.php
          50 100%    4.07kB/s    0:00:00 (xfer#3, to-check=0/4)

sent 108369 bytes  received 92 bytes  5862.76 bytes/sec
total size is 108086  speedup is 1.00

Conclusion:

SourceForge.net has a totally different project structure when compared with GitHub. You can only create projects with a unique name. SF unlike others, also lets you host both static and dynamic pages, with the option of integrating a CMS too.

I know you wish to keep your budget minimal and instead of going to free one, you should opt for some of the cheapest hosting, which offers quality service at very reasonable amount.RamNode\Linode\host1plus\BandwagonHost.