One place for hosting & domains

      How to Deploy Django with One-Click Apps


      Updated by Linode

      Contributed by
      Linode

      Django One-Click App

      Django is a web development framework for the Python programing language. It enables rapid development, while favoring pragmatic and clean design. Django was initially developed for use in a newspaper’s website division, and as a result the Django framework is very well suited to developing content-centric applications. It’s also very flexible in its ability to facilitate many complex content management operations.

      Deploy Django One-Click App

      One-Click Apps allow you to easily deploy software on a Linode using the Linode Cloud Manager. To access Linode’s One-Click Apps:

      1. Log in to your Linode Cloud Manager account.

      2. From the Linode dashboard, click on the Create button in the top right-hand side of the screen and select Linode from the dropdown menu.

      3. The Linode creation page will appear. Select the One-Click tab.

      4. Under the Select App section, select the app you would like to deploy:

        Select a One-Click App to deploy

      5. Once you have selected the app, proceed to the app’s Options section and provide values for the required fields.

      The Django Options section of this guide provides details on all available configuration options for this app.

      Django Options

      You can configure your Django App by providing values for the following fields:

      Field Description
      Django APP Name Name for the Django application. This field cannot have spaces. Required.
      Django USER Username for your Django application. Required.
      Django Password Password for the Django USER. Required.
      Django USER email Email address for the Django USER. The format for the email must be in the form [email protected] Required.

      Linode Options

      After providing the app specific options, provide configurations for your Linode server:

      Configuration Description
      Select an Image Debian 9 is currently the only image supported by Django One-Click Apps, and it is pre-selected on the Linode creation page. Required.
      Region The region where you would like your Linode to reside. In general, it’s best to choose a location that’s closest to you. For more information on choosing a DC, review the How to Choose a Data Center guide. You can also generate MTR reports for a deeper look at the network routes between you and each of our data centers. Required.
      Linode Plan Your Linode’s hardware resources. Django can be supported on any size Linode, but we suggest you choose a Linode plan that reflects how many resources you plan on using. For small applications, a 1GB Nanode is sufficient. If you decide that you need more or fewer hardware resources after you deploy your app, you can always resize your Linode to a different plan. Required.
      Linode Label The name for your Linode, which must be unique between all of the Linodes on your account. This name will be how you identify your server in the Cloud Manager’s Dashboard. Required.
      Root Password The primary administrative password for your Linode instance. This password must be provided when you log in to your Linode via SSH. It must be at least 6 characters long and contain characters from two of the following categories: lowercase and uppercase case letters, numbers, and punctuation characters. Your root password can be used to perform any action on your server, so make it long, complex, and unique. Required.

      When you’ve provided all required Linode Options, click on the Create button. Your Django app will complete installation anywhere between 2-5 minutes after your Linode has finished provisioning.

      Getting Started after Deployment

      Access Django

      After Django has finished installing, you will be able to access your Django site at your Linode’s IPv4 address, for instance: https://yourlinodeip:8000.

      1. To find your Linode’s IPv4 address. Click on the Linodes link in the sidebar. You will see a list of all your Linodes.

      2. Find the Linode you just created when deploying your app and select it.

      3. Navigate to the Networking tab.

      4. The IP address will be displayed under the Address column in the IPv4 table.

      5. Copy and paste the IPv4 address into a browser window followed by :8000. You should see the Django test page appear.

        Django Test Page

      6. Once you have verified that you can access your Django site via the browser, you can log in using the admin credentials you created when deploying your app. Update the address in the browser to: https://yourlinodeip:8000/admin.

        Login to your Django site.

      7. Once logged in, you will have access to the Admin console. Now you can begin configuring your site.

        Django Admin Console

      More Information

      You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

      This guide is published under a CC BY-ND 4.0 license.



      Source link

      Deploy a LEMP Stack With One-Click Apps


      Updated by Linode

      Contributed by
      Linode

      LEMP Stack One-Click App

      A LEMP (Linux, NGINX, MySQL, PHP) stack is a popular, free, and open-source web software bundle used for hosting websites on the Linux operating system. While similar to a LAMP Stack, a LEMP stack uses the NGINX web server as opposed to Apache. NGINX may be a preference for many reasons, however many will choose it due to it’s speed and ability to perform under high load.

      Deploy a LEMP Stack with One-Click Apps

      One-Click Apps allow you to easily deploy software on a Linode using the Linode Cloud Manager. To access Linode’s One-Click Apps:

      1. Log in to your Linode Cloud Manager account.

      2. From the Linode dashboard, click on the Create button in the top right-hand side of the screen and select Linode from the dropdown menu.

      3. The Linode creation page will appear. Select the One-Click tab.

      4. Under the Select App section, select the app you would like to deploy:

        Select a One-Click App to deploy

      5. Once you have selected the app, proceed to the app’s Options section and provide values for the required fields.

      The LEMP Stack Options section of this guide provides details on all available configuration options for this app.

      LEMP Stack Options

      Field Description
      New User The username for a new non-root sudo user. Required.
      New User Password The Password for the new user. Required.
      MySQL Root Password The root password for your LEMP stack’s MySQL database. This is not the same as your Linode’s root password. Required.

      Linode Options

      After providing the app-specific options, enter configuration values for your Linode server:

      Configuration Description
      Select an Image Debian 9 is currently the only image supported by the LEMP One-Click App, and it is pre-selected on the Linode creation page. Required.
      Region The region where you would like your Linode to reside. In general, it’s best to choose a location that’s closest to you. For more information on choosing a DC, review the How to Choose a Data Center guide. You can also generate MTR reports for a deeper look at the network routes between you and each of our data centers. Required.
      Linode Plan Your Linode’s hardware resources. The Linode plan you deploy your LEMP stack on should account for the estimated workload. If you are standing up a simple web page, you can use a Nanode or 2GB Linode. If you are standing up a larger or more robust web app, then consider a plan with higher RAM and CPU allocations. If you decide that you need more or fewer hardware resources after you deploy your app, you can always resize your Linode to a different plan. Required.
      Linode Label The name for your Linode, which must be unique between all of the Linodes on your account. This name will be how you identify your server in the Cloud Manager’s Dashboard. Required.
      Root Password The primary administrative password for your Linode instance. This password must be provided when you log in to your Linode via SSH. It must be at least 6 characters long and contain characters from two of the following categories: lowercase and uppercase case letters, numbers, and punctuation characters. Your root password can be used to perform any action on your server, so make it long, complex, and unique. Required.

      When you’ve provided all required Linode Options, click on the Create button. Your LEMP Stack app will complete installation anywhere between 2-3 minutes after your Linode has finished provisioning.

      Getting Started After Deployment

      After your LEMP stack has finished deploying, you can:

      • Connect to your Linode via SSH as your root or limited user. You will need your Linode’s root and/or user password to proceed. Note that your Linode’s web root will be located in the /var/www/html directory.

      • Navigate to the public IP address of your Linode in a browser. You will see the PHP settings that are active for your Linode.

      • Consult the following guides to learn more about working with the various components of the LEMP stack:

      • Upload files to your web root directory with an SFTP application like FileZilla. Use the same root credentials that you would use for SSH.

      • Assign a domain name to your Linode’s IP address. Review the DNS Manager guide for instructions on setting up your DNS records in the Cloud Manager, and read through DNS Records: An Introduction for general information about how DNS works.

      Software Included

      The LEMP Stack One-Click App will install the following software on your Linode:

      Software Description
      NGINX Web server that can be used to serve your site or web application.
      MySQL Server Relational database.
      PHP 7 General purpose programming language.
      UFW (Uncomplicated Firewall) Firewall utility. Ports 22/tcp and 80/tcp for IPv4 and IPv6 will allow outgoing and incoming traffic.

      More Information

      You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

      This guide is published under a CC BY-ND 4.0 license.



      Source link

      How to Deploy Ruby on Rails with One-Click Apps


      Updated by Linode

      Contributed by
      Linode

      Ruby on Rails One-Click App

      Ruby on Rails is a server-side web application framework that allows web designers and developers to implement dynamic, fully featured web applications.

      Deploy a Ruby on Rails One-Click App

      One-Click Apps allow you to easily deploy software on a Linode using the Linode Cloud Manager. To access Linode’s One-Click Apps:

      1. Log in to your Linode Cloud Manager account.

      2. From the Linode dashboard, click on the Create button in the top right-hand side of the screen and select Linode from the dropdown menu.

      3. The Linode creation page will appear. Select the One-Click tab.

      4. Under the Select App section, select the app you would like to deploy:

        Select a One-Click App to deploy

      5. Once you have selected the app, proceed to the app’s Options section and provide values for the required fields.

      The Ruby on Rails Options section of this guide provides details on all available configuration options for this app.

      Ruby on Rails Options

      You can configure your Drupal App by providing values for the following fields:

      Field Description
      Rails Application name The name for your rails application. Required.

      Linode Options

      After providing the app specific options, provide configurations for your Linode server:

      Configuration Description
      Select an Image Debian 9 is currently the only image supported by Ruby on Rails One-Click Apps, and it is pre-selected on the Linode creation page. Required.
      Region The region where you would like your Linode to reside. In general, it’s best to choose a location that’s closest to you. For more information on choosing a DC, review the How to Choose a Data Center guide. You can also generate MTR reports for a deeper look at the network routes between you and each of our data centers. Required.
      Linode Plan Your Linode’s hardware resources. Required.
      Linode Label The name for your Linode, which must be unique between all of the Linodes on your account. This name will be how you identify your server in the Cloud Manager’s Dashboard. Required.
      Root Password The primary administrative password for your Linode instance. This password must be provided when you log in to your Linode via SSH. It must be at least 6 characters long and contain characters from two of the following categories: lowercase and uppercase case letters, numbers, and punctuation characters. Your root password can be used to perform any action on your server, so make it long, complex, and unique. Required.

      When you’ve provided all required Linode Options, click on the Create button. Your Ruby on Rails app will complete installation anywhere between 2-5 minutes after your Linode has finished provisioning.

      Getting Started after Deployment

      Access Ruby on Rails

      After Ruby on Rails has finished installing, you will be able to access Ruby on Rails from the console via ssh with your Linode’s IPv4 address:

      1. SSH into your Linode and create a limited user account.

      2. Log out and log back in as your limited user account.

      3. Update your server:

        sudo apt-get update && apt-get upgrade
        
      4. Ruby comes with some pre-made scripts to get you started. One of these is a blog. To begin with the blog example, use the following command:

        rails new blog
        

        This creates a new Rails application called Blog in the blog directory.

      5. Move into the blog directory:

        cd blog
        
      6. Start the built in server with the following command, replacing the IP address with your Linode’s IP address:

        rails server --binding=198.51.100.0
        
          
        Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
        => Booting WEBrick
        => Rails 4.2.7.1 application starting in development on http://198.51.100.0:3000
        => Run `rails server -h` for more startup options
        => Ctrl-C to shutdown server
        [2020-03-11 14:17:16] INFO  WEBrick 1.3.1
        [2020-03-11 14:17:16] INFO  ruby 2.3.3 (2016-11-21) [x86_64-linux-gnu]
        [2020-03-11 14:17:16] INFO  WEBrick::HTTPServer#start: pid=3089 port=3000
        
        
      7. You can visit your application by visiting the address in the browser.

        Rails Welcome Page

      8. Exit the server process with Ctrl+C.

      Create a Controller and View

      A controller will receive requests which are then routed and served by various actions. A view displays information.

      1. Create a controller called Welcome and an action called index:

        rails generate controller Welcome index
        
          
        create  app/controllers/welcome_controller.rb
        route   get 'welcome/index'
        invoke  erb
        create    app/views/welcome
        create    app/views/welcome/index.html.erb
        invoke  test_unit
        create    test/controllers/welcome_controller_test.rb
        invoke  helper
        create    app/helpers/welcome_helper.rb
        invoke    test_unit
        invoke  assets
        invoke    coffee
        create      app/assets/javascripts/welcome.coffee
        invoke    scss
        create      app/assets/stylesheets/welcome.scss
        
        
      2. With the text editor of your choice, edit the file app/views/welcome/index.html.erb and replace the contents with the following:

        app/views/welcome/index.html.erb
        1
        
        <h1>Hello, World! This is Ruby on Rails!</h1>
      3. Tell Rails where to find the document root. Edit the file config/routes.rb, find and uncomment the line root as shown:

        config/routes
        1
        2
        3
        4
        5
        6
        7
        8
        9
        
        Rails.application.routes.draw do
          get 'welcome/index'
        
        ...
        
          root 'welcome#index'
        
        ...
        end
      4. Start the server again:

        rails server --binding=198.51.100.0
        

        You should see your new welcome page in the web browser.

      For more information on setting up a more substantial application, refer to the Ruby on Rails Getting Started Guide.

      Next Steps

      For more on Ruby on Rails, checkout the following guides:

      More Information

      You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

      This guide is published under a CC BY-ND 4.0 license.



      Source link