Author: RunCloud Team

  • 3 Free Ways To Migrate WordPress From Shared Hosting To Cloud Server

    3 Free Ways To Migrate WordPress From Shared Hosting To Cloud Server

    WordPress Migration From Shared To Cloud

    You probably start your website hosting from a small shared hosting account. As your website grows, you will hit the limitations of shared hosting, and then you know it is time to consider moving to a better hosting environment like cloud hosting. Cloud hosting is more reliable, higher scalability, flexible pricing, better security, and performance. Find out why cloud hosting is better for your business.

    In this article, you will learn the various ways to migrate WordPress site from shared hosting to cloud hosting

    7 Steps to Migrate a Website

    Generally, in order to move a website from one location to another, you will have to copy all of the data including files and database. There are many ways to do it, and here are the steps:

    1. Backup! Always keep at least a recent backup of your website before you do anything
    2. Export files from current website
    3. Export database from current website
    4. Create a hosting account on the new server
    5. Upload files to a new website
    6. Import database to the new website
    7. Update DNS records

    At RunCloud, we have the migration service to migrate your website from the other web hosting server (shared hosting) to a RunCloud managed a server. It is free for the first web application!

    If you would like to do it yourself, here are some methods to migrate your website from shared hosting to cloud hosting. We will use WordPress, the most popular CMS in the world, as an example.

    1. WordPress Migration Plugin: Migrate Guru

    migrate guru wordpress migration plugin

    Migrate Guru is a WordPress migration plugin from BlogVault, a WordPress backup solution company. The beauty of Migrate Guru is that it is a free one-click migration plugin that supports unlimited sized websites, from 50MB or 50GB website.

    The migration process works on their server, so it won’t overload your server. No extra disk storage is required. Your files are copied to their server and deleted after the migration is complete. It also automatically rewrites URLs, bypasses import-export scripts, and handles serialized data.

    Requirements:
    • Migrate Guru plugin installed on existing WordPress site
    • A WordPress installation on new cloud hosting
    • FTP/SFTP access to new cloud hosting

    How to use Migrate Guru to migrate WordPress site

    1. Click on Migrate Guru from the sidebar menu in WordPress dashboard
    2. Fill in your email address then click “Migrate Site”
    3. On the new page, select FTP
    4. Enter FTP details, including destination site URL and directory path
    5. Click the “Migrate” button to start the migration
    6. Make a cup of coffee. You will be notified by email once the migration completed
    7. Enjoy your speedy site on new cloud hosting

    2. WordPress Migration Plugin: All-in-one WP Migration

    All-in-one WP Migration is one of the most popular WordPress migration plugins with over 2 millions active installations and 5,200+ 5 stars rating. The plugin is highly compatible with different operating systems and web hosting providers. It does not require any PHP extensions and works with all PHP versions from PHP 5.2 onwards. It supports WordPress version 3.3 to the latest version.

    Requirement:

    • All-in-one WP Migration installed on both current a new WordPress site

    How to use All-in-one WP Migration to Migrate A WordPress site

    a. Current server

    all in one wp migrate wordpress plugin
    1. On the current WordPress dashboard, click on “All-In-One WP Migration” > export
    2. (Optional) Use the Find Replace within the database to replace existing domain name, if you change the website domain name on the new server
    3. Click “EXPORT TO” and select FILE to download the website export file (.wpress file extension)

    b. New server

    all in one wp migrate import site
    1. On new cloud hosting WordPress dashboard, click on “All-In-One WP Migration” > import
    2. Click “IMPORT FROM” > FILE (or your .wpress export file source)
    3. Select your website export file (.wpress) to start website import
    4. Click the “Proceed” button to overwrite the WordPress site with your All-in-one WP migration export file.
    5. “Your site has been imported successfully!”

    Note:

    • The free plugin has a 512MB upload limit for importing website
    • You can buy the Unlimited extension to remove the import limit, restore a backup from the server, and support WP-CLI commands. Other cloud storage extensions are available too.
    • You may need to save the WordPress permalink structure twice after import complete.

    3. WordPress Migration with WP-CLI and Rsync

    Using WP-CLI and Rsync is the fastest way to migrate a WordPress site. It is more stable and reliable than using a WordPress plugin. Recommended if you want to migrate a huge website and you have SSH access on both existing and new servers.

    WP CLI is a powerful command line tool for managing WordPress. You can install WordPress. update plugins configure multisite, and much more, without using a web browser.

    Rsync is a Linux command line tool for fast local and remote file synchronization. It is a popular tool and included in most Linux distribution by default. Digital Ocean has a good tutorial on using Rsync to sync directories on the server.

    Requirement:

    • SSH access on both current and new servers
    • WP-CLI on both current and new servers

    How To Install WP-CLI

    You can easily install WP-CLI via shell with two command lines:

    sudo wget -q https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/bin/wp
    sudo chmod 755 /usr/bin/wp

    How to use WP-CLI and Rsync to migrate WordPress site

    a. Current server

    1. Connect to the current server via SSH
    2. Navigate to your WordPress root directory (example: /var/www/vhosts/sitename/public_html/)
    3. Export WordPress database using WP-CLI command:
      wp db export db.sql --allow-root

    b. New server

    1. Connect to the new server via SSH
    2. Navigate to the directory where you want your WordPress site to be in (example: /home/runcloud/webapps/yoursite)
    3. Pull website files from a current server using Rsync:
    rsync -avz --progress --exclude wp-config.php username@currentserver.com:/var/www/vhosts/sitename/public_html/* .
    1. Create an empty WordPress database. RunCloud user can easily create a database via RunCloud dashboard. You can create a database using command lines too:
      mysql -u root -p
      You will enter MySQL shell then use the following commands to create WordPress user and database:
    CREATE USER wordpressuser@localhost IDENTIFIED BY 'passw0rd';
    CREATE DATABASE wordpress;
    GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'passw0rd';
    FLUSH PRIVILEGES;
    quit;

    Remember change passw0rd to the secure password, you want to use. These credentials will be used for the wp-config.php file.

    • Generate WordPress configuration file using WP-CLI command: wp core config --dbname=wordpress --dbuser=wordpressuser --dbpass=passw0rd --allow-root
    • Import the WordPress database dumped in the directory using WP-CLI command: wp db import db.sql --allow-root
    • Update WordPress installation ownership and use the recommended permissions for files & directories:
    sudo chown -R runcloud:runcloud /home/runcloud/webapps/yoursite/
    sudo find /home/runcloud/webapps/yoursite/ -type f -exec chmod 644 {} +
    sudo find /home/runcloud/webapps/yoursite/ -type d -exec chmod 755 {} +

    Note:

    • If the SSH is using a non-standard port, you can pass the port parameter to SSH with the -e option: rsync -avz -e 'ssh -p <port-number>' --progress --exclude wp-config.php username@currentserver.com:/var/www/vhosts/sitename/public_html/* .
    • If you are migrating to a new domain. Run database search & replace to update the new domain name in the database: wp search-replace 'https://old-domain.com' 'https://new-domain.com'
    • runcloud:runcloud is a reference that is in place of your system username
    • /home/runcloud/webapps/yoursite where runcloud should be the system username and yoursite should be your web application
    • To fix ownership of system user, use the navigation menu and go into your web application, scroll down to Tools, and click the Fix Ownership button.

    Tips: DNS Propagation

    After website files and database migration, you will need to update the domain name’s DNS records to the new cloud server IP address.

    You can try speeding up the DNS propagation time by lowering the TTL (Time To Live). This will refresh the DNS at a quicker rate. You can try set TTL to as low as 120 (2 minutes). However, some of the networks may still update slowly.

    Wrapping Up

    RunCloud is a powerful and easy-to-use platform that helps you manage your websites on any cloud server. With RunCloud, you don’t need to be a Linux expert to set up, secure, and optimize your web applications. You can do everything from a simple and intuitive dashboard, saving you time and hassle.

    RunCloud supports various web servers, PHP versions, databases, and frameworks. You can also monitor your server performance, back up your data, and automate your tasks with RunCloud. Whether you are a developer, a freelancer, or a business owner, RunCloud can help you run your websites faster and smoother.

    What are you waiting for? Join RunCloud today and enjoy the best web hosting solution for your websites. It’s free for 7 days, no strings attached!

  • The 7 Best WordPress Staging Plugins to Create a Test Site

    The 7 Best WordPress Staging Plugins to Create a Test Site

    It is important to test any new changes and updates before apply to your live site. It can prevent some unexpected errors and downtime. We use a Staging site to create a testing environment.

    A staging site is a duplicate copy (or clone) of your live website. It allows you to do customizations, test new features, install a new plugin, and more without affecting the live site. Your website visitors won’t be interrupted while you are working on the staging site. Some staging site setups even allow you to push the changes to the live site.

    IMPORTANT! RunCloud has released One-click WordPress Staging feature that allows you to create an exact copy of your entire website (web application) for staging and development purpose in seconds.

    Quick guide on how to easily create a WordPress staging site in RunCloud →

    In this article, you will learn about some WordPress staging plugins, both free and paid, that will create a staging site for the testing environment.

    1. WP Staging (Free)

    WP Staging is probably the easiest way to create a staging site in just a few clicks. It creates a clone of your website into a subfolder. In the background, the files and database are copied and the links within the content also replaced with the new path.

    Simple instructions:

    1. Install WP Staging plugin on main site
    2. Name your staging site (a subfolder) and start cloning using WP Staging
    3. Login to your new staging site

    The free plugin has 40,000 active installations and 5-stars ratings. The Pro edition supports WordPress multisites, cloning for subdomains, and the ability to copy modifications from staging site to the live website.

    WP Staging

    2. All-in-One WP Migration (Free)

    All-in-One WP Migration is a popular plugin to migrate WordPress site from one host to another. The fact that it package the whole site (files & database) for easy migration, make it also ideal to create a staging site.

    You will need to install WordPress on the staging site before you can import the All-in-One WP Migration website package file. The staging site can be a subfolder, subdomain, or even a different domain. The maximum website export size limit is 512MB.

    Simple instruction:

    1. Install WordPress on staging site
    2. Install All-in-One WP Migration plugin on both main and staging sites
    3. Export main site using All-in-One WP Migration with staging site URL replacement
    4. Import the website package file on staging site
    5. Done.

    The free plugin has over 2 million active installations and 4.5 stars ratings (5000+ 5 Stars). The plugin’s premium extensions support unlimited website size, cloud storage, multisite, and more.

    All-in-One WP Migration

    3. Duplicator (Free)

    Duplicator is another popular WordPress migration plugin like All-in-One WP Migration. It creates a package file and installer for easy website restoration on a blank site. Need not have existing WordPress installation on the target site.

    Simple instruction:

    1. Install Duplicator plugin
    2. Create a new package using Duplicator
    3. Download the installer and package file
    4. Upload installer and package file to target site (subfolder, subdomain, or domain)
    5. Run the Duplicator installer to restore website
    6. Done.

    The free plugin has over 1 million active installations and 5 stars ratings. The Pro version supports scheduled backups, cloud storage, multisite, cPanel integration, and more.

    Duplicator

    4. BackupBuddy (Paid)

    BackupBuddy plugin to create WordPress staging site

    BackupBuddy is a premium backup plugin from iThemes that supports scheduled automatic backups and store backup files off-site. It includes a Deployment feature, which you can push or pull WordPress staging site’s changes back and forth between the staging site and the live site.

    How to setup WordPress staging site with BackupBuddy Deployment

    1. Install BackupBuddy plugin and make a backup of your Live Site
    2. Create a Staging site by restoring your backup on a new domain (or sub-domain)
    3. Add define('BACKUPBUDDY_API_ENABLE', true); to the wp-confg.php file of your Live Site.
    4. On the Live Site, goto BackupBuddy > Remote Destinations and select Show Deployment Key at the top of the page
    5. Copy the given API key
    6. On the Staging Site, goto BackupBuddy > Remote Destinations and click the Add New option and then select BackupBuddy Deployment
    7. Paste the API key you copied from the Live Site into your Staging Site

    Price: iTheme BackupBuddy price starts from $80/year for 1 site.

    BackupBuddy

    5. WP Stagecoach (Paid)

    WP Stagecoach is a premium one-click WordPress staging site solution that work on any host and does not overwrite database during import.

    The database merging is an unique feature that allows you to push staging site changes to live site without replacing the live site’s database. WP Stagecoach monitor and keep a database changes log on the staging site. It then “playback” database changes during import to live site.

    WP Stagecoach can host your staging site on their server, so you can test the site in a isolated environment, and saving hosting disk space usage. During site import, you can import files, database or both.

    Price: WP Stagecoach price starts from $120/year for 10 domains.

    WP Stagecoach

    6. BlogVault (Paid)

    BlogVault is a premium WordPress cloud backup plugin with staging site feature. It offer one-click WordPress staging site that host on its server. The staging site is password-protected and block search engine indexing by default.

    BlogVault also handle WordPress database merging when you import staging site changes to the live site. The 1-click Merge feature allows you to compare Live and Staging site, then do complete merge in a single click or selective merge handpick modifications.

    Price: BlogVault price starts from $89/year for 1 site.

    BlogVault

    7. ManageWP (Free/Paid)

    ManageWP is an online WordPress website management tool. It is free to use for unlimited websites with optional premium add-ons. With the premium backup, it can clone your website to an existing website or another server. It does not offer hosting for staging websites.

    ManageWP Smart Clone will compare the source and destination files. Skip the same files and clone only the different files and the database.

    Price: Free. Requires Premium Backup ($2/month per site) for clone/staging feature.

    ManageWP

    Bonus Tips

    A staging site is a duplicate of your live site. In search engine optimization (SEO), duplicate pages are bad for your website ranking. You should avoid search engines from indexing your staging site. The good news is that it is easy to disallow index.

    Here are few ways to disallow index on your staging site:

    1. Add “noindex” tag to your staging site. Goto Settings > Reading and check the box for Discourage search engines from indexing this site
    2. Password protect your staging site using RunCloud’s HTTP basic authentication.
    3. Create a robots.txt text file in the WordPress installation root of your staging site. And add these two lines:
    User-agent: *
    Disallow: /

    Summary

    Having a WordPress staging site is important for testing changes before you push them to live site. Setting up a WordPress staging site is easy with the various plugins listed here.

    WP Staging is great to create a simple staging site. All-in-One WP Migration and Duplicator are backup plugins but also can be used to create a clone of live site for testing purpose. Premium plugins offer more features and support pushing staging site updates to the live site.

    How do you create a staging site? Please tell us in the comment.

  • Looking for an alternative to phpMyAdmin? Look no further…

    Looking for an alternative to phpMyAdmin? Look no further…

    Most small to medium-sized websites and web applications use MySQL as the database of choice for back-end storage. In fact, many of the world’s largest and fastest-growing organizations, including Facebook, Google, and Adobe rely on the stability and maturity of MySQL to power their high-volume websites, business-critical systems and packaged Software as a Service (SaaS) platforms. MySQL is a great choice for a number of reasons, primary among them are its high-availability features, reliable scalability, cost-effectiveness, and the huge community of active developers.

    At RunCloud, we use MariaDB for your database. It is an enhanced drop-in replacement for MySQL, made by the original developers of MySQL with the promise of maintaining ongoing and future compatibility with MySQL. This means every tool created for MySQL is also compatible with MariaDB, and this solution is future-proof.

    Some developers or database administrators do not need any tools when it comes to managing the MySQL database. However, for users with limited knowledge, or those who just want to perform some quick administration tasks on the database, a database administration tool can be of great help and a major time-saver. There are a lot of choices when it comes to managing cloud-hosted MySQL and MariaDB databases.

    A quick Google search shows that phpMyAdmin is one of the most popular choices and easily recommended. But did you know that there are other FREE RunCloud-compatible database managers that are worth looking into?

    phpMyAdmin

    Alternatif phpMyAdmin

    First, only a little introduction to PHPMyAdmin is needed as it is one of the most famous database management tools around. Launched in 1998, phpMyAdmin was written primarily in PHP. It is a free and open-source administration tool for MySQL and MariaDB. Over the years, its popularity has grown, especially for web hosting services, due to its portability, easily accessible web interface, ease of use (even for someone with minimal skills) and functionality. This has led to it becoming the tool of choice provided by most shared hosting companies in their control panel for managing MySQL or MariaDB databases.

    Another contributing factor to its success is that, unlike other database manager tools, phpMyAdmin has live charts to monitor MySQL server activity such as connections, processes, CPU/memory usage, etc. It also includes a debugger and can generate Entity Relationship Diagram (ERD) in PDF format so large databases can be looked at as a whole, unfortunately, on the downside, it does not have syntax highlighting or code completion, but in general, it has an impressive feature set.

    Alternatif Status

    phpMyAdmin monitoring dashboard

    Since phpMyAdmin is a public-facing Web Application and is only accessible using a web browser, some developers have reservations about using it, considering it a potential security vulnerability.

    Previously RunCloud did not recommend using phpMyAdmin for database management due to these potential security risks, but after receiving many requests from users who insisted on using it, the developers at RunCloud included it in the script installer. At RunCloud, we listen to our clients.

    In the RunCloud dashboard, users can
    install phpMyAdmin using One Click phpMyAdmin install in less than 5 minutes. Instead of accessing the database from a web interface through an open port, it is recommended to create another web app within the RunCloud dashboard and install phpMyAdmin in that web app and enable SSL there so that the connection is encrypted and secured.

    HeidiSQL

    Alternatif HeidiSQL


    HeidiSQL is a Windows-based platform launched in 2002. Unlike phpMyAdmin, HeidiSQL users connect to MySQL or MariaDB database via SSH tunnel. There is no need to establish a separate SSH tunnel connection using Putty or Terminal. So all communications to and from are encrypted. Among database managers,  HeidiSQL’s interface is considered very pleasant not to mention comprehensive and intuitive.

    Furthermore, there is also a portable version that does not require administrative privileges and installation.

    Although it has no built-in debugger, it does have syntax checks and auto-completion features, alongside powerful user management features where the administrator has granular control to easily set privileges on a per-database level or give access to only certain commands.

    Alternatif Data

    HeidiSQL’s comprehensive and intuitive interface

    Alternatif Box

    Built-in tunnelling option in HeidiSQL using plink.exe

    MySQL Workbench

    Alternatif MySQL

    Any MySQL database management tool list would be incomplete without mentioning the software developed by the company which owns MySQL, Oracle Corporation. MySQL Workbench was released in 2005 and replaced a previous software package called MySQL GUI Tools Bundle. This is the only SQL client which is supported and developed by MySQL, so you can be sure that it always contains all the functions to match the most recent updates for MySQL. It is also a cross-platform software that can be used on Windows, Linux, and Mac OS. So the experience is consistent from one OS to another.

    In a nutshell, MySQL Workbench is more of a unified visual tool for database architects, developers, and database administrators. It has enhanced entity-relationship modelling support and it is one of the few software packages that can do both forward engineering (updating the database schema with changes made to its entities and relationships via the ERD visual designer) and reverse engineering (producing an ERD from a database).

    Alternatif Workbench

    Extensive ERD in MySQL Workbench

    However, it can be resource-intensive and some say it is overkill when all you need is to perform simple tasks. And as everyone knows, if the software is resource-intensive, it can tend to crash more often.

    Due to the many features it provides, some regard the interface as cluttered and unintuitive. Hence, this tool is not recommended for beginners. So, unless the user is an advanced database administrator and there is ample client and server resources, it is not recommended. If, however, its needs are met, then MySQL Workbench can be a powerful tool to have since nearly every SQL command can be utilized in a GUI.

    Sequel Pro

    Alternatif Sequel Pro

    Among users who are on Mac OS machines, Sequel Pro is a top choice due to its comprehensive features, where the GUI provides many powerful functions instead of having to keep resorting to terminal commands. Sequel Pro was built specifically for Mac OS machines to manage MySQL / MariaDB. With Sequel Pro, users can easily create and edit databases, manage users and easily do a full database export for backup (where multiple formats are supported like SQL, CSV and XML). Even imported CSV files can be easily converted to tables.  

    Alternatif SSh

    Sequel Pro’s connection interface

    Sequel Pro allows users to connect to their MySQL/MariaDB through standard, socket or SSH, either locally or remotely. It even allows users to group and colour code the servers into staging or production sites, just like how a Mac user can colour code the files in the Finder app on a Mac machine.

    For a user who manages multiple projects at one time, Sequel Pro is practical as it allows multiple open connections to different databases. The connections remain connected until the user decides to disconnect them. The user management feature also allows for user creation with user privilege and connection management.

    Since it does not have a visual query editor, running a query requires a little bit of MySQL syntax knowledge. Fortunately, it does have highly flexible and customisable filters that can be applied on a table. And these filters can be used across different tables with ease. The queries can be saved and there is a history for queries that have been run, but the results of the queries themselves are not saved.

    All in all, this tool is very powerful when it comes to digging for information from the database as complex queries and filters can be done through the control panel instead of relying on terminal commands.

    Adminer

    Alternatif Adminer

    Last but not least, we have Adminer. Previously known as phpMinAdmin, it was initially released as a light alternative to phpMyAdmin. It is famously known for being lightweight and the installer is just a single file. It is good to go once it is uploaded.

    Being lightweight means that it had to forgo some features like auto-completion and a debugger but it does have syntax highlighting as well as ERD design, which is the ability to draw entity-relationship diagrams for the database.

    The Adminer interface is more functional rather than being focused on aesthetics, but nevertheless, it is fast and easy to use.

    Alternatif Database

    Adminer’s lightweight and simple interface

    Alternatif cds

    ERD visualisation in Adminer

    Conclusion

    So there you go, the recommended tools to administer your MariaDB in RunCloud (or any other cloud service provider). The best practice would be to not use a public-facing web tool when managing your server especially the database which has sensitive data. Rather, use a tool that can support SSH connection so that the communication between you and your servers are encrypted and less prone to be intercepted by irresponsible parties.

    Not including Sequel Pro is a mistake – I imagine it is the only tool that any of your Mac Users use.

  • How to Change/Reset MySQL Root Password on Ubuntu Linux?

    How to Change/Reset MySQL Root Password on Ubuntu Linux?

    Did you forget the root password for your MySQL Server?

    Or maybe you provisioned your RunCloud server via the auto-install method and never had the need to use your password in the first place?

    Whatever may be the case, if you want to reset your MySQL password then you’ve come to the right place!

    In this guide, we’ll walk you through how to set, change, and recover your MySQL root password on an Ubuntu server via MySQL command line.

    If you have no prior experience managing MySQL, don’t worry – with RunCloud, it is as easy as ABC.

    How to Reset Your MySQL Root Password in Linux

    Step 1: Log in to the Server with SSH

    We have already written in-depth documentation on connecting to your RunCloud account via SSH, but if you’re not using RunCloud, you can use the following SSH command to log in to your server:

    ssh user@server_ip_address

    In the above command, replace the user with the username of your Linux account, and server_ip_address with your server’s IP address.

    Keep in mind that the Linux account must have superuser permissions to execute the commands given in the next step.

    Step 2: STOP MySQL Server

    After logging in to your server, you need to stop the MySQL service. You can use the following command to do this:

    Note: If you have any websites or other services that are using this database, then they will not be able to connect to your database while you carry out this action, so it is best to do this outside of business hours.

    sudo systemctl stop mysql
    logging into root user via command line

    Step 3: Restart MySQL Server

    After stopping the server, you can now restart it in the safe mode. This will allow us to execute SQL commands without needing to enter the password.

    Since the command --skip-grant-tables enables anyone to connect without a password, it is considered highly insecure, which is why all commands that follow must be done within a brief period. The ampersand (&) at the end is required as it ensures that the command is being run parallel with the commands that follow afterwards.

    To start MySQL without permission checking, execute the following command:

    sudo mysqld_safe --skip-grant-tables &
    MySQL root password

    Step 4: Log in to MySQL

    Once your server is up and running, you can log in to MySQL as the root user without the need for any password by executing the following command:

    mysql -u root

    Step 5: Change MySQL Password with Command Line

    Once you’re logged in to the MySQL server, you can do anything you like – such as changing the password for users, granting permissions, deleting database, etc.

    To change the root password, execute the following command:

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'RunCloud_password';
    FLUSH PRIVILEGES;

    In the above command, replace the RunCloud_password with your new password.

    Alternatively, you can also use the following command to change the password:

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('RunCloud_password');
    FLUSH PRIVILEGES;

    Step 6: Stop & Restart MySQL Server

    Finally, you need to stop the MySQL service and restart it in normal mode. To do this, first exit from the MySQL CLI by using the exit; command, and then restart the service using the following commands:

    sudo systemctl stop mysql
    sudo systemctl start mysql

    That’s it! Once your server is up and running, you can start using it normally. To log in to your server via the new password, use the following command:

    mysql -u root -p

    The above command will prompt you to enter a password. To complete the login process, type your password and press Enter. Keep in mind that the password will not be displayed on screen for security reasons.

    Step 7: Edit RunCloud Configuration File (Only for RunCloud Users)

    If you are using RunCloud to manage your servers, then you will need to edit a config file on your server so that RunCloud agent can access your MySQL database using the new password. To edit the config file, execute the following command on your terminal:

    nano /etc/mysql/conf.d/root.cnf

    The above command will open a text editor in your terminal, you can use the arrow keys on your keyboard to navigate and replace the existing password with your new password.

    After editing the file, you can save it by pressing Ctrl + O and exit the editor by pressing Ctrl + X. If you need step-by-step instructions on editing the file, then you should read our post on editing files over SSH using Nano.

    Frequently Asked Questions

    How do I find my MySQL root password?

    You cannot directly find the MySQL root password due to security reasons. However, you can reset it. To recover the password, you need to stop the MySQL server process, start the MySQL server with the --skip-grant-tables and --skip-networking options, and then connect to the MySQL server as the root user.

    What is the password for the root user in MySQL Workbench?

    The password for the root user in MySQL Workbench is the one you set during the installation of MySQL. If you haven’t set any password, you might be able to log in directly.

    How to change SQL password using CMD?

    You can change the SQL password using the command line by using the ALTER USER statement.

    How to reset MySQL root password in Docker?

    To reset the MySQL root password in Docker, you need to first access your MySQL container using the docker exec command and then, follow the steps described in this post to reset your root password.

    How to reset the root password in MySQL Mac?

    To reset the root password in MySQL on a Mac, you need to stop the MySQL Server first. Then, start the server in safe mode with a privilege bypass. In a new window, connect to the database, set a new password (as explained in this post), and flush the permissions.

    Can a MySQL user change their own password?

    Yes, a MySQL user can change their own password using the SET PASSWORD or ALTER USER statement.

    How to Recover the MySQL Root Password?

    Unfortunately, you cannot retrieve the MySQL root password. However, you can reset it by following the steps mentioned in this post.

    How to find MySQL root password in RunCloud?

    If you install RunCloud via manual installation, then the MySQL root password is displayed on your terminal screen at the end of the RunCloud agent installation on your server.

    Wrapping Up

    RunCloud is a powerful and easy-to-use platform that helps you manage your websites on any cloud server. With RunCloud, you don’t need to be a Linux expert to set up, secure, and optimize your web applications. You can do everything from a simple and intuitive dashboard, saving you time and hassle.

    RunCloud supports various web servers, PHP versions, databases, and frameworks. You can also monitor your server performance, back up your data, and automate your tasks with RunCloud. Whether you are a developer, a freelancer, or a business owner, RunCloud can help you run your websites faster and smoother.

    What are you waiting for? Join RunCloud today and enjoy the best web hosting solution for your websites. It’s free for 7 days, no strings attached!

  • Why Authentication Using SSH Public Key is Better than Using Password and How Do They Work?

    Why Authentication Using SSH Public Key is Better than Using Password and How Do They Work?

    What is SSH?

    SSH, or Secure Shell, is a network protocol that allows users to remotely manage their servers or computers over the Internet, in which the communication between the two machines are strongly encrypted and protected from being eavesdropped. The user runs a client on his or her machine and the network connection carries the user’s keystrokes and commands from the user’s local machine to the remote server. The network connection then carries back the server’s responses to the user.

    Compared to the older method of remotely managing the computers using a non-protected network protocol like telnet and rlogin, SSH presents a secure alternative over an unsecured network connection (like Internet). Nowadays SSH comes shipped in mostly (if not all) servers.

    A user can connect to the remote server by keying in the username and password through SSH by running the puTTY client, Terminal, Bash or any other clients. However, there is another option that is safer and less cumbersome then keying in your password every time you want to connect to your remote server, which is to authenticate using SSH public key on the said SSH server.

    What is SSH public key authentication and how do they work?

    An SSH server can authenticate a user in several ways, where the most commonly used method would be through passwords and public key authentication.

    Normally, how a user would securely connect to their server would be to open up  puTTY/Terminal/Bash and initiate an SSH connection either by logging in using a GUI or typing in a terminal ssh username@IPAddress and then proceed to key in the password when prompted.

    But instead of keying in your password in the puTTY/Terminal client when you want to login to your remote server, another way to safely authenticate would be to authenticate using an SSH public key, which is authenticating without keying in the password.

    SSH key authentication works in pairs: private key and public key. Unlike symmetric encryption (which uses the same key to encrypt and decrypt), SSH key authentication employs asymmetric encryption algorithm, where the encryption and decryption use different keys.

    A user (or an authorised person) needs to generate both private key and a public key. The private key must be kept safely and confidential, to the extent of not sharing it with anybody else. If the private key is compromised, it is almost as good as gone, as the malicious user may gain access to the remote server using the private key, moreover if the private key is unprotected by any passphrase.

    The public key which was generated together with the private key can be shared with any server. The public key is then uploaded to the remote server that the user wants to log in using the SSH protocol. Hence, a relation may also be such that; one private key to one public key placed in many servers.

    Another person having access to a public key does not mean that he/she can decrypt the messages. Only a user with the private key can decrypt the messages. The public key is only there as a means to encrypt the messages where the messages can only be decrypted by the person with the private key. It is safe to say that private key cannot be derived from the public key. Hence, the public key does not have the ability to decrypt the messages that it sends out, or even decrypt the messages that the private key has encrypted.

    ssh authentication protocol

    SSH Public Key Authentication simplified

    So in the case where a user is authenticating using the SSH keys (instead of manually keying in the password), the server will then send an encrypted challenge statement back to the user and the user will then decrypt the message with the private key and then send it back to the remote server to be checked. The server will then verify that that the message is correctly decrypted and if it matches the challenge statement earlier, then the client is authenticated.

    Basically, the remote SSH server is testing the client whether the client has the right private key that is associated with the public key on that remote server. If the client can prove that it has the right private key, then the client is authenticated.

    Why authenticate using SSH key instead of password?

    Undeniably, the main advantage of authentication using SSH public key over authentication using password would be security. No matter how long or complex a password is, it can never equate with the cryptographic strength that SSH public key offers.

    A password is susceptible to brute-force attack by a malicious user or worse, a password can even be guessed by someone who knows about the user’s personal information that can be used to retrieve the password.

    Additionally, using SSH public key also would eliminate the need for users having to remember complicated passwords or writing them down.

    Public key authentication also allows for a non-interactive login should a user need to access a remote server multiple times without needing to key in the password multiple times every time he or she logs in (or when session is disconnected due to idle time) as well as to automate processes that need to be authenticated which come from a remote machine.

    Best Practices

    However, all the above advantages are meaningless if the private key is not kept in a safe place. To increase the security, instead of storing the private key on a hard drive, it is recommended that that it is stored on a cryptographic device like a smart card or a usb token, so that it is not accessible by malicious users should an unauthorized user gains access to the computer. Additionally, the private key can be encrypted with a passphrase. But this is only applicable for interactive logins (for non-automated tasks) as it may require a person to key in the passphrase in order to use the private key.

    Since creating a pair of SSH keys requires minimal effort, often times, keys are generated or re-generated (and in many cases, self-provisioned) unnecessarily just to solve minor issues. If left unchecked, this can lead to unmanaged chaos where there are many public keys without knowing who they are attached to, or whether the person is still authorized to access the servers. As such, policies and rules must to be implemented to regulate the usage of private and public keys in any organisation, like keeping an inventory,

    RunCloud servers support the use of SSH public key authentication and it can be done easily and quickly.

    Wrapping Up

    RunCloud is a powerful and easy-to-use platform that helps you manage your websites on any cloud server. With RunCloud, you don’t need to be a Linux expert to set up, secure, and optimize your web applications. You can do everything from a simple and intuitive dashboard, saving you time and hassle.

    RunCloud supports various web servers, PHP versions, databases, and frameworks. You can also monitor your server performance, back up your data, and automate your tasks with RunCloud. Whether you are a developer, a freelancer, or a business owner, RunCloud can help you run your websites faster and smoother.

    What are you waiting for? Join RunCloud today and enjoy the best web hosting solution for your websites. It’s free for 7 days, no strings attached!

  • How to Create Wildcard Subdomain for Unlimited Subsites

    How to Create Wildcard Subdomain for Unlimited Subsites

    What is Wildcard subdomain

    Wildcard subdomain is a wildcard (catch-all) DNS record that will match request for non-existent subdomains. It is specified by a “*” as part of the domain name, example: *.yourdomain.com.

    With wildcard subdomain setup, you do not need to create a DNS record for each subdomain. Example: unlimited subdomain for WordPress multisite setup.

    In this tutorial, you will learn how to create a wildcard subdomain with RunCloud.

    Step 1: Create a wildcard subdomain with domain registrar

    In order to create a wildcard subdomain, you need to add a wildcard DNS recoord for your domain name. You will need to access your domain name control panel for DNS management, usually provided by your domain registrar.

    Here I will show you how to create a wildcard subdomain for your RunCloud server. In this example, I am using Cloudflare for DNS management.

    Goto DNS management page and follow the steps below to create a wildcard subdomain DNS record:

    1. Select “A” for record type (you can also use CNAME)
    2. Use “*” for DNS record name
    3. Fill in your RunCloud server IP address for the DNS record value
    4. If you are using Cloudflare, select “grey cloud” to skip going through Cloudflare network.
    5. Click “Add Record” button to add the wildcard subdomain DNS record

    Next, we need to setup the RunCloud server to response to the wildcard subdomain requests.

    Step 2: Create web application for wildcard subdomain with RunCloud

    There are two ways to response to the wildcard suddomain requests:

    1. create web applications to response to each wildcard subdomain request. Example: a.yoursite.com, b.yoursite.com, c.yoursite.com, …
    2. create a web application that answers all wildcard subdomain requests. Example: *.yooursite.com

    Solution 1: Create a web application for each subdomain
    At “Web Application” in RunCloud panel… Click “Create Web App” button to create a new web application.

    Remember to type your desire subdomain name (a.yoursite.com) for “Domain Name”. select PHP version and web application stack then click “add web application” button to create a new web application on your server.

    Any future request to the subdomain will be served by the web application you just created. Do not need to add a new subdomain DNS record at domain management panel.

    Any subdomain request that is not assigned to any web application will be fall back to the default web application (if you have setup one).

    Solution 2: Create a web application to answer all subdomain requests

    If you have a web application like WordPress multisite, that will answer all subdomain requests, then use this approach to setup the web application that for wildcard subdomain.

    Similar to Solution 1 above, create a new web application but at the “Domain Name” field, you enter a wildcard subdomain instead, example: *.yoursite.com

    The web application with wildcard subdomain will answer all subdomain requests that is not assigned to any other web applications.

    Let’s say you have a web application with domain name “client.yoursite.com”, then request for “client.yoursite.com” will not be answered by the web application with wildcard subdomain “*.yoursite.com”.

    Tips: After creating a wildcard subdomain, you would like to make a free SSL certificate (HTTPS) for all the subsites.

    Summary

    In order to create a working wildcard subdomain, you need to setup it at domain registrar (add wildcard DNS record) and RunCloud panel (create web application).

    Once setup wildcard subdomain, you do not need to manually add new subdomain DNS record for your new web application or website.

    All you need to do is create a new web application using RunCloud panel and it will work automatically.

  • How to Create a Subdomain for RunCloud Web Application

    How to Create a Subdomain for RunCloud Web Application

    Subdomain is an easy and free way to categorize your website content and separate them from the main website. In this tutorial, you will learn what is a subdomain, the use cases, and how to host a web application at subdomain using RunCloud.

    What is a Subdomain?

    A subdomain is a domain that is a part of a root domain, separated by a dot (“.”). For example, sub.domain.com is a subdomain of the root domain yourdomain.com .
    Subdomain is used as an easy way to create a memorable website address to organize your website content. For example, gallery.yoursite.com for the photo galleries of your website.
    Uses of subdomain includes:

    • Organizing website content according to category, i.e: support.yoursite.com, download.yoursite.com, shop.yoursite.com
    • Serve sub website for other users, i.e: jeff.yoursite.com, admin.yoursite.com, user1.yoursite.com
    • Make long link easy to remember. For example, shorten the long link https://yoursite.com/special/content/you-cannot-remember-this/123121513/ to a subdomain special.yoursite.com
    • Create a copy of your main website for testing. You can clone your main website into subdomain for testing and development, i.e: beta.yoursite.com
    • Mobile website: m.yoursite.com
    • Location specified website: malaysia.yoursite.com

    Create a subdomain for RunCloud Web Application

    It is easy to use a subdomain for your web application using RunCloud panel.
    Firstly, you will create a web application as usual but at the “Domain Name” field, you enter the subdomain instead of the root domain. Choose the PHP version and server stack, then click “Add Web Application” button to create the web application at subdomain.
    Now you need to add a DNS record for the subdomain to your domain name’s DNS zone.
    In this article, I use CloudFlare DNS for example. If you are not sure how to do it, please refer to your DNS hosting provider (usually also your domain registrar) for support.
    Here are the steps to add a subdomain DNS record for your RunCloud web application:

    1. Get your server IP address. You can view and copy the server IP address at the RunCloud servers overview or server summary page. Simply click on the IP address (numeric string) below server name to copy it. Write down the IP address because we will need it later.
    2. Login your DNS hosting control panel to add a new DNS record into your domain name’s DNS zone.
    3. Add a new “A” type DNS record, with the subdomain name and point to the server IP address. For example, sub is the subdomain and 0.0.0.0 is the server IP address (refer screenshot below)

    Now you can visit sub.yoursite.com and RunCloud will serve your web application at the subdomain as usual.

  • How to Block IP Address Using WordPress .htaccess File to Stop Bad Visitors

    How to Block IP Address Using WordPress .htaccess File to Stop Bad Visitors

    In this tutorial, we show you how to block bad visitors by their IP addresses using only Apache .htaccess file. No WordPress plugin required.

    Your public website is on the internet for anyone, including bad visitors like bad bots, spammers, hackers, malicious users. They are annoying, taking up your web server resources, and potential security risk.
    The good news is that you can “blacklist” them by blocking their IP address. An IP address is a string of 4 numbers separated by a single dot (IPv4) or 8 groups of 4 hexadecimal digits (IPv6). Each device on the internet is identified by an unique IP address.

    At RunCloud, we support 4 different web server stack:

    If you are using NGINX+Apache2 Hybrid web server stack, then you can easily block IP address using the .htaccess file in your WordPress root folder.

    What is .htaccess file

    .htaccess is a configuration file for Apache web server. You can create and edit an .htaccess file using any plain text editor.

    When the Apache server loads a web folder, it detects and execute the .htaccess file. .htaccess file can be used to modify Apache server configuration, enable or disable functionality and features — including blocking visitors by IP address.
    One of the advantages of using .htaccess is that it is executed before website is loaded. It also does not take up system resources like PHP & MySQL.

    Identify bad IP addresses

    We need to identify a bad IP address before we can block it. Here we show two ways to find bad IP addresses that visit your WordPress site.

    1. Find IP address of spammers

    WordPress dashboard comments IP address

    Login your WordPress dashboard then goto Comments. Click on “Spam” to list all the spam comments. The spammer’s IP address is displayed in the “Author” column. Identify the repeating spammers then copy their IP addresses. We will block them later.

    2. Find IP address of brute force attacks or login attempts

    We can find all visitors IP addresses in the web server access log file. It is a bit tricky and takes some experiences to identify a bad visitor.

    Apache access log file path on RunCloud is:

    /home/runcloud/logs/apache/app-name_access.log
    • runcloud is the RunCloud default system user name. Replace it with your own system user name.
    • Replace app-name with your web application name.

    Check the Apache server log file and identify IP addresses that repeatedly visit (flooding) your website pages in a short period (every few seconds).

    RunCLoud Log file

    Who is the IP address?
    Write down the suspicious IP addresses. It is a good idea to check who owns the IP addresses before blocking them. You do not want to mistakenly blocking a genuine visitor like Google bots, right? Simply visit https://who.is/ to check the owner of an IP address.

    Block IP address using WordPress .htaccess file

    Warning: Your website may not be accessible if you mess up the .htaccess file. Please make sure you backup your .htaccess file before edit it.

    Now you have a list of bad IP addresses you want to ban them from visiting your website. You can easily block the IP addresses using .htaccess file.

    Please note that .htaccess file only works if you are using Apache or NGINX+Apache2 Hybrid web server stack.
    A default WordPress .htaccess file will look like the below:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Depends on your site configuration, your .htaccess file may look different. It is fine. Make sure you make a backup copy of the .htaccess file.

    Edit your WordPress .htaccess file using any plain text editor (or RunCloud web based file editor) and add the following lines to the top of the file:

            Order Allow,Deny
            Allow from All
            # add new line to block eacg IP address
            # 192.168.8.1

    Add each IP address that you want to block as a new line below the above lines. Save the .htaccess file and any visitors with the IP addresses are unable to access your site.

    Tip: You can temporary unblock an IP address by comment it — add a “#” at the beginning of the line.

    Bonus: 6G Firewall

    Now that you know how to block an IP address using WordPress .htaccess file. It is a small step to fight malicious visitors.

    Blocking visitor by IP address is a temporary solution because IP addresses change constantly. It is best for quickly blocking certain visitors.

    Check out the 6G Firewall by Jeff Starr, if you are looking for more complete WordPress security protection using only .htaccess file. It is free and open source.

    Fine-tuned to minimize false positives, the 6G Firewall protects your site against a wide variety of malicious URI requests, bad bots, spam referrers, and other attacks.

    Hope this article is helpful to you fighting annoying malicious visitors to your WordPress site. Please share with us about how do you ban bad website visitors in the comment.

    Wrapping Up

    RunCloud is a powerful and easy-to-use platform that helps you manage your websites on any cloud server. With RunCloud, you don’t need to be a Linux expert to set up, secure, and optimize your web applications. You can do everything from a simple and intuitive dashboard, saving you time and hassle.

    RunCloud supports various web servers, PHP versions, databases, and frameworks. You can also monitor your server performance, back up your data, and automate your tasks with RunCloud. Whether you are a developer, a freelancer, or a business owner, RunCloud can help you run your websites faster and smoother.

    What are you waiting for? Join RunCloud today and enjoy the best web hosting solution for your websites. It’s free for 7 days, no strings attached!

  • Cloudflare DNS for RunCloud (Security & Performance)

    Cloudflare DNS for RunCloud (Security & Performance)

    Cloudflare DNS is one of best DNS providers in the world. It offers free accounts so everyone can not only manage their domain names, but also benefit from the additional security and performance enabled by their integrated features. In this article, we will share some tips to enable you to use Cloudflare with RunCloud and improve your server and web application’s security and performance.

    What is Domain Name System (DNS)?

    Domain Name Servers (DNS) are the Internet’s equivalent of a phone book. They maintain a directory of domain names and translate them to IP addresses. They are important so that you do not need to memorize a domain’s IP address, a string of numbers, for every website you wish to visit. Essentially, “runcloud.io” is far easier to remember than 45.56.94.252.

    Most domain name registrars include DNS management tools with their domain registration service. In addition, there are also free DNS services available if your domain registrar does not include DNS hosting, or if you prefer to manage your DNS elsewhere.

    Cloudflare, the Best DNS for Everyone

    Cloudflare is a U.S. company that provides DNS services, a Content Delivery Network (CDN), DDoS protection, and other Internet security services.

    Cloudflare DNS is one of the top 3 domain name services in the world and the fastest performance DNS provider.

    Cloudflare, DNS updates only take a few seconds, so no more waiting for DNS propagation that could take up to 48 hours with other services.

    Best of all, Cloudflare is available for absolutely everyone. You can sign up for a free Cloudflare account, and benefit from extra add security and performance features with no extra cost.

    Using Cloudflare on RunCloud

    RunCloud offers an easy way to manage your server and web application. You still need a DNS service to resolve your domain name to your RunCloud managed server’s IP address and load your web application.

    The following are some tips for RunCloud customers who are using Cloudflare’s DNS service for their servers:

    1. Restore visitor’s real IP addresses

    Cloudflare acts as a proxy to your RunCloud server, thus all visitors will appear from Cloudflare IP addresses. This is a hindrance to visitor tracking or identifying attackers.

    In order to restore a visitor’s IP address, we need to retrieve the visitor’s originating IP address in the HTTP header from all Cloudflare’s IP addresses.

    Login to your RunCloud server by SSH as root. Then, edit /etc/nginx-rc/main-extra.conf :
    # nano /etc/nginx-rc/main-extra.conf

    Add the following lines in the file:

    set_real_ip_from 103.21.244.0/22;
    set_real_ip_from 103.22.200.0/22;
    set_real_ip_from 103.31.4.0/22;
    set_real_ip_from 104.16.0.0/12;
    set_real_ip_from 108.162.192.0/18;
    set_real_ip_from 131.0.72.0/22;
    set_real_ip_from 141.101.64.0/18;
    set_real_ip_from 162.158.0.0/15;
    set_real_ip_from 172.64.0.0/13;
    set_real_ip_from 173.245.48.0/20;
    set_real_ip_from 188.114.96.0/20;
    set_real_ip_from 190.93.240.0/20;
    set_real_ip_from 197.234.240.0/22;
    set_real_ip_from 198.41.128.0/17;
    set_real_ip_from 199.27.128.0/21;
    set_real_ip_from 2400:cb00::/32;
    set_real_ip_from 2606:4700::/32;
    set_real_ip_from 2803:f800::/32;
    set_real_ip_from 2405:b500::/32;
    set_real_ip_from 2405:8100::/32;
    set_real_ip_from 2c0f:f248::/32;
    set_real_ip_from 2a06:98c0::/29;
    real_ip_header X-Forwarded-For;
    

    Make sure you check your NGINX configuration files syntax for errors after editing them:
    # nginx-rc -t

    Then, reload the NGINX service:
    # systemctl reload nginx-rc

    Now your visitors will be shown with their real IP addresses.

    2. Stop Cloudflare’s HTTPS redirect loop

    If you are combining Cloudflare Flexible SSL option and SSL (Let’s Encrypt or Custom SSL) on your Web Application, it can cause a redirect loops, causing the browser to display “The page isn’t redirecting properly’ or “ERR_TOO_MANY_REDIRECTS”.

    The solution would be using Cloudflare Full SSL or Full (Strict) SSL. Or, use only the Cloudflare SSL and remove the RunCloud generated SSL certificate from your Web Application’s Management panel in the RunCloud dashboard.

    3. Protect Your Web Application using CloudFlare Page Rules

    Cloudflare offers Page Rules to control your Cloudflare settings by URL. It is useful to add custom settings to certain web paths, for example you may wish to set higher security on your application login page. The following are the Page Rules to protect a WordPress application’s login page and admin panel:

    Protect WordPress login page
    cloudflare dns for runcloud
    URL: domain.tld/wp-login.php*

    Page Rule Settings:

    • Browser Integrity Check: On
    • Security Level: I’m Under Attack
    • Cache Level: Bypass

    Protect WordPress admin panel
    cloudflare dns for runcloud
    URL: domain.tld/wp-admin*

    Page Rule Settings:

    • Browser Integrity Check: On
    • Security Level: I’m Under Attack
    • Cache Level: Bypass

    Cloudflare “I’m Under Attack” mode adds an additional set of protections to a site to stop potentially malicious HTTP traffic from being passed to your server. When activated, your visitor will receive an interstitial page for about 5 seconds while Cloudflare check to make sure it is a legitimate human visitor.

    4. Improve Web Performance

    By default, Cloudflare only caches specific static file types and not HTML and other resources. You can use the Cache Everything mode in a Page Rule to achieve maximum performance by caching other non-static file extensions (full page cache).
    cloudflare dns for runcloud
    URL: domain.tld/*
    Page Rule Settings:

    • Cache Level: Cache Everything
    • Edge Cache TTL: 2 hours

    “Cache Everything” will cache whole web page contents on Cloudflare. The “Edge Cache TTL” controls the refetch time, setting how often Cloudflare checks the origin server for updated content. 2 hours means Cloudflare will check for updates for Cache Everything’s cache every 2 hours.

    Now you know some Cloudflare tips to improve your RunCloud server’s security and performance. Are you a Cloudflare user? What is your best tip? Please share in the comment.

    RunCloud provides the perfect platform for hosting your web applications in the cloud, and works seamlessly with other cloud leaders such as Cloudflare. Sign up today for a free trial and you can explore and enjoy all the benefits RunCloud has to offer.

  • RunCloud API Released, MariaDB 10.2, Change IP Address Feature

    RunCloud API Released, MariaDB 10.2, Change IP Address Feature

    RunCloud developers are always working hard to bring you new and better features. Today, we are happy to announce that the RunCloud API is now available for everyone!

    Another new feature added today is the ability to reconnect a RunCloud-managed server to the RunCloud Dashboard after its IP address has changed. You can do this with the Change IP Address setting.

    Also, new RunCloud-managed servers will install MariaDB 10.2 as the default database in their server stack.

    Manage your servers using the RunCloud API

    A RunCloud API has been one of the most requested features from developers, and today we are pleased to fulfil that request. We hope you will enjoy the powerful tools that the RunCloud API provides to manage your servers.

    With the RunCloud API you can achieve nearly all the tasks possible via the Dashboard.

    Including (but not limited to):

    • Automate server management tasks
      • Server connections
      • Disk Cleanup
      • Cron Jobs
    • Automate Web Application management tasks
      • Web App creation
      • Script or Git Deployment
      • SSL Deployment
    • Automate Database Management
    • Build a custom server control panel
    • Integration with 3rd-party software/service/plugins

    And so much more…

    In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application software. — Wikipedia.org

    All RunCloud API communication is made over secure HTTPS. Requests and responses are in human-readable JSON format.

    How to access your RunCloud API

    You need a RunCloud account to use the API. If you don’t have one yet, you can create a free RunCloud account.

    RunCloud API key

    An API Key pair, including both an API Key and an API Secret, is used for basic authentication. You need to supply these with every RunCloud API request. Your API keys are available from your RunCloud account Setting > API Key.

    Please treat your API keys as secret as your account credentials. If you believe your keys have become compromised, or for additional ongoing security, you can regenerate new API keys to revoke the old key’s access.

    What you can do with the RunCloud API

    The RunCloud API provides access to almost all RunCloud functions, such as connecting new servers, monitoring server health, stopping/starting a service, blocking an IP address, adding new system user, adding web applications and databases etc.

    Here is an example of a RunCloud API request to connect a new server:

    Request:

    curl -X POST "https://manage.runcloud.io/base-api/servers" \
        -u YOUR_API_KEY:YOUR_API_SECRET \
        -H "Content-Type: application/json" \
        --data '{
            "serverName": "My First Server",
            "ipAddress": "1.1.1.1",
            "serverProvider": "Custom Server Sdn. Bhd."
        }'
    

    Response:

    {
        "redirect": "\/servers\/M9ZpajdlbW8z\/notconnected",
        "server": {
                "id": "M9ZpajdlbW8z",
                "serverId": "NzoeztKvoRV8dYozQWHH7aI8Yu1518399464lSR9oRPQFVv4aJT4ujzNOu7hpINp3kG7RZLDRupBRbQMiYCgwwTLgfDPzYa4AVFj",
                "serverName": "My First Server",
                "ipAddress": "1.1.1.2",
                "serverProvider": "Custom Server Sdn. Bhd.",
                "connected": false,
                "online": false,
                "created_at": "2018-02-14 12:32:23",
                "created_at_humanize": "1 second ago",
                "_links": {
                    "installationURL": {
                        "method": "get",
                        "link": "https:\/\/manage.runcloud.io\/script\/installer\/NzoeztKvoRV8dYozQWHH7aI8Yu1518399464lSR9oRPQFVv4aJT4ujzNOu7hpINp3kG7RZLDRupBRbQMiYCgwwTLgfDPzYa4AVFj\/lNBqxUv1mwz8VIbjrYV4AHZFUuiAJrDuh7paeoEsAEOG76VhX8tcyo0wHWkTbY3k2Tm9Ty4H8Qwgq7Lefvf11xbXZ7n4Guy80stCHf3KCX7559sbzaU9WA9OAll8zPQn"
                    },
                    "delete": {
                        "method": "delete",
                        "link": "\/api\/servers\/M9ZpajdlbW8z"
                    }
                }
            }
    }
    

    Please treat the RunCloud API as a live beta preview now, with more features coming soon.

    You can refer to the complete RunCloud API documentation for all the RunCloud API resources & methods.

    Change a RunCloud Managed Server’s IP Address

    Change IP address

    Previously, RunCloud was not able to connect to your server if the server’s IP address changed, either manually or automatically. We understood that this limitation could indeed be very problematic.

    So today, we are glad to inform you that it is now possible to update a RunCloud-managed server’s IP address using the “Change IP Address” feature. It allows RunCloud to reconnect to your server using its new IP address.

    Run script to change IP address

    You will need to first submit the server’s new IP address, then you will be provided a a generated script that you will need to run as root within the server. The script will update your server’s registered IP address with RunCloud, enabling reconnection.

    MariaDB 10.2 for New RunCloud Managed Server

    RunCloud will now deploy new servers with MariaDB 10.2 database server.

    MariaDB 10.2 is the current major stable version, with official support until May 2022. Check out the overview of the changes & improvements in MariaDB 10.2.

    The most noteworthy new feature in MariaDB 10.2 is “InnoDB as default storage engine”. XtraDB was the default storage engine until MariaDB 10.1

    For existing servers, please refer to the official documentation of upgrading MariaDB 10.1 to MariaDB 10.2. Here is the simplified upgrading steps:

    1. Shutdown MariaDB 10.1
    2. Take a database backup
    3. Uninstall MariaDB 10.1
    4. Install MariaDB 10.2
    5. Run mysql_upgrade
    6. Add new options to my.cnf to enable features

    Nodejs Binary

    Already provisioned servers use default Nodejs provided by Ubuntu. With the new update, the newly provisioned server will get the latest LTS version of Nodejs, which is Nodejs 8.* LTS.

    Summary

    • Now, you can integrate RunCloud API into your workflow and applications. Let us know what you will build!
    • The “Change IP address” settings feature allows you to reconnect a server after any manual/automatic IP address change.
    • MariaDB 10.2 was installed for new RunCloud-managed servers, with InnoDB as the default storage engine.

    Wrapping Up

    RunCloud is a powerful and easy-to-use platform that helps you manage your websites on any cloud server. With RunCloud, you don’t need to be a Linux expert to set up, secure, and optimize your web applications. You can do everything from a simple and intuitive dashboard, saving you time and hassle.

    RunCloud supports various web servers, PHP versions, databases, and frameworks. You can also monitor your server performance, back up your data, and automate your tasks with RunCloud. Whether you are a developer, a freelancer, or a business owner, RunCloud can help you run your websites faster and smoother.

    What are you waiting for? Join RunCloud today and enjoy the best web hosting solution for your websites. It’s free for 7 days, no strings attached!