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ông tin về HTTP với Drupal::httpClient

Thông tin về HTTP với Drupal::httpClient

According to the Guzzle project page, "Guzzle is a PHP HTTP client and framework for building RESTful web service clients

Cầu thủ Oscar - 4 năm anh đút túi 100 triệu đô sau thuế

Cầu thủ Oscar - 4 năm anh đút túi 100 triệu đô sau thuế

Từ chỗ được đánh giá cao hơn Kevin De Bruyne, Oscar bây giờ không được CLB châu Âu nào ngó ngàng và mất vị trí trên tuyển Brazil suốt 5 năm qua

Một chính sách quá tuyệt từ Apple.

Apple tăng cường chính sách ưu đãi cho nhân viên

Apple chính thức thông báo, tất cả các nhân viên làm việc cho công ty này sẽ được miễn phí 50GB lưu lượng lưu trữ của dịch vụ iCloud.

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

 

Diet con trung