方便大家使用,,直接转过来。
Image courtesy of Jim McKeeth.
One of the more exciting features of the pending 10.2 release of Delphi and RAD Studio, is support for targeting Linux. In this post, I’m going to step you through setting up your development environment to deploy applications to either RedHat Enterprise or Ubuntu 16.04.
From here in I’ll refer to RAD Studio, Delphi and C++Builder as synonymous. Note that neither Delphi or C++Builder have been publicly released for Linux yet, but at the time of writing there is a Delphi beta available for subscription update users – ie most likely any active Berlin user – and a C++Builder beta will follow it soon.
This post is going to become quite lengthy, and there may be parts not relevant to you. For example, if you already have a running RedHat server, you likely don’t need me to explain how to install one. Similarly, you may already be familiar with some virtualization software and don’t need instructions on installing Oracle’s VirtualBox, I’ll break this post into sections so that you can skip to the parts that matter most to you.
Selecting a Linux distribution.
You will need
Installing Oracle’s VirtualBox
Creating a Virtual Machine for development.
Installing RedHat
Installing Ubuntu
Deploying the PAServer (required)
Deploying an application.
The scratch-directory.
There are a lot of sections to cover here!
As this post is long with several instructions, I’ll go relatively light on detail here and provide the installation options and configuration which works for me. If you have suggestions, or encounter problems following these instructions, or better yet, solutions to problems, please register and comment against this blog post so that others can benefit from your experience.
Lets get started.
Selecting a Linux distribution.
Your first decision is going to be which distribution (or ‘flavor’) of Linux you’d like to use for your application deployment. The Delphi / RAD Studio beta offers two options which will be officially supported, RedHat Enterprise and Ubuntu 16.04. (*note other flavors of Linux may work equally well, but due to there being wide variation among the available Linux based operating systems, official support is limited to these two popular distributions).
So what’s the difference between the two distributions? I don’t plan to go into lengthy detail on this subject, you can research each platform for yourself to decide which you’d prefer to use, but I’ll give you some basic pointers to get started.
A long time ago, as Linux operating systems were becoming popular, two leading distributions began to emerge from the fog of options. These were Debian and RedHat. Debian was founded by Ian Murdock under a manifesto which detailed it’s open source and open standards nature, and under the GNU Public License with intentions to encourage contributions, towards the development of the operating system, from it’s user community.
In contrast the Red Hat company released their “RedHat Commercial Linux”, which was later renamed as “RedHat Enterprise Linux (RHEL)”, with a more commercial model but along-side free to use, cost free editions named Fedora or Centos. Their model seemed aimed at merging the benefits of both commercial and open source development, while promoting the relevance of Linux to Enterprise customers. Red Hat therefore offer commercial enterprise support for RHEL, while honoring the open source nature of Linux with Fedora and/or Centos. If you select RedHat as your target, you can get started for free with their Developer Subscription, but will need to pay for a commercial license before deploying your application within your Enterprise. Of course, you could try using one of their cost free options of Fedora or Centos, which ought to be largely compatible, but these aren’t officially supported either by RedHat software nor by Embarcadero.
Ubuntu is a fork of the Debian operating system which is developed and maintained by the UK company Canonical Ltd, originally founded and funded by Mark Shuttleworth, an entrepreneur from South Africa. Canonical also offer commercial support for enterprise users, however, due to the manifesto first laid out for the Debian system by Ian Murdock, there is no commercial version of the operating system it’s self. Home users and community members get the same version of the operating system that commercial customers do, but with community based support rather than commercial support. If you select Ubuntu as the target for your application, you can develop and even deploy your application without paying for the operating system, but if you do, you’ll be at the mercy of community support having foregone the option of commercial support.
You will need