Zend Server is well known to be a premier PHP Application Server for enterprise production class applications.
But why shouldn’t ALL PHP application deployments enjoy the same level of production quality, performance, and management?
Historically, you either paid big bucks for dedicated / managed hosting, or you paid $9.99 per month for a shared hosting account and gambled on the quality of service you would recieve.
If, as you read the following, it has the flavor of an endorsement, I don’t mean it to be so, but it’s ok if you finish this article with that impression.
Though all hosting companies are welcome, in fact encouraged to support Zend Server, I have a personal experience with A2 Hosting that spans nearly a decade, so it only made sense that when I decided to encourage shared hosting companies to collaborate with Zend in regards to offering Zend Server to their shared hosting account customers, it only made sense to start with the hosting company whose quality of service I knew best.
I’ve hosted my personal blog (www.MisfitGeek.com) for many years. In fact I’ve hosted several sites with A2 for nearly a decade. Somehow, however, it had escaped me that in the vast selection of hosting services offered by A2, they already offered Zend Server 5 CE (Community Edition), which has now become Zend Server 6 Free Edition.
It makes great sense for hosting companies to offer Zend Server 6 in their VPS environments. Not only is Zend Server highly performant but Zend Sever helps increase security by keeping you PHP stack up to date. Zend Server‘s monitoring and trouble shooting features help identify issues before they become problems and help developers eliminate those problems as quickly as possible. That’s good for developers and the companies that host their application servers.
What follows here is a complete walk-though for getting Zend Server up and running in a low cost VPS instance at A2 Hosting. Other hosting companies are likely to have similar installation process and we’ll be adding a page here on Zend’s Developer Zone to list hosting companies that support Zend Server so that PHP developers can easily find them. (If you’re a hosting company that is interested, please email Joe – at – Zend.com)
Start buy pointing your browser at the A2 Hosting Zend Server page.
Then click on the “Learn More” button.
This functionality is incredibly useful and unique. I can dynamically configure my new VPS instance and see the adjusted price based on the options that I select until I arrive that the configuration that best suits my needs.
This VPS (Virtual Private Server) instance will be used to host my blog. Though I can select the Linux distro to be used in my VPS from any of the most popular ones, I want to choose CentOS since it is the “Enterprise Linux Server” that is closest to Red Hat Enterprise Linux. I’ve used CentOS to host my blog at A2 Hosting for many years and have been more than satisfied with the stability.
However I will tweak a couple of the configuration options.
Since I’ve been blogging for a decade and post video and audio files on my blog, I want to add a bit of disk space so that I have some room to grow (though I can always re-configure these options at any time I need to increase them).
Also, though 512mb is plenty to run a WordPress instance, my site uses a ton of plugins to I’m going to treat my users to a bump in performance by increasing the memory of my VPS instance to 1024mg.
Another interesting option that I intend to upgrade to in the future is to host my VPS instance entirely on SSD storage. (Read more here.)
Click on the “Order Now” button to proceed.
Next I need to choose a domain name. I can register a new one if I choose but since I’ll be moving MisfitGeek.com to this instance I’ll specify that one.
Select “Click to Continue”.
Here we have two choices to make. First is the billing cycle. As with most service accounts, the longer the cycle you choose, the greater the discount that you will receive.
The more important choice here is whether or not to select “Auto Quickinstall” to automatically install Zend Server 6 when the VPS instance is provisioned, or to select “None” and manually configure Zend Server 6.
I’ll show you how to do both. Make your choice in the “additional options” section. If you choose to auto install Zend Server 6 you can do so and skip the manual configuration steps below.
Alternatively you can select “none” and perform the manual configuration.
At this point you will proceed to the billing process. When you have completed the process you will receive an email with your account information.
Point your browser at my.a2hosting.com
Then log in to your A2 Hosting Account.
Here is what mine looks like.
Because I already have other hosting accounts at A2 Hosting, my account services list shows all of my services but your account screen will only show the VPS instance that you just created. I’ll select the VPS hosting instance that I just created and click the “Manage” link for that instance.
Note the entries in the “Server Control Panel” where the account credentials and the SSH port number for your VPS instance appear. We’ll use these later.
Click the “Login” button.
Don’t skip this step !!!
Note the “Controls” section at the bottom of the page.
We want to change the “Root Password” and the “Console Password” to passwords of our own choosing.
Next we will log in to our VPS instance via SSH. SSH or Secure Shell is innately available on Apple Mac OSX and every Linux distro that I’ve ever used. Alas, it is not available on Microsoft Windows by default.
If you are a Linux wizard then using SSH may already be second nature to you, but I will walk though the steps here for completeness, as many PHP developers, especially Web Developers on Windows ,will be new to administering Linux via command line tools. As a former GUI Head myself I’ll even offer fellow former Windows folks a few tips to ease your transition.
If you don’t have access to a Linux or Mac machine you can install an SSH client for Windows. The most common SSH client for Windows is PuTTY. If you are following along you should install it now before we continue.
Next, open a terminal session (or PuTTY).
From this point forward I will assume you are using a Linux or Mac terminal (my screen shots are from a Mac) but the commands should be pretty mush the same if your on Windows).
Now, a note here for folks that are new to the details of public web site management.
You will recall that in the steps above where I signed up for my VPS account I was required to specify what domain name I would use. I specified www.misfitgeek.com.
In order for www.misfitgeek.com to resolve to my new VPS instance I will need to change the “name servers” at my domain name registrar.
The account creation email that you received would have contained the DNS name servers that you would use at your domain name registrar.
I use BulkRegister
Your domain name registrar will likely have a similar function to the one you see above in its control panel.
When I’m ready for www.MisfitGeek.com to start resolving to my new VPS instance, I’ll change the name server designations at my domain name registrar to the once specified in my “new account email”, but I don’t want www.MisfitGeek.com to start resolving to my new VPS instance until I have all my content moved so that my blog readers will not experience any down time.
So, rather than connect to my VPS instance with via my specified domain name, I will connect via the IP address assigned to my VPS instance.
To connect I will go to the terminal session that I opened above and enter the following command.
ssh -pMYPORT firstname.lastname@example.org
Where “MYPORT” is the SSH port specified for your VPS instance (found in the steps above) and 220.127.116.11 is the actual IP address of your VPS instance.
You will be prompted for a password. This is the password that you specified for the root user in the previous setup steps.
After entering your password and hitting return you should be logged in to your VPS.
Make note of two items in the terminal window above.
First is that I have obscured the IP address and host name for security purposes since I’m taking screen shots from my actual account.
Second are the text instructions for manually running the QuickInstaller.
You don’t need to do this is you auto-installed Zend Server, if you did, you can skip forward at this point.
Otherwise, to install Zend Server 6 manually, execute the command as such.
Select number “5. Web/Application Servers”
Select “8. Zend Server 6″
When the QuickInstaller has finished installing Zend Server 6, take careful note of te instructions provided by it.
Since I have not yet configured my name servers I will be using the IP address of my VPS to test and administer by Zend Server.
Let’s test out our PHP stack first though.
Point your browser as the IP address of your VPS instance. Here is what I get when I navigate to mine.
Above you see the default Apache page on CentOS. That’s just static HTML so we know Apache is serving pages via port 80 on my VPS instance but lets make a custom PHP test page to confirm that my VPS is also processing PHP..
In order to do that we must create an “index.php” page, and THAT will require the use of a text editor.
Again, if you’re an experienced Linux user then using the “vi” editor is probably familiar to you, but if you are new to Linux or Unix, then getting started with a non-Gui text editor can be quite daunting. The default text editor on Linux is “vi” and vi has a very steep learning curve !
Since we’re working remotely on our VPS instance running CentOS, which is terminal based and not GUI based we can’t run the GUI based editor that we are probably used to.
If you are already comfortable with vi, than feel free to party on, but if not, here are a couple of easier options for you.
One option is to install the nano editor. It’s character based, but a bit more user friendly (albeit less powerful) than vi.
You can instal nano with the following command in your ssh terminal window.
yum install nano
Another option is to install “GNU Midnight Commander”
Midnight Commander or “MC” will appear familiar to old school developers who wrote code on DOS (Microsoft pre-Windows operating systems for you youngsters). Midnight Commander is a clone of the once very popular and still very useful Norton Commander.
It is a text based file manager with a built in simple text editor.
You can install it on our VPS Linux instance with the following command in your ssh terminal.
yum install mc
You can then run Midnight Commander by simply typing mc <ret>
Hard core Linux lovers may prefer the command line, but I find myself to be faster with MC.
Now we need to navigate to the document root for our web server instance. On Linux, Zend Server uses the Apache2 web server. Where Apache and the document root get installed may vary depending on your VPS host or your installation.
In the case of my A2 VPS instance the document root is:
When you navigate there you will see that there is a single file named “dummy.php”.
Lets make a copy of that file named “index.php”.
In Midnight Commander, Highlight the dummy.php file and press Function “F5”
Set the “to” section in the dialog to “index.php”
Next highlight the newly created “index.php” file and press Function F4 to open the file in the editor.
Enter the simple PHP syntax above.
Press Function F2 and confirm the Save dialog, then press Function F10 to close the Midnight Commander editor.
Now, go back you your browser instance and point it to the IP address of your VPS instance (or refresh the browser if you still have it open.)
Now you should see this !
If you’re new to PHP – examine the useful server info displayed.
At this point we have confirmed that our PHP stack is functioning and it’s time to log into Zend Server for the first time.
To do so, direct your browser to the root of your VPS instance and append the port number 10081 (You can change this port number down the lie if you so desire.)
Example : http://192.168.0.1:10081
Which will redirect to http://192.168.0.1:10081/ZendServer
You should see the EULA when you make your first visit.
Agree to the EULA and click “Next”.
Select the configuration profile that best suits your intended use. In my case, I’ll be doing a lot of demos against my live site so I’m going to select “Development”.
Select passwords for the default “admin” and “developer” accounts.
This feature allows admins to provide the “developer” credentials to developers so that they can inspect and debug applications in Zend Server without write access (in fact more granular permissions can be configured).
Note above that the installation default is the Enterprise Edition “Trial” – we’ll be able to change this shortly.
Assuming that you don’t want to make an changes, click the “Submit” button.
You’ll get this spinning progress indicator for a while. The installer has some things to configure so it my take a little while.
When installation is complete, the dashboard will appear.
Though you may be required to authenticate / reauthenticate.
There are two things to note on the dashboard.
1.) First is the error message(s) that are shown in the dashboard. This particular error has to do with an anomaly with the PHP stack configuration and is completely normal. It appears because it was logged when we navigated to the index.php page that we created above.
Click on the “Show” link and you can see the details informing you that no time zone is set in the “php.ini” file and that the default should not be trusted.
2.) Second is the notifications icon on the top right portion of the screen. This will be a pending expiration notice for the Zend Server 6 Installation’s Enterprise Trial.
Click on the icon and then click on the “Details” button in the resulting dialog.
On the resulting screen you will see the license details for your Zend Server installation
You have three choices.
- Enter the license details for the version of Zend Server that you purchased.
- Extend the trial to a full 30 days. (Why not – it’s free)
- Configure Server to use the “Free” edition.
That’s it! You now have a serious PHP Application server in a Virtual Private Server with root access for as little as $9.89 a month with the option to grow your hosting infrastructure as you app usage grows.
Make sure you visit http://www.zend.com/en/products/server/ to explore all the features of Zend Server. Keeping checking back here at Zend Developer Zone for more articles exploring the Zend Server Features.
If you haven’t already done so you can get a VPS instance for Zend Server at A2 Hosing HERE.