Launching Infobox Cloud VPS Website in 10 Minutes

    On cloud VPS on the Infobox , you can deploy a site without the need for manual installation of Linux, Apache, MySQL and PHP, and without the use of site control panels through the use of Ubuntu LAMP template.

    You can use all the features of the cloud without the need for a long OS setup and installation of software for hosting the site. If you use classic VPS - we made the template available in this service .

    Inside the Ubuntu 14.04 lamp template, the following software is preinstalled and configured:
    • NGINX 1.4 (as reverse proxy)
    • Apache 2.4
    • PHP 5.5
    • MySQL 5.5
    • ProFTPD 1.3
    • PHPMyAdmin 4.0

    You can immediately deploy a site, use FTP and PHPMyAdmin without additional settings.

    InfoboxCloud LAMP Template

    In this article, we will take a closer look at this template and show how easy it is to migrate your site to the Infobox cloud VPS .

    Create Cloud VPS


    If you do not have a cloud VPS yet - order ee . After ordering, go to the control panel and create a cloud server .



    Set the necessary server parameters, do not check the box "Allow OS kernel management . " Allocate one public IP address to the server so that the server is accessible from the Internet. Do not forget to set the required network speed and click "Next".



    Select the “Ubuntu 14.04 lamp” template, as shown in the screenshot below, and complete the server creation. After creation, you will receive data for accessing the server by e-mail.



    Connect to the server via SSH .

    Everything is ready to go.


    After connecting to the server, you will see the data for accessing the MySQL and FTP database. Save them.



    First of all, install OS updates that will help fix all the problems found at the moment and make the server more reliable. To do this, enter the command:
    apt-key update && apt-get update && apt-get -y upgrade
    


    Upload files to the cloud server via FTP


    Let's connect to the server via FTP and put the site files on the server. You can use the Filezilla Client to connect. Download and install it.

    After starting, enter the external ip-address of the server (the same as you used when connecting via SSH), login and password. To connect, click QuickConnect.



    The connection will be successfully established. Transfer the site files to the server.



    For example, install MogutaCMS - an online store management system that also has a free version. Download it , unzip the archive and put the site files on the server through Filezilla.

    For ease of use, Filezilla can save data for server access in the future. To do this, open Site Manager in Filezilla, as shown in the screenshot below.



    Click New Site and enter a name for the site.



    Enter the ip address, select the login type “Normal”. Then enter the login and password for the site and click Connect.



    In this case, you will not need to enter data each time for FTP access to the server.

    Allow index.php to be executed by default


    By default, the server is configured to open index.html, if not, index.php. Our site is developed in php. The easiest option is to simply delete index.html on the server through Filezilla and the site will open. However, if in your CMS, in addition to index.php, there is also index.html, you need to enable the processing of index.php to index.html.

    This is done very simply. In the SSH connection window, run the command to install the nano editor:
    apt-get -y install nano
    

    Then edit the configuration file by running the command:
    nano /etc/apache2/sites-enabled/000-default.conf
    

    Add a line:
    DirectoryIndex index.php index.html
    

    as shown in the screenshot below:



    To save changes press “Ctrl + X”, then “Y” and then Enter.

    Restart Apache with the command:
    service apache2 restart
    


    Open the public ip – address of the server in the browser. You will see the MogutaCMS installation window.



    Install MogutaCMS


    Different CMS may have different requirements for hosting components, caching, etc. Nevertheless, on a virtual server, unlike classic hosting, you can reinstall everything you need.

    MogutaCMS requires libcurl library during installation. Let's install it:
    apt-get install -y php5-curl
    

    service apache2 restart
    

    After that, the installation of MogutaCMS will be completed successfully.
    At one stage, you must enter data to access the database. Specify “localhost” as the server, as the login and password, specify the data from the welcome message that is issued when connecting via SSH (and which we asked to save you earlier).


    Some CMS can create a database if it is not already. MogutaCMS does not know how and it is necessary to help her a little. Open PHPMyAdmin at:
    публичный_ip_сервера/phpmyadmin
    

    Enter the password for the database (from the SSH greeting message) and click Ok.

    Go to the "Databases" section, enter the name of the database in English, select the encoding (utf8_general_ci, unless the CMS developer asks otherwise) and click Create.



    Now the installation of MogutaCMS will continue successfully if you specify the created database.

    Enter the name of the site, your email and password. Click Install.



    Now click "Go to the site."



    Your site has been successfully installed.



    FAQ


    In this section, we will answer questions that you have when using the Ubuntu 14.04 lamp template on cloud VPS . If you have any questions during the installation process, write to us and we will add the answer to this section. You can easily install CMS on a cloud server, we will try to describe all incomprehensible moments in the article.

    How to transfer the database of an existing site?

    Export the database from an existing hosting or server. If there is access to PHPMyAdmin where the site is located now, export can be done as follows:

    1. Log in to PHPMyAdmin on the old hosting or server.
    2. Select your database. Go to the “Export” section and click “Go”.



    The browser will download the database dump.

    Now log into PHPMyAdmin on the cloud server in Infobox. Go to the Databases section and create an empty database.



    After creating, select it, go to the "Import" section. Click “Choose file” and select the database dump from your computer. Make sure that the encoding corresponding to the export encoding is specified. Click Go to complete the import.



    The database will be imported successfully.



    What if the size of the database is too large and the database does not load in phpmyadmin?

    NGINX reverse proxy settings for loading databases of more than 20mb and less than 200mb

    Make sure that the .sql database dump is packaged in a zip, gzip or bzip2 archive. This will help to significantly reduce the size of the loaded database.
    If the packed database still occupies more than 20 megabytes, increase the maximum allowed upload file size in nginx, as shown below.

    To do this, edit the /etc/nginx/nginx.conf file , adding the parameter inside the http {} block (for example, under: # server_tokens off;):
    client_max_body_size 200m;
    

    In this case, nginx will allow downloading files less than 200 megabytes.

    You can edit the file using the nano editor. If it is not already installed, install with the command:
    apt-key update && apt-get update && apt-get install -y nano
    

    Now edit the file with the command:
    nano /etc/nginx/nginx.conf
    

    and add the required value client_max_body_size .



    To save, press ctrl + x, Y, Enter.

    To apply the changes, restart nginx with the command:
    service nginx restart
    


    Loading heavy databases in mysql

    If the mysql database takes more than 200 megabytes in the archive or the process of recovering the database dump on mysql after loading takes more than a minute, using phpmyadmin to import the dump is not the best idea. You may receive errors of the form "Script timeout passed, if you want to finish import, please resubmit the same file and import will resume". You can configure phpmyadmin and nginx timeouts to support the execution of lengthy operations and increase the loading limits of nginx, apache and php, but it is better to use native mysql tools to load such databases.

    1. Copy the database dump to a remote server (for example, to the / root directory). This can be done using Filezilla.
    Create a new SFTP connection. Enter the ip address, username and password for SSH access to the server and click “Connect”.



    Check the box, agreeing that you trust this server and click OK.



    The connection will be established.

    Select the database dump on your computer in the left pane of filezilla and move it to the right. The file will be copied to the / root directory of the server.



    2. Connect to the server via ssh.

    Create a new database. In the example below, my_db is the name of the database to create.
    mysql -u root -p -e 'CREATE DATABASE `my_db`;'
    

    You will need to enter the password for the database specified in the SSH greeting message.

    When creating the database, you can specify the encoding:
    mysql -u root -p -e 'CREATE DATABASE `my_db` CHARACTER SET utf8 COLLATE utf8_general_ci;'
    

    Now import the base dump:
    mysql -u root -p my_db < database.sql
    

    where database.sql is the name of the database dump to restore.

    The database will be restored successfully.

    Conclusion


    Using the Ubuntu 14.04 lamp template on the Infobox cloud VPS will allow you to quickly deploy your sites in the cloud and gradually learn how to administer the server for full control over your site. We are always happy to help you, if it is not clear how to install or configure something on this image, ask.

    Good luck!

    Also popular now: