Hướng dẫn chạy Drupal từ OpenShift from Red Hat

Hướng dẫn chạy Drupal từ OpenShift from Red Hat

>> Cài đặt Verax NMS trên SuSE, RedHat và Debian

An interesting platform I came across recently for developing and deploying cloud applications is OpenShift by RedHat. OpenShift is a next generation application hosting platform. The software running this service is open-sourced under the name OpenShift Origin, and is available on GitHub. Developers use Git to deploy web applications in different languages to the platform.

OpenShift supports any web applications that run on Red Hat Enterprise Linux. This allows a wide range of languages and frameworks. OpenShift takes care of maintaining the services underlying the application and scaling the application as needed. This makes it an excellent platform for Drupal. Getting your first application up and running can be done very rapidly through a couple of simple steps.

Create an Application

OpenShift runs as a platform-as-a-service. You can either use the web console, Eclipse, or if you are a command line warriror, RedHat provides a "gem" to manage your applications from a console. You can use the command rhc-create-appfrom a console to create your first application and OpenShift will spin up a container with a set of resources that allow you to run your application. These resources are called Gears and OpenShift runs many Gears on each virtual machine and dynamically distributes Gears across them. To install the gem, you must have ruby installed, you then install the command line with; "gem install rhc" followed by rhc setupto complete the setup.

  • Signup for OpenShift online and use their cloud service to get started, it's free to join and an easy way to get your first application running. A free account OpenShift gives you three small gears. You can either run an app on a single gear or have it scale to multiple gears with load balancing.
  • Once your account is created, choose a domain name for your applications, all your apps will show up as a subdomain.
  • Next choose a cartridge. For Drupal I chose "PHP 5.3 with Zend Server 5.6".
  • Once you have chosen a cartridge, you are prompted for a domain for all your applications to live under.
  • Next you are prompted for the name of your application and the optional git repository name, for example: for my domain name I chose "Bohemian" and for my application I chose "Drupal" so my final domain would be http://drupal-bohemian.rhcloud.com
  • Choose additional cartridges to get your application up and running, MySQL 5.5, CRON and Jenkins (for continuous integration.)

Install Gears

Login to your account and you can create your application, you can select your choice of programming language, database, or other services via OpenShift cartridges. These cartridges can include, PHP, MySQL, Postgress etc.

Deploy

OpenShift uses git for managing code inside your application. You can clone the new repo from the URL on your application console. Update your code and then simply perform a "git push" to deploy your code to your application. You will need to add a secure SSH key to your account before you can deploy any code.

Openshift provides a directory framework allowing you to modify your application and exposes elements of your setup through environment variables eg. $_ENV['OPENSHIFT_DATA_DIR']for the location of persistent storage between pushes or others for your database connection information. You can use these inside your settings.php to define your database connection settings:

  • $_ENV['OPENSHIFT_MYSQL_DB_HOST'] - DB host
  • $_ENV['OPENSHIFT_MYSQL_DB_PORT'] - DB Port
  • $_ENV['OPENSHIFT_MYSQL_DB_USERNAME'] - DB Username
  • $_ENV['OPENSHIFT_MYSQL_DB_PASSWORD'] - DB Password

There are more variables available for your use and OpenShift lists them on their website To get up and running quickly, openshift maintains a quickstart version of Drupal which can be installed with all the common cartridges to get you up and running.

When you run a 'git push' from your computer - your changes are sent to your OpenShift application and the following actions occur.

  • The application is shut down
  • Your changes are copied on the server into the correct location
  • OpenShift invokes your build hooks - script files you've placed in your Git repository
  • Your application is restarted.

OpenShift is a scalable affordable platform for Drupal hosting on a managed platform backed by Red Hat support and a community of Drupal developers. The Drupal cartridge is maintained by Red Hat and has everything you need to get up and running. The platform is open to more than just Drupal, if it runs on RHEL, it will run on OpenShift. With a full shell and vim and preconfigued Drush, this is definitely a platform worth exploring.

Further reading

  • Overview of OpenShift as a developer
  • Documentation
  • How it works
  • Application Gallery
  • Drupal Quickstart on OpenShift
  • Iinstalling Drupal under OpenShift express,demo from RedHat

Additional Resources:

Using VMs for Quick and Reliable QA

Best Practices and Tips for Local Drupal User Groups

Bạn thấy bài viết này như thế nào?: 
Average: 5 (1 vote)
Ảnh của Khanh Hoang

Khanh Hoang - Kenn

Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.

Bình luận (0)

 

Add Comment

Filtered HTML

  • Các địa chỉ web và email sẽ tự động được chuyển sang dạng liên kết.
  • Các thẻ HTML được chấp nhận: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Tự động ngắt dòng và đoạn văn.

Plain text

  • No HTML tags allowed.
  • Các địa chỉ web và email sẽ tự động được chuyển sang dạng liên kết.
  • Tự động ngắt dòng và đoạn văn.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Thủ thuật custom facebook login button trong Drupal 7

Thủ thuật custom facebook login button trong Drupal 7

Working on current Drupal 7 project we had to create customized facebook login button to fit nicely with the rest of oversized login option links. The target was to create completely custom CSS-able login buttons. It took a couple of hours to fix the puzzle into working condition.

27 câu hỏi và câu trả lời từ my first Drupal 8 Building site demo

27 câu hỏi và câu trả lời từ my first Drupal 8 Building site demo

Without the ability to Google my Drupal 8 questions, I had to figure out things by intuition, and by analogy with other components

iTunes 11 được thiết kế thoáng và rộng rãi

iTunes 11 được thiết kế thoáng và rộng rãi

Ngoài những thay đổi về diện mạo bên ngoài, chương trình quản lí, chơi nhạc và các thiết bị của Apple còn được bổ sung thêm tính năng cũng như tích hợp công nghệ điện toán đám mây mạnh hơn.

Công ty diệt chuột T&C

 

Diet con trung