Author: RunCloud Team

  • CentOS vs Ubuntu – Which One Should You Choose in 2025?

    CentOS vs Ubuntu – Which One Should You Choose in 2025?

    For many people getting started with Linux there’s an important debate to settle about which Linux distribution is best – it’s the battle of CentOS vs Ubuntu, and which one to go for.

    Let me save you some time – they are all best… it just depends on which distro is best for what!

    Many Linux users get stuck in the eternal loop of trying out new Linux distributions, distro-hopping from one distribution to another like a caffeinated kangaroo, unable to settle on one Linux flavor. If that’s you, then happy hopping!

    But if you’re just looking for a good and stable operating system that gives you flexibility and the freedom to do what you want (without asking you for a piece of your soul in exchange for monthly subscriptions and microservices), then you’re in the right place.

    In this post, we will take a look at two of the most well-known and renowned Linux distributions that you can find on the internet – CentOS and Ubuntu.

    Without spoiling too much! Let’s get started!

    What is CentOS?

    CentOS (short for Community Enterprise Operating System) was a free and open-source distribution based on Red Hat Enterprise Linux (RHEL) which aimed to provide a stable, reliable, and secure platform for servers and workstations.

    It should not be confused with CentOS Stream which serves as the upstream development platform for upcoming RHEL releases.

    CentOS Linux is derived from the source code released by RedHat and it was recently discontinued by Red Hat in favor of its paid offering, Red Hat Enterprise Linux operating system.

    System Requirements for CentOS

    CentOS, a popular Linux distribution, has specific system requirements to ensure optimal performance. Here are the key requirements:

    • Architecture: CentOS supports AMD64, Intel 64, and 64-bit ARM systems.
    • Memory: The recommended minimum RAM varies depending on the installation type. For HTTP, HTTPS or FTP network installation, it’s 1.5 GiB.
    • Storage: The minimum available disk space should be 10 GiB.

    Recommended: What Are Linux Logs? What Are They & How to Use Them

    Advantages of CentOS

    There were many Advantages of CentOS over other Linux operating systems:

    1. Free and Open Source: CentOS was available at no cost, and used to come with full source code that can be modified, distributed, or reused under the terms of the GNU General Public License.
    2. Enterprise-Level Stability: It maintained binary compatibility with RHEL, which means software that runs on RHEL can typically run on CentOS without modification – this stability made it a popular choice for business applications.
    3. Community-Supported: While Red Hat offers official support for RHEL, CentOS relies on community support and contributions. This includes updates, security patches, and new features, all of which are provided by a dedicated and skilled community.
    4. Security: CentOS inherits the robust security features of RHEL, including SELinux (Security-Enhanced Linux), which provides various security policies, and a strong defense against vulnerabilities and exploits.
    5. Use Cases: As it was a robust and well-tested operating system, it was widely used in servers, hosting, and workstations where stability and reliability are critical. It’s also favored for development environments due to its compatibility with RHEL.

    Disadvantages of CentOS

    We have discussed the advantages, now let’s take a look at some of the disadvantages of CentOS:

    1. Outdated Packages: CentOS is based on the stable releases of Red Hat Enterprise Linux (RHEL), which means it often does not have the latest versions of software packages.
    2. Limited Desktop Environment: While CentOS is a robust choice for server environments, it may not be the best option for desktop use. It lacks the variety of desktop environments and user-friendly applications compared to other distributions like Ubuntu or Fedora.
    3. Less Software in Official Repositories: CentOS does not have as extensive software availability in its official repositories compared to other distributions. Users may need to add third-party repositories or compile software from source, which can be complex and time-consuming.
    4. Delayed Security Updates: Although CentOS is known for its stability and long-term support, there can be delays in receiving security updates. This is because updates are first applied to RHEL and then ported to CentOS, which can lead to potential security risks.
    5. Lack of Commercial Support: Unlike RHEL, CentOS does not offer any official commercial support. While there is a community of users who can provide assistance, this may not be sufficient for businesses or users requiring immediate or professional support.

    What is Ubuntu?

    Ubuntu is a widely used Linux distribution known for its user-friendly interface, regular release cycles, and strong community support. It’s based on the Debian distribution and comes in different editions, including Desktop, Server, and Core (for IoT devices and robots).

    Ubuntu is maintained and developed by Canonical Ltd., a British company that invests resources into keeping the operating system secure, updated, and user-friendly. Similar to CentOS, Ubuntu is also considered very stable; however, if you encounter a bug in Ubuntu, you can report it using the ubuntu-bug command. The bug report is logged locally and then uploaded to a central database by a separate program called whoopsie – Canonical uses this data to identify overarching issues and improve the system.

    The first official release of Ubuntu was Ubuntu 4.10 (Warty Warthog), which occurred on October 20, 2004. Since then, Ubuntu has followed a predictable release cycle, with new versions every six months.

    System Requirements for Ubuntu

    Ubuntu is designed to provide a minimalist base that can run on a wide range of hardware, from IoT devices and PC-style platforms to industrial computing. The system requirements are flexible but generally constrained by the following minimum values:

    • Architecture: Ubuntu Core supports various 64-bit architectures and 32-bit Arm, including amd64 (Intel/AMD 64-bit), arm64 (64-bit Arm), armhf (32-bit Arm), and riscv64 (64-bit RISC-V).
    • Memory: The minimum RAM required for Ubuntu Core is 512MB. However, devices with more on-board RAM can take full advantage of Ubuntu Core’s capabilities.
    • Storage: Ubuntu Core requires a minimum storage of 1GB.

    If you want to handle your Ubuntu Servers without dealing with technical stuff, take a look at RunCloud Server Management Tool. With RunCloud, you can focus on building apps instead of worrying about server issues – it helps you manage and deploy web applications securely without the hassle.

    An image from RunCloud Dashboard, where you can connect any Cloud or VPS Server.

    Also Read: How to Install WordPress with Apache on Ubuntu

    Advantages of Ubuntu

    If you’re planning to use Ubuntu, there are plenty of good things for you to look forward to:

    1. Desktop and Server Options: Ubuntu offers both desktop and server editions, making it versatile for various use cases. This allows you to run the same software on both your server and desktop, reducing complexities and ensuring consistency across your infrastructure.
    2. Community Support: Sooner or later, you will hit a snag; Ubuntu has a vibrant and active community of users, developers, and enthusiasts who contribute to forums, blogs, and social media, providing help, tips, and solutions.
    3. Software Availability: One of the best things about Ubuntu is that its package repositories contain a vast selection of software applications. You can easily find and install software using package managers like apt or the graphical Ubuntu Software Center.
    4. Long-Term Support: Ubuntu releases special build versions tagged with LTS. These releases are designed for stability, predictability, and extended support. A new release occurs every two years and is supported for five years on the desktop version and ten years on the server version using Extended Security Maintenance (ESM) service. This makes it ideal for large-scale deployments, enterprises, and critical systems where updating frequently is not possible.

    Disadvantages of Ubuntu

    Let’s take a look at some reasons why you shouldn’t pick Ubuntu:

    1. Privacy Concerns: Some versions of Ubuntu have been criticized for privacy reasons due to the inclusion of Amazon web app.
    2. Frequency of Releases: Ubuntu’s frequent release cycle can be a disadvantage for users who prefer stability over new features. While LTS (Long Term Support) versions are released every two years, non-LTS versions are released every six months and are supported for only nine months.
    3. Less Control Over the System: Compared to other distributions like Arch or Gentoo, Ubuntu does not offer as much control over the system. This can be a disadvantage for advanced users who prefer to customize their operating system at a deeper level.

    Suggested Read: How to Find Most Used Disk Space Directories and Files in Linux

    Difference Between CentOS vs Ubuntu [With Comparison Table]

    FeatureCentOSUbuntu
    OriginCentOS was a free version of the Red Hat Enterprise Linux (RHEL).Ubuntu is based on Debian.
    User FriendlinessCentOS was mainly used by server administrators due to its robustness and stability. It’s less user-friendly compared to Ubuntu.Ubuntu is known for its user-friendliness and is often recommended for beginners.
    Software UpdatesCentOS had a longer release cycle, providing a more stable platform. It was ideal for servers.Ubuntu has a faster release cycle, providing newer software and features.
    System AdministrationCentOS uses YUM (Yellowdog Updater, Modified) as its package management system.Ubuntu uses APT (Advanced Package Tool) for package management.
    SecurityCentOS is considered to have strong security, largely due to its enterprise-grade development.Ubuntu also has robust security measures in place and offers easy-to-use security updates.
    Under DevelopmentCentOS has reached end of life and new versions or security updates will not be released.Ubuntu is actively being developed and will continue to receive updates.

    CentOS was a solid choice for those who need an enterprise-grade operating system without the associated costs, and who can manage without the dedicated commercial support provided by Red Hat for RHEL.

    If you were previously using CentOS and are considering an alternative, both Rocky Linux and AlmaLinux are excellent choices.

    Rocky Linux aims to be a community-driven, open-source enterprise operating system that is 100% bug-for-bug compatible with Red Hat Enterprise Linux (RHEL). Similarly, AlmaLinux OS fills the gap left by the discontinuation of CentOS Linux stable releases – it is binary compatible with RHEL and has FIPS 140-3 certification, ensuring strong cryptographic security.

    Recommended: How To Flush DNS Cache — A Full Guide

    Wrapping Up: CentOS vs Ubuntu – Which Is Better?

    CentOS used to be an excellent choice for servers, especially when stability and compatibility with RHEL (Red Hat Enterprise Linux) are crucial. Unfortunately, CentOS has been discontinued, which means it won’t receive further updates or security patches.

    Ubuntu on the other hand has an active development cycle and is versatile, which makes it suitable for both servers and desktops. Ubuntu releases new versions predictably every six months, with free support for nine months, but you can pick Ubuntu LTS releases to get extended support for large-scale deployments.

    If you need an RHEL-compatible Linux distribution, consider Rocky Linux or Alma Linux as alternatives to CentOS. However, if you’re not tied to RHEL compatibility, we recommend using Ubuntu Server with RunCloud to simplify server management and deployment.

    RunCloud makes it easy to manage and deploy applications to the web, allowing you to focus on your projects without worrying about server administration.

    Sign up for RunCloud today to streamline your server management and deployment tasks!

    FAQ on CentOS vs Ubuntu

    What is the main difference between Linux and Ubuntu?

    Linux refers to the kernel, which is the core component of an operating system – it manages hardware resources, provides essential services, and allows software applications to communicate with the hardware.
    Ubuntu Is a complete operating system based on the Linux kernel – it includes not only the kernel but also essential system utilities, libraries, and software applications. Many different operating systems can be built using the same kernel, but one operating system can only have a single kernel.

    Is CentOS good for beginners?

    CentOS was discontinued, but when it was actively developed it focused on stability and security rather than providing the latest features. As a result, beginners find it less user-friendly compared with other distributions.

    Why is CentOS so popular?

    CentOS was known for its stability, making it a reliable choice for servers and critical systems, but as it is no longer being developed, new bugs or vulnerabilities will not be patched in the future – which is almost ironic.

    What is the difference between CentOS, Ubuntu, and Debian?

    CentOS, Ubuntu and Debian are all Linux distributions. To better understand the relationship between them, let’s consider an analogy:
    Ubuntu is a friendly kid who plays with everyone on the playground, while Debian can be considered as the parent of Ubuntu who is good friends with all the Ubuntu’s friends. CentOS, on the other hand, can be considered a foreign exchange student who doesn’t speak the same language as either Ubunu or Debian.

    Do all Linux OSes use the same commands?

    Most Linux distributions share common commands, but there can be variations due to package managers, system configurations, and default utilities.

    Can I run CentOS Docker on Ubuntu?

    Yes, Docker containers are platform-independent, which means you can run CentOS-based Docker containers on Ubuntu or any other Linux distribution.

    Do you need Ubuntu to run Docker?

    No, Docker runs on various operating systems, including Ubuntu, Windows, macOS, and many more.

  • Supercharging Your PHP Applications with Relay on RunCloud

    Supercharging Your PHP Applications with Relay on RunCloud

    Are you looking to boost the performance of your PHP applications? Look no further than Relay, the next-generation caching layer for PHP.

    Installing Relay on a RunCloud server is a straightforward process that can significantly enhance your application’s efficiency.

    In this post, we’ll guide you through the steps needed to get Relay up and running on your RunCloud server. But first, let’s see why using Relay is a smart choice.

    Why Use Relay?

    Relay is a Redis client for PHP built for enhancing the speed and performance of your web applications. Whether you’re running a cutting-edge app or a legacy codebase, it’s designed to supercharge anything. It’s built to be a drop-in replacement for PHPRedis and Predis – with several notable advantages over it. For example:

    • Active Invalidation: Relay actively invalidates its in-memory cache, allowing your application to update its runtime cache mid-request, solving an especially challenging problem in computer science.
    • Resource Efficiency: With Relay, you maintain a partial replica of Redis’ data in memory, handling millions of requests per second while minimizing network communication.
    • Non-Blocking Calls: Relay’s asynchronous, multi-threaded, and lock-free nature removes the bottleneck of Redis’ single-threaded architecture.
    • Scalability: It is designed with shared environments in mind – Relay allows you to set memory limits and automatically evicts keys using LRU and LFU policies.

    How to Install Relay on a RunCloud Server

    At RunCloud, we use our own spin of Nginx and PHP, so the default installation steps will not work. In this section, we will walk you through the steps of installing Relay.

    But before we start, make sure that you have configured SSH access for your server.

    1. Identify the PHP version: RunCloud supports multiple PHP versions and you will need to install Relay for each of them separately. But before you do that, you will need to find the path of the PHP version that you want to use.
      For PHP 8.1, the path of the installation would be /RunCloud/Packages/php81rc/ and the configuration location would be /etc/php81rc/php.ini. You can find the exact location of PHP binaries from the RunCloud documentation.
    2. Connect to your server with root privileges: To install a PHP module on your server, you will need to log in via SSH with the necessary privileges.
    3. Check PHP Modules: The Relay module requires you to install json, igbinary, and msgpack extensions on your server. RunCloud automatically installs them by default, but you can check whether they are installed by executing the following command:
    <path to PHP>/bin/php -m | grep -e json -e igbinary -e msgpack

    Make sure to replace <path to PHP> with the value that we noted down in step 1. Once you execute the command, you should see a list of all three modules.

    1. Download Relay: Once you are sure that all necessary modules are installed, you can go to the releases page and copy the URL for the latest release for your PHP version. In the Operating System drop-down, select the Debian/Ubuntu and copy the URL of the binary for the x86 architecture by right-clicking on the name and selecting Copy Link Address.
      For example, in the following demonstration we selected the binary with the following name relay-v0.7.0-php8.1-debian-x86-64.tar.gz.
    relay releases
    1. Next, go back to your SSH terminal and use the wget command to download Relay into an empty directory. For example, here is the command (below) for downloading Relay v0.7 for PHP 8.1. If you want to download a different file, you can replace the URL in the last step with the one that you copied earlier.
    mkdir /tmp/relay
    cd /tmp/relay
    wget https://builds.r2.relay.so/v0.7.0/relay-v0.7.0-php8.1-debian-x86-64.tar.gz
    1. Extract the downloaded file: Next, you need to use the tar command to extract the downloaded file. For example:
    tar -xvf ./relay-v0.7.0-php8.1-debian-x86-64.tar.gz

    In the above command, replace relay-v0.7.0-php8.1-debian-x86-64.tar.gz with the name of your file.

    Hint: You can just type relay and press the Tab key on your keyboard to autocomplete the name.

    1. Check dependencies: After extracting the archive, change the current working directory with the cd command, and then use the ldd command to check if all the dependencies are met. For example:
    cd relay-v0.7.0-php8.1-debian-x86-64
    ldd ./relay-pkg.so
    sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" ./relay-pkg.so

    Make sure to replace the relay-v0.7.0-php8.1-debian-x86-64 with the name of the folder on your server. After you execute the command, it should look something like the following screenshot:

    If you see a “not a dynamic executable” error, then the downloaded build doesn’t match the OS/architecture, or your distro is blocking ldd calls in /tmp.

    If any dependency says “not found”, the missing library needs to be installed.

    1. Locate the PHP extensions Directory: If you don’t see any missing dependencies in the previous step, you can proceed to installing the package. To do this, we simply need to copy the package file into a specific directory. Run the following command to get the path of the directory, making sure to replace the <path to PHP> with the value that we noted down earlier:
    <path to PHP>/bin/php-config --extension-dir
    1. Copy the Relay package: The output of the previous command gave us the location of the extensions directory. Now we will use the cp command to copy the Relay package to the PHP extensions directory.
    sudo cp ./relay-pkg.so <path to folder>/relay.so

    Make sure to replace the <path to folder> with the output of step 5. If you perform this step correctly, then you will not see any output.

    1. Configure Relay: After copying the package binary, we need to configure some basic settings for the Relay by editing the relay.ini file. Run the following command to append the recommended settings in the configuration file. Alternatively, you can refer to the official documentation and edit the file manually using a text editor such as nano.
    echo "relay.maxmemory = 128M
    relay.eviction_policy = noeviction
    relay.environment = production
    relay.key = 1L0O-KF0R-W4RDT0-Y0URR3P-0RTMRBR-OCC0L1" >> relay.ini
    1. Set the INI file: Next, we need to copy this file to the INI directory for your PHP version. To do this, we will use the php-config command to find the INI directory and copy the relay.ini file using the cp command. For example:
    <path to PHP>/bin/php-config --ini-dir

    In the above command, make sure to use the correct path for your PHP installation and note down the output – it should look similar to /etc/php81rc/conf.d.

    Next, use the following command to copy the file to the correct location. Don’t forget to replace <path to INI directory> with the values that you noted down in the previous step.

    cp ./relay.ini <path to INI directory>

    If you perform this step correctly, then you will see no output.

    1. Test Relay: Finally, we can check whether it is installed correctly by using the –ri option in PHP command. For example:
    <path to PHP>/bin/php --ri relay

    The above command should give you a list of all the configuration settings that Relay is using. Your output should look similar to the following screenshot:

    Alternatively, you can create an empty web app on your RunCloud server and use the file editor to create a PHP page with the following code to test Relay:

    <?php
    $relay = new \Relay\Relay(host: '127.0.0.1');
    var_dump($relay->ping('Hello World!'));
    ?>

    After adding the PHP code, save and close the editor. When you visit this page in a browser, you should see Hello World!.

    That’s it! You have successfully installed Relay on your RunCloud Ubuntu server. If you encounter any issues, feel free to ask for help in the comments below.

    After Action Report

    In this post we have guided you through the steps of installing Relay for PHP 8.1 on Ubuntu. After successfully installing Relay on your RunCloud server, you can start integrating it with a variety of existing technologies and popular platforms such as Laravel, Symfony, WordPress, Drupal, and Magento.

    If you are looking for a better way to manage websites, then you should check out RunCloud.

    RunCloud simplifies the complexities of server management, saving you time and automating routine tasks. With RunCloud, you can focus on what truly matters – growing your business and developing exceptional websites.

    Don’t let server management hold you back – join RunCloud now and experience the ease of managing websites like never before!

  • How to Fix the DNS_PROBE_FINISHED_BAD_CONFIG Error Code

    How to Fix the DNS_PROBE_FINISHED_BAD_CONFIG Error Code

    When browsing the internet, nothing is more frustrating than waiting for a website that takes seemingly forever to load.

    This situation is exacerbated when the website fails to load entirely.

    In this article, we will discuss two common errors – namely DNS_PROBE_FINISHED_BAD_CONFIG and ERR_CONNECTION_TIMED_OUT that you might face when browsing the internet.

    We will take a look at some of the common troubleshooting steps that you can perform, both as a visitor and the owner of a website.

    Let’s get started!

    Isolating The Error

    When you browse a website on the internet, there are many things that work in tandem to serve you the requested content. You will face a different error if any of these things go wrong. Therefore, it is important to identify what is causing the error.

    The quickest and most basic thing you can do first is to confirm that your internet connection is working properly. There are different ways to do this:

    • Open A Different Website: Try loading a different website. If none of the websites are loading, then there’s probably something wrong with your connection.
    • Try a Different Network: It is a good idea to check the website from multiple networks. This will help you identify any outage caused at your ISP’s end. Moreover, if you use a VPN or Proxy, you can try switching it off temporarily.

    If neither of the above solutions work, then the problem was caused at your end. If not, then you can try using a crash monitoring service. If you can open other websites, there are many online services such as Check If Down and Website Down Checker that you can use to check if a particular website is not working. If these tools report that the site is broken, then there’s nothing you can do as a website visitor, as this can only be fixed by the administrator.

    Case 1: Website is Down for You

    If the crash monitoring service tells you that the website is working for everyone else, then there are several steps you can take to resolve this issue.

    Clear Cookies and Cache

    A quick and easy fix for fixing this is by clearing the outdated and stale files in your browser. You can do this on most browsers by clicking on the ‘lock’ or ‘tune’ icon in the address bar, and following the instructions.

    RunCloud website screenshot

    Turn off VPN and Proxy

    If you are using either a VPN or a Proxy server and are facing connectivity issues, then you can try turning it off. VPNs and Proxy servers reroute your internet traffic, which can sometimes affect connectivity. Connecting to the internet directly by turning off the VPN or proxy would allow you to check whether the site is working properly.

    Firewall

    If you are located in a university or a corporate network, then it is possible that your traffic is being filtered by a firewall. The network administrators in these organizations can block or deny access to certain websites based on some internal policies.

    Even if you are not using a corporate firewall, your ISP can still block and monitor your internet traffic to comply with local regulations. For example, the Chinese government blocks a number of popular websites. Unfortunately, there is not much that can be done in this case apart from using a VPN to bypass the firewall.

    Update DNS Records

    More often than not, ISPs set their own DNS servers as default when configuring your internet connection. However, sometimes these are not reliable and can face outages. If you suspect your DNS isn’t working properly, you can change it to use a more reliable service.

    Here is a list of some of the most commonly used servers:

    • Cloudflare – 1.1.1.1
    • Google – 8.8.8.8
    • Quad9 – 9.9.9.9

    You use any of these publicly available servers. Just go to your network settings, look for an option to change your DNS server, and then simply replace the existing values.

    Reboot Router/PC

    If your internet connection is acting up, you can always try restarting your internet router, modem, and switches. Although this sounds simple, this is one of the most effective ways to troubleshoot hard-to-diagnose bugs.

    Case 2: Website is Down for Everyone

    If the crash monitoring tools tell you that the website is down for everyone, then the website admin can follow the given steps to troubleshoot the issue.

    Rebuild Web-app Configuration

    If your website is not serving requests properly, you can try re-building and deploying your web application again. With RunCloud you can do this from the dashboard directly.

    Just open your web application dashboard and navigate to the Tools menu in the left sidebar. Once there, click on the rebuild web app config button.

    Fixing error through RunCloud tools

    Revert Configuration Changes

    If you have recently edited your wp-config.php file, added new rules to .htaccess, or configured new Nginx rules, try rolling them back. With RunCloud, you can edit .htaccess and the wp-config files using the File Manager.

    The Nginx Config can be found under the Nginx Config menu.

    DNS error in Nginx config

    Disable Firewall

    Poorly configured firewalls can often cause issues. To fix this type of issue, try relaxing the rules of your firewall a little to troubleshoot the problems. With RunCloud, you can find these settings under the Firewall tab of web application settings.

    Managing firewall to fix err_connection_timed_out errors

    Revert to Last Working Backup

    For ecommerce websites, every minute offline means a loss of revenue. If you want to quickly restore your site then you can always revert to the last working backup of your site.

    However, you should keep in mind that any changes made to your site after the backup, but before the crash, will be lost. For example, if a user placed an order just before your site crashed, then that order will be lost.

    With RunCloud, creating and restoring backups is as easy as snapping your fingers. The whole thing can be done with just a few clicks. Read our post on How To Properly Back Up Your Website to know more.

    Wrapping Up

    In this post, we have discussed different issues that can cause DNS_PROBE_FINISHED_BAD_CONFIG and ERR_CONNECTION_TIMED_OUT errors. We have outlined different steps that you can take as either a normal user, or as the owner of your website to quickly get to the bottom of the issue.

    If you are running a WordPress website, it is always advisable to use staging sites for testing changes, and use an automated monitoring service such as Datadog, Newrelic, or Uptimerobot for tracking downtime.

    RunCloud makes managing servers and deploying your websites easier, start using RunCloud today!

  • How to Edit Files on Remote Servers with SSH and Nano

    How to Edit Files on Remote Servers with SSH and Nano

    If you manage a server using FTP, then it is highly likely that at some point you will have edited a file. In FTP, you would have had to download the file to your computer, edit it, and then upload it back to replace the existing file. Although this works, it is rather tedious.

    Do you want to learn a simple and efficient way to modify configuration files, scripts, or web pages on the fly? If so, this article is for you!

    You might think that editing files on remote servers is a complicated and fiddly task, but it is actually quite simple and fast with SSH and nano. You don’t need to install any software on your local machine, or transfer files back and forth between your computer and the server. You can just open a terminal, connect to the server, and start editing files with nano.

    In this article, you will learn how to use SSH and nano to edit files on remote servers.

    But first, let’s understand what Nano is.

    What is Nano?

    Nano is a command line based text editor. It is pretty similar to other text editors that you might have used in the past with one key difference – you don’t need a graphic user interface to use it.

    When editing files on a server, knowing how to use nano will come in handy. You can’t always rely on GUI-based editors, especially if you’re working on a headless server or a low-resource machine. Nano is lightweight, fast, and reliable, and it works well with SSH.

    There has always been a tussle in the Linux community to choose the best text editor. Some people swear by Vim, Emacs, Sublime Text, or other editors, and some even argue that the choice of text editor reflects one’s personality and skills. The following XKCD comic clearly illustrates this!

    Search for the best text editor
    Comic created by XKCD

    That being said, nano is a good choice for beginners, because it is easy to learn, intuitive to use, and has enough features to get the job done.

    But don’t take our word for it. According to a recent survey by StackOverflow, nano is still a very popular text editor among Linux users, with nearly 9% of people regularly using it. That means that thousands of Linux users prefer nano over other editors, and you can join them too!

    So, are you ready to learn how to edit files on remote servers with SSH and nano?

    Prerequisites

    Before you start editing files over SSH using nano, you should have the following:

    • Access to a remote server: You need to have a remote server that you can connect to via SSH. You can use any server that supports SSH, such as Linux, Windows, or even macOS. You also need to know the server’s IP address or hostname, the username and password (or SSH key) for logging in, and the port number for SSH (usually 22).
    • A terminal emulator: You need to have a terminal emulator on your local machine that can run SSH commands. You can use any terminal emulator that you are comfortable with, such as iTerm, PuTTY, or even the built-in Terminal or Powershell utility.

    If you have all the prerequisites, you are ready to edit files over SSH using nano. Let’s get started!

    How to Use Nano

    In this section, we’ll go through the steps of editing files over SSH using nano. But first, here is a quick refresher on connecting to your remote server using SSH. If you are connecting to a RunCloud server, you can refer to our post on connecting to the server via SSH.

    How to connect to a remote server using SSH

    To connect to a remote server using SSH, you need to open your terminal emulator and type the following command:

    ssh username@hostname -p port

    Replace ‘username‘ with your username on the remote server, ‘hostname‘ with the IP address or hostname of the remote server, and ‘port‘ with the port number for SSH (usually 22). For example:

    ssh alice@192.168.1.100 -p 22
    ssh bob@example.com -p 22

    You will then be prompted to enter your password or SSH key passphrase. After that, you should see a welcome message and a command prompt from the remote server.

    How to open a file in nano

    Once you have logged in to your server, you can start editing files. To open a file in nano, you need to type the following command:

    nano filename

    Replace ‘filename‘ with the name of the file you want to edit. For example:

    nano hello.txt

    If the file doesn’t exist, nano will create a new file with that name. If the file does exist, nano will open it and show its contents.

    opening files in nano

    You can edit the file by typing, deleting, or inserting text as you normally would with your keyboard. Nano will show the current line number, column number, and file name at the bottom of the screen.

    editing files in nano

    How to save and exit nano

    To save the file, you need to press Ctrl+O. Nano will ask you to confirm the file name and then save the file. Press ‘Enter’ to confirm it.

    To exit nano, you need to press Ctrl+X. Nano will ask you if you want to save the file before exiting. You can press Y to save the file, or N to discard the changes.

    How to search and replace text in nano

    To search for specific text in the file, you need to press Ctrl+W and type the text you want to find. Nano will highlight the first occurrence of that text and move the cursor to it. You can press Ctrl+W again to find the next occurrence, or Alt+W to find the previous occurrence.

    To replace text in the file, you need to press Ctrl+\ and type the text you want to replace, and then the text you want to replace it with. Nano will ask you if you want to replace the first occurrence of the text. You can press Y to replace it, N to skip it, A to replace all occurrences, or Ctrl+C to cancel the operation.

    How to copy, cut, and paste text in nano

    To copy text in the file, you need to mark the beginning of the text by pressing Alt+A and then move the cursor to the end of the text. The marked text will be highlighted. You can then press Alt+6 to copy the text to the clipboard. To cut text in the file, you need to mark the text as described above and then press Ctrl+K to cut the text and store it in the clipboard.

    Selection in nano

    To paste text in the file, you need to move the cursor to the position where you want to insert the text, and then press Ctrl+U to paste the contents of the clipboard.

    Undo and Redo in Nano

    If you make a mistake when editing a file in nano, then you can undo and redo changes you make to the text. This can be useful if you want to revert a mistake or restore deleted text. To undo the last change, press Alt+U. You can undo multiple changes by pressing Alt+U repeatedly.

    If you undo too many times, you can revert the Undo operation by pressing Alt+E. You can redo multiple changes by pressing Alt+E repeatedly.

    Note that undo and redo only work for the current session. If you save and exit the file, the undo and redo history will be cleared.

    How to enable syntax highlighting in nano

    Syntax highlighting is a feature that makes the code more readable by coloring different parts of the code according to their function. Nano supports syntax highlighting for many programming languages, such as C, Python, Java, PHP, etc.

    To enable syntax highlighting in nano, you need to use the -Y option when opening the file, and then specifying the name of the language. For example:

    nano -Y php wp-config.php
    editing file with syntax highlighting in nano

    This will open the file wp-config.php with syntax highlighting for PHP.

    Other nano commands and shortcuts

    Nano has many commands and shortcuts that you can use to perform various actions. You can see a list of the most common commands and shortcuts at the bottom of the screen. The ^ symbol means Ctrl. For example, ^G means Ctrl+G.

    Some of the most useful commands and shortcuts are:

    • Ctrl+G: Display the help menu
    • Ctrl+C: Display the current line and column number
    • Ctrl+R: Read a file and insert it into the current file
    • Ctrl+Y: Go to the previous page
    • Ctrl+V: Go to the next page
    • Ctrl+A: Go to the beginning of the current line
    • Ctrl+E: Go to the end of the current line
    • Ctrl+Z: Suspend nano and return to the shell

    You can also use the arrow keys, the Page Up and Page Down keys, and the Home and End keys to move the cursor around the file.

    Conclusion

    In this article, you’ve learned how to use the nano text editor, a simple and easy-to-use command line text editor for Unix and Linux operating systems. You’ve learned how to open and create files, edit text, search and replace text, cut and paste text, save and exit files, and more. You’ve also learned some of the basic keyboard shortcuts that make editing faster and easier.

    But did you know that you don’t need to be a Linux expert to manage your servers?

    Do you want to save time and avoid mistakes that could crash your website? Do you want the flexibility of a CLI along with the user-friendliness of a dashboard?

    If you answered ‘Yes’, then you need RunCloud!

    RunCloud is a cloud server management platform that lets you manage your servers, websites, and applications from a single dashboard. You can easily install, configure, and update your server software, monitor your server’s performance, and secure your server with SSL certificates and firewall rules.

    But the best part is – you don’t need to fiddle with the terminal and editors anymore. You can directly edit and change any server settings and configuration files directly from the RunCloud dashboard. You can also use the RunCloud file manager to upload, download, and edit your files with just a few clicks.

    RunCloud supports all major cloud providers, such as AWS, Google Cloud, DigitalOcean, Vultr, and more. You can also connect your own servers or VPS to RunCloud and enjoy the same features and benefits.

    Start using RunCloud today and see the difference for yourself.

  • How To Host Matomo Analytics On A RunCloud Server

    How To Host Matomo Analytics On A RunCloud Server

    • Do you want to use a privacy-friendly web analytics solution?
    • Do you want to learn how to host your own web analytics platform on a cloud server in minutes?

    If you answered ‘Yes!’ to either of these questions, then you’re in the right place.

    Matomo is a free and open source web analytics platform that gives you insights into your website’s visitors, behavior, and conversions. In this post, we will show you how to host Matomo analytics on a RunCloud server and enjoy the benefits of a fast, secure, and scalable web analytics solution.

    Sounds amazing, right?

    Well, it is. And the best part is – you can do all this in next to no time. All you need is a RunCloud account, a Matomo account, and a few minutes of your time.

    Let’s use those few minutes now to get you up and running!

    Step 1: Create An Empty Web Application On RunCloud

    The first step is to create an empty web application on RunCloud that will host your Matomo analytics app. Log in to your RunCloud dashboard and click on “Deploy a new web app”, switch to the “Empty Web App” tab, and then create an application with the default settings.

    After that, you can configure the web server settings, such as domain name, SSL certificate, PHP version, etc. Once you’ve created your web application, you will see the  dashboard with information about it, such as web root, database, etc.

    Step 2: Log In To Your RunCloud Server Via SSH

    The next step is to log in to your RunCloud server via SSH and download and extract the Matomo files. You can use any SSH client, such as PuTTY, Terminal, etc. 

    Once you log in to your server, you can use the following commands to download and extract the Matomo files:

    cd /path/to/your/web/root # to change the directory to your web root
    wget https://builds.matomo.org/matomo.zip # to download the Matomo zip file
    unzip matomo.zip # to unzip the Matomo zip file
    rm ./index.html 'How to install Matomo.html'matomo.zip # to delete the Matomo zip file
    mv ./matomo/* . # to move files 

    In the above screenshot, we can see that the required files were extracted in the web application folder.

    Step 3: Create A Database And A Database User On RunCloud

    The third step is to create a database and a database user on RunCloud for your Matomo analytics. You can do this by following these steps:

    1. Go to your RunCloud web application dashboard and click on the Database tab.
    2. On the ‘User’ tab, click on the “Create Database User “button and enter the database username and password, such as matomo_user and matomo_pass.
    3. On the ‘Database’ tab, click on the “Create Database” button and enter the database name, such as matomo and select the user that we just created to grant all privileges to the database user.
    4. Click on the “Create Database” button.

    Optionally, you might want to set Database collations if you are working with non-ASCII characters.

    After creating the database, save these credentials, as we will need them when installing Matomo Analytics.

    Step 4: Launch The Matomo Analytics Installation

    The final step is to visit your web application and follow the Matomo installation instructions. You can do this by following these steps:

    1. Go to your web browser and enter the URL of your web application, such as https://example.com. You can also find this URL in the RunCloud dashboard for the web application that we created in step 1.
    2. When you visit this URL for the first time, you will see the Matomo installation wizard that will guide you through the installation process.
    Installing matomo analytics on-prem
    1. Matomo needs some PHP functions that are disabled by default on RunCloud for enhanced security. To make sure installation goes smoothly, go to your RunCloud dashboard and enable the shell_exec PHP function. 
    2. To do this, just remove the shell_exec, from the given list of disabled functions (see screenshot below). Make sure to remove the trailing comma and then save the configuration file.
    1. Now go back to the installation wizard. On the system check screen you should only see green check marks:
    1. Click ‘Next’, which will take you to the database page. Here you will need to enter the credentials that you saved earlier. Leave the database server as default, and modify the table prefix to any prefix you want.
    2. On the next page, you will need to configure the first website that you want to track using Matomo. Just enter the website name, your website URL, and configure the other settings if you like.
    1. Next, you will need to configure your login credentials for the Matomo dashboard. We recommend using a password manager to create a strong and unique password. You will also need to accept both the terms and conditions and the privacy policy of Matomo.
    2. Finally, you will then see a confirmation page that will show you the tracking code that you need to add to your website to start tracking your visitors. Copy this code and hit ‘Next’.

    That’s it! You have successfully hosted Matomo analytics on a RunCloud server.

    You can now log in to your Matomo dashboard and see the analytics data of your website. You can also customize your Matomo settings, such as adding more websites, creating goals, segments, reports, etc.

    Matomo login screen

    Step 5: Configure A Cron Job On RunCloud (Optional)

    If you have a high traffic website, you may want to configure a cron job on RunCloud to run the Matomo archiving process periodically. This will improve the performance and accuracy of your Matomo reports.

    You can do this by following these steps:

    1. Go to your RunCloud server dashboard and click on the Cron Job tab.
    2. Click on the Create Cron Job button and enter the following information:
      • Job Label: matomo_reports (or any label you want)
      • User: runcloud (or the user that owns your web application)
      • Vendor Binary: Select the PHP version of your web application
      • Command: /path/to/matomo/console core:archive --url=http://example.com > /dev/null (replace example.com with your web application URL and /path/to/matomo with the root path of your application as shown in RunCloud dashboard in step 1)
      • Run In: Every hour (or any frequency you want)

    Click on the Create Cron Job button.

    cron job for matomo

    After creating the job, it should look something like the screenshot shown above.

    Once your cron job is up and running, you can turn off automatic archiving in Matomo. To do this, open your Matomo dashboard and navigate to Settings > System > General Settings > Archiving settings and select ‘No’. Don’t forget to hit ‘Save’ after you’re done.

    That’s it! You have successfully configured a cron job on RunCloud to run the Matomo archiving process every hour. You can check the log file to see the output of the cron job, and you can also modify or delete the cron job anytime from the RunCloud dashboard.

    Final Thoughts

    In this post, we have learned how to host Matomo analytics on a RunCloud server. Matomo is a powerful and flexible web analytics platform that gives you full control over your data and privacy. RunCloud makes it easy and fast to deploy, configure, and manage your web applications.

    By using RunCloud with Matomo, you can benefit from the following features:

    • Easy installation: You can install Matomo on your RunCloud server in just a few steps, without any technical hassle.
    • Automatic backups: You can set up backups on your RunCloud server to protect your Matomo data from any loss or damage.
    • Customizable settings: You can customize your application settings, such as adding more URLs, creating firewall rules, deploying SSL certificates, view access logs, etc.

    If you are looking for a managed web hosting solution that is easy to install, fast to deploy, and secure to use, then you should try RunCloud. You will be amazed by how much RunCloud simplifies the installation process and enhances the performance of your web applications.

    Sign up to RunCloud today and see the difference for yourself! 😊

  • The 10 Best PHP Frameworks (Complete Guide)

    The 10 Best PHP Frameworks (Complete Guide)

    Are you old enough to remember these early website designs of Amazon and Google from 1997?

    You don’t have to go anywhere near that far back in time, though, to notice that websites today have become increasingly complex, demanding far more functionality and accessibility.

    Today, professionally designed websites are able to deliver powerful, robust experiences, with much greater levels of security and accessibility, whilst looking cleaner and easier to navigate.

    One of the reasons for this increased functionality and power is PHP (which stands for PHP: Hypertext Preprocessor – yes, the first ‘P’ of ‘PHP’ really does stand for ‘PHP’!).

    Today, over three quarters of all web pages on the internet are powered by PHP, an open-source, server-side scripting language that is used to build dynamic web pages and web applications.

    PHP has been around since 1995, and since then it has had plenty of time to flourish, giving the PHP community a great opportunity to build many frameworks for the PHP ecosystem.

    In this article we’ve covered some of the best PHP frameworks available for you to use right now. But before we get started, let’s first answer the question – what exactly is a framework?

    What is a PHP Framework?

    A framework is a repository of pre-built components which provides a structured approach to development. The components also lend a hand in faster project completion, along with a more streamlined process and enhanced productivity.

    PHP frameworks offer a myriad of unique benefits that make developing applications easier for all developers – beginners and professionals alike.

    The ready-to-use elements and built-in features of frameworks in PHP contribute massively to cost savings.

    Developers can save the trouble of rewriting excess code and reduce development efforts by making use of the pre-built elements in PHP. Along with saving developmental costs, this also makes the process more time-efficient.

    The scalability and ease of maintenance that comes with PHP frameworks make it a compelling choice for many developers and organizations.

    Things To Keep In Mind When Choosing A PHP Framework

    There are a few pointers that you should keep in mind when picking a PHP Framework:

    • Popularity and community size: Most frameworks are community-driven; having a vibrant community to support and enhance a framework is a massive advantage for support and discussion.
    • Principle and Aims: You should properly research what the framework is meant to accomplish. Keep an open mind and look for a different solution if it doesn’t seem to fit your demands and objectives as a framework.
    • Sustainability: Will the framework continue to support your technology stack in the future, and is it regularly maintained? Sustainability is a significant factor to consider if you want long-term project support.
    • Support: If you have any queries or worries, who can you contact? This issue frequently relates to the requirements for community size and popularity. You should have access to online tools and documentation to guide you through any issues that might pop up.

    Testing the frameworks out before adding them to your tech stack is, nevertheless, the best way to decide. Try to narrow it down to two or three frameworks, and just play around with them instead of testing every single one.

    The 10 Best PHP Frameworks For Web Development

    It’s easy to convince yourself that PHP is the language you need to use for your next project. And there is no denying that PHP is a useful tool for any web development project – especially when you consider the vast number of quality websites that use it worldwide.

    However, this doesn’t really address which particular PHP framework will work best for your project. Here are 10 PHP frameworks that are great for development:

    Laravel

    If you’re even remotely familiar with PHP, it’s highly likely that you’ve already heard of Laravel. This framework sits at the top of all PHP framework lists, and is widely regarded as the first choice for web developers.

    Pricing: The Laravel framework is open-source software licensed under the MIT license.

    Key benefits:

    • Easy to learn and master
    • An active and thriving community
    • Wide availability of tutorials and documentation
    • Intuitive database manipulation
    • Insightful reporting enabled by Laravel Horizon and Telescope
    The Laravel php framework

    Laravel is popular because of its ease of use, combined with its accessibility. But its simplicity and easy usage doesn’t stop Laravel from being implemented in the most complex of projects.

    Along with many other capabilities, it has the platform’s own Blade templating engine, a local development environment, Homestead, a powerful RESTful routing system, and much more.

    CodeIgniter

    CodeIgniter, although our second recommendation, is no less powerful than Laravel. It even surpasses Laravel in some aspects. It’s a powerful and versatile PHP framework with support for an array of high-level features and rapid project development.

    Pricing: It is freely available under the MIT license.

    Key Benefits:

    • Built-in protection against CSRF and XSS attacks
    • Clear and detailed documentation
    • Extremely lightweight
    • Reduces the need for tedious configuration
    • Great performance
    CodeIgniter one of the most powerful and versatile PHP frameworks

    CodeIgniter is surprisingly lightweight, clocking in at just a single megabyte – and it’s fast too. It follows the Model-View-Controller (MVC) pattern. This means that it separates the application logic from the presentation and the data. MVC is a good thing because it makes the code more organized, modular, and reusable. It also makes it easier to test, debug, and maintain the application.

    We like CodeIgniter because its user-friendly library and helpful structure lets developers express their creativity – without being constrained by a tonne of tedious coding work.

    Symfony

    Symfony is an incredible framework, made by the renowned developers at SensioLabs. It has a massive community of over 300,000 developers from around the globe.

    Pricing: It is released under MIT license and you can use it for free.

    Key benefits:

    • Stability makes Symfony suitable for large enterprises
    • Thriving, robust ecosystem with an enormous community of devs
    • More than 50 stand-alone components available for your own applications
    • Excellent and up-to-date documentation
    • Feature-rich and dependable

    Symfony has emerged as a developer’s favorite framework thanks to its advanced features, coupled with the intuitive environment. The community is growing quickly despite the fact that Symfony’s large feature set presents a steeper learning curve. There are a lot of unofficial support groups available which will make development easier.

    Symfony makes repetitive tasks such as creating forms, routing authentication, configuring objects, and templating much easier.

    Laminas

    Laminas, formerly known as Zend Framework, is an object-oriented PHP framework that is open-source and is renowned for its scalability and excellent selection of reusable components.

    Pricing: The code is licensed under BSD 3-Clause, so you can use it for free.

    Key benefits:

    • Suitable for complex and large-scale projects
    • Easy integration with third-party PHP libraries
    • Intuitive session management features
    • Extensive documentation
    • Large and active community base

    Developers are able to optimize efficiency and cut down on superfluous overheads by choosing only the components that are actually needed, thanks to Laminas’ exceptionally large component library.

    It also places a high priority on security, and offers strong capabilities to guarantee the development of secure applications.

    Laminas Project is very adaptable and follows PHP best practices, which is crucial for developers who wish to incorporate features unique to their projects.

    Yii

    Yii framework (which stands for Yes, it is!) is straightforward and progressive. It’s a component-based PHP framework with outstanding performance in creating modern web applications. Although Yii is a web programming framework that can be used for any type of PHP project, it’s particularly suited for the rapid building of large-scale web applications.

    Pricing: The Yii Framework is published under BSD License and gives you the flexibility to use it freely for commercial purposes.

    Key benefits:

    • Simplified database management allows devs to model database data right into objects, and eliminates SQL queries
    • Particularly adept in working with AJAX
    • Strong caching support
    • Easy learning curve

    Yii is easy to install and has robust security features, making it ideal for highly secure projects such as forums, CMSs (content management systems), e-commerce sites, and portals. It is one of the oldest PHP frameworks to still be in active use. Naturally, community support is excellent and it still remains very popular among developers.

    CakePHP

    Released in April 2005, CakePHP is a reliable PHP framework for web development licensed under the MIT Licence. It uses ORM (Object Relational Mapping) techniques and is built on the MVC (Model View Controller) architecture. Being so widely used and implemented, CakePHP is incredibly reliable, secure, and fast.

    Pricing: The Cake Software Foundation has released this framework under the MIT license.

    Key Benefits:

    • CakePHP makes it easy to implement CRUD operations by providing a set of conventions and tools that simplify the interaction with the database.
    • Simple debugging and testing process of applications
    • Strong built-in security features
    • Plug-in support
    • Allows the creation of reusable code

    Don’t judge this framework by its age, as almost all modern features are available with CakePHP, including protection against SQL injection, validation against form tampering, protection against Cross-Site Request Forgery (CSRF), and prevention against Cross-Scripting Platform (XSS).

    It powers the websites of global brands such as Hyundai, BMW, and Express. That says a lot about CakePHP!

    Phalcon

    Phalcon, a play on the words “PHP” and “falcon”, is a full stack framework with the objective of demonstrating an unconventional approach to developing web apps because it is written as a C-extension. This means that it is implemented in C and directly integrated into PHP for enhanced performance. Most PHP frameworks are written in PHP itself, which requires more memory and CPU resources to run.

    Phalcon stands out for its low-level architecture, code compilation, memory management, security measures, and the absence of file reads, which leads to better speed.

    Pricing: It is freely available under BSD 3-Clause License.

    Key Benefits:

    • Advanced features such as a universal autoloader and powerful asset management
    • Robust caching
    • Low server-side resource requirements
    • Effortless integration with most other PHP libraries
    • Small and lightweight, and exceptionally performant

    One interesting feature about Phalcon is that, even though it is written in C, you don’t need to know C to use it. Its functionality is exposed as PHP classes and interfaces under the Phalcon namespace, ready to be used.

    With its unique coding style hinting at elements from C and C++, Phalcon is geared towards simplifying PHP development and enhancing the overall development experience.

    Fat-Free Framework (F3)

    Simple to use and designed with minimalism in mind, Fat-Free Framework (F3) is a PHP micro-framework that gets the job done. It is easy to learn and is beginner-friendly. It is also one of the most lightweight frameworks out there, clocking in at a tiny 90 KB.

    Pricing: Fat-Free Framework is free and released as open source software under the GNU Public License (GPL v3).

    Key benefits:

    • Lightweight footprint
    • Modular and scalable structure
    • Supports both SQL and NoSQL databases
    • Powerful ORM features enabled by ‘Axon’
    • Does not require complex configuration

    Since F3 was established in 2009, it has gained a vibrant and mature community, as well as more than 2,600 stars on GitHub.

    Because MVC is enabled but not required, F3 is adaptable – and compatible with classes from other sources. This framework focuses on developing PHP apps that are fast to load, and have a straightforward setup procedure that increases developer productivity, all while avoiding application complexity.

    Slim

    Slim is a barebones micro-PHP framework that follows the Agile methodology. It features a stripped-down codebase without the support for third-party dependencies. That works in Slim’s favor as the lack of dependencies makes the framework remarkably fast.

    Pricing: The Slim framework is freely available under the MIT license.

    Key benefits:

    • Features all important features such as URL routing, session, cookie encryption, and client-side HTTP caching
    • Great for rapid prototyping purposes
    • Active maintenance and responsive devs
    • Suited for the development of RESTful APIs and microservices

    Slim has a flat learning curve and is pretty easy to understand. In fact, you can have a simple app running in just a few minutes without any prior experience. Building compact apps and APIs is an excellent match for Slim, and the fact that it offers both first-party and third-party components makes it ideal if you demand more functionality from the framework.

    FuelPHP

    With more than 300 contributors, FuelPHP is a community-driven PHP framework that supports HMVC (Hierarchical Model View Controller). HMVC creates an additional layer between the Controller and the View – a design pattern that brings several benefits, such as improved organizability of the code, increased modularity, greater flexibility, and support for code reuse.

    Pricing: It is freely available under the MIT license.

    Key benefits:

    • FuelPHP ORM is both lightweight and powerful
    • HMVC support
    • Great modularity
    • Ability to choose the folder and file structure for your projects
    • Useful command-line utility tool

    FuelPHP takes security seriously, and implements features such as output encoding and CSRF defense, URI, XSS, input filtering, and escaping data entered by the user and sent to SQL queries. Moreover, you can use Oil, FuelPHP’s command-line tool, to run scripts, debug code, and create common components.

    Conclusion

    Although it is not absolutely necessary, using PHP in your development framework is worth considering given the language’s widespread use and features. We hope our recommendations help you with a decision to select a framework that ideally fits your needs.

    No matter what PHP framework you are using, deploying and managing your applications on the internet is always used to be a hassle. We have built RunCloud to solve this exact problem, now you can focus on developing your applications and leave the heavy-lifting of managing your servers to us.

    RunCloud supports all things PHP and provides a quick and easy way to perform complicated tasks such as deploying new applications, performing backups, running cron jobs, etc. with only a couple of clicks. Start using RunCloud and see for yourself!

  • How to Set Up a Linode (Akamai) Server with RunCloud

    How to Set Up a Linode (Akamai) Server with RunCloud

    Akamai, the global leader in content delivery network and cloud services, has recently acquired Linode, one of the oldest and most trusted cloud server providers in the market. Linode has been offering simple, affordable, and accessible cloud computing solutions to millions of customers since 2003.

    If you are looking for a reliable and cost-effective way to host your website, you can choose from a variety of plans offered by Akamai’s cloud computing services, formerly known as Linode. These plans include Nanode & Standard (Shared CPU), Dedicated CPU, High Memory, and GPU.

    The Nanode plan is the most budget-friendly option, including 1 GB Memory, 1 CPU Core, 25 GB Storage, and 1 TB Transfer for only $5/month. The Standard plan is the most versatile option, which will allow you to run a wide range of cloud applications, from personal projects to enterprise applications. This plan starts from $12 / month for 2 GB RAM, 1 CPU Core, 50 GB Storage, and 2 TB Transfer.

    Akamai Cloud pricing plans

    Akamai’s cloud computing services have 27 data centers across the world, and you can choose the server location that is closest to you or your customers for the best performance.

    In this post, we will discuss how to set up Akamai’s cloud computing services to host your websites (web applications) with RunCloud. Connecting your server to RunCloud is very easy – let’s take a look at the different methods available.

    Method 1. Automatic Server Provisioning (Recommended)

    When deploying or deleting a server on the cloud, there are many things that can go potentially go wrong. RunCloud integrates with Linode to automatically launch a new server, directly from the RunCloud dashboard. If you are a beginner, we strongly recommend using this method to launch your Linode servers. Let’s see how to do this.

    Connecting Akamai Cloud to RunCloud

    To integrate your Akamai cloud account with RunCloud, you need to generate an API key from your Akamai dashboard. To create this API token, click on your profile picture in the top right part of your Akamai dashboard, and select API Tokens.

    On the next screen, click on “Create a Personal Access Token” and provide a descriptive name for your token. After that, configure the expiry key for your token and grant the necessary permissions for RunCloud to create and deploy servers on your behalf. RunCloud needs read/write access to Account, Domains, Firewalls, and Linodes to spin a new server on your Akamai account.

    After you have configured the settings, scroll down to the bottom and save your changes. As soon as you click ‘Save’, a long string of text will be displayed on your screen – this is your token, and it will only be displayed once.

    You need to save this token in your RunCloud account. Open a new browser window and navigate to the Integration section in your RunCloud account.

    On that screen, look for ‘Linode’, and click “Add Integration“. This will take you to the Linode integration screen.

    On this screen, provide a descriptive name for your token, and paste the token displayed in your Akamai Cloud dashboard. Once you have added the token, click on ‘Test Integration’; if the test fails then it is possible that you didn’t grant all of the necessary permissions required by RunCloud.

    Otherwise, you can click on “Save Integration” to save this key in your RunCloud account. You can now start deploying new servers directly from your RunCloud account.

    Creating A Server from the RunCloud Dashboard

    Once you have added the API token to your RunCloud account, you can directly create and delete servers from the RunCloud dashboard by clicking “Connect a Server” in the ‘Servers’ section.

    On the next screen, select Linode from the list of Cloud providers and choose Deploy Server Automatically to provision a new server.

    Once you scroll down, you will be asked to select between native Nginx, OpenLiteSpeed, and Containerized servers. If you are just looking to deploy a WordPress website, you can pick any of them. If you have something specific in mind, read our comparison of Nginx vs OpenLiteSpeed servers and our in-depth explanation of Containerized Servers on RunCloud to make an informed decision.

    Under the ‘Keys’ section, select the key that we just created from the drop-down menu and hit ‘Continue’.

    On the next screen, select the version of the operating system that you want to use (usually the latest version is the best one), and pick your server type and location from the list shown on your screen. It is usually recommended to pick a location that is closest to the vast majority of your customers.

    Next, you need to select your server size. If you are just getting started, you can pick the smallest server and gradually increase it as your website grows. If you need more help, you can refer to our previous article on how to pick the right server size.

    Lastly, you need to select the default RunCloud firewall rules from the dropdown menu and provide a descriptive name for your server.

    When you deploy a server from your RunCloud dashboard, you will be billed separately for using Akamai’s cloud computing services – this is not included in your RunCloud subscription. Make sure to click the checkbox to acknowledge this and then click Add Server.

    Once you do this, RunCloud will create a new server in your Akamai account on your behalf and automatically install all the necessary software required to deploy websites. The whole process usually takes no more than 5-10 minutes.

    RunCloud Linode server

    Video Tutorial: Provision Linode Server

    Method 2. Set Up Akamai Cloud Server Manually

    RunCloud provides lots of cookie-cutter templates for launching a new server with just a few clicks. However, if you want more freedom to configure your server then you can choose the manual installation method.

    Creating Firewall Rules

    Before we deploy a server, it is a good idea to configure the firewall rules beforehand to avoid any hiccups down the line. In your Akamai cloud dashboard, go to the Firewalls tab and click ‘Create‘. Give it a descriptive name and then hit “Create Firewall” to deploy a new firewall with an empty ruleset.

    Next, we need to add rules to this firewall that will allow and deny traffic. RunCloud needs the following ports to be able to function properly:

    • 80/TCP: For HTTP traffic
    • 443/TCP: For HTTPS traffic
    • 443/UDP: For HTTP/3 traffic (optional)
    • 34210/TCP: For communicating with RunCloud agent
    • 22/TCP: For establishing an SSH connection (you can close this port once the server is connected to RunCloud).
    Firewall rules in Akamai cloud

    Create the appropriate inbound rules in your firewall, and then save it.

    Creating a Server in Akamai Cloud

    Next, you can go back to your Linode dashboard to provision a new server. When connecting a server to RunCloud, you must create a fresh server that meets the following requirements:

    • Uses Ubuntu Server (20.04/22.04 LTS) 64 bit operating system
    • Has more than 2 GB of disk storage
    • At least 1 core processor
    • At least 512 MB RAM
    • Public IPv4 Address (NAT VPS is not supported)

    In your Akamai dashboard, select the latest Ubuntu LTS version under the operating system section, and specify the region for your server. Next, pick your server type from the given list depending upon your requirements.

    In the label section, you can either provide a descriptive name for your server or leave it as it is. Next, you need to provide the root password for your server. This is the password that you will use when connecting via SSH, so make sure you pick a strong and memorable password. Optionally, you can also configure the SSH keys for additional security.

    Finally, select the firewall that we created in the previous step from the drop-down menu and hit “Create Linode“. This will provision a new server in your account.

    Connecting Server to RunCloud

    Once your server is up and running, you need to manually connect it to your RunCloud account. To do this, go to the Connect Server page and select Linode > Connect Via IP address.

    Next, select the server stack and installation type for your server. Provide a descriptive name for your server and then enter the public IP address displayed in your Akamai Cloud dashboard.

    On the next screen, you will be presented with two options. If you have configured the root password for your server then you can enter it here and then hit ‘Start The Installation’. RunCloud will automatically log in to your server on your behalf and install the necessary software.

    Alternatively, if you are using SSH keys to log in to your server, then you can manually run the installation script. To do this, log in to your server with super user privileges (root) and run the provided command. Installation will take 5-10 minutes to complete, and once the server is connected you can close the terminal.

    Video Tutorial: Manual Installation

    Final Thoughts

    With Akamai’s cloud computing services, you can host your website on a high-performance, secure, and reliable infrastructure that has been trusted by millions of customers since 2003. You can choose from a range of plans that suit your needs and budget, starting from as little as $5 / month.

    RunCloud makes it easy for you to connect your servers to Akamai’s cloud computing services. You can use any of the three methods that we have discussed in this post: server provisioning using Linode API key, direct server installation via IP address and root password, or manual server installation via IP address.

    Once you have set up your server, you can proceed to:

  • Uptime Monitoring Tools: Why You Need Them, and What to Look for

    Uptime Monitoring Tools: Why You Need Them, and What to Look for

    Whether you’ve previously heard of uptime monitoring or not, it’s something any website owner needs to explore.

    Assuming you’re a website owner, you’ll almost certainly have found yourself in a situation where you’ve had to rush to update your site and address a bug that needed to be fixed ASAP.

    No matter how much testing you carry out during development, you can’t always foresee every potential problem, and discovering an ominous alert that informs you your website is offline is a sure way to get the heart pumping and the panic rising!

    And that’s exactly why uptime monitoring is something to consider very seriously.

    Unexpected situations can be easily avoided using automatic website uptime monitoring – a practice that helps to ensure a smooth user experience by routinely checking a website’s performance.

    We have previously published several popular articles explaining how to:

    In this post, we will discuss the necessity of Uptime Monitoring and also take a look at some popular tools that will help measure your website’s uptime.

    Uptime Monitoring: What Is it?

    Uptime monitoring is the process of checking your website for downtime, and taking remedial or preventative action if necessary. It is done using software that runs in the background and verifies that your website is operating correctly.

    Usually, two kinds of uptime monitoring tools exist – active and passive:

    • Passive monitoring uses a third-party tool to determine whether your website is accessible from external networks such as Google or Yahoo for detecting downtime.
    • Active monitors ping your server every 30 seconds continuously in search of any indications of a possible outage.

    Any downtime can potentially cost you valuable customers, and of course, income. It can seriously impact your brand’s reputation too, which is why it’s critical to keep a close eye on the status of your website to allow you to take speedy action if necessary.

    How is Uptime Measured?

    The period of time during which a system is operational and free of any major bugs or glitches is called uptime. Any system that functions efficiently and doesn’t require maintenance or administrative support will have a lengthy uptime.

    Uptime is expressed as a percentage, often advertised by hosting providers as something like 97.79% uptime. In essence, a 100% uptime indicates that your website was operational 100% of the time, or 24 hours a day, 365 days a year.However, 100% uptime exists only in fantasies; even the biggest of tech companies, such as Cloudflare only ever guarantees 99.999999999% uptime. Realistically, anything in the high 90s range is good enough for most small businesses. 

    How Does Uptime Monitoring Work?

    When we talk about uptime monitoring, we’re usually talking about active monitoring which works by sending automated HTTP queries to a certain URL on a predetermined frequency – and waiting for the desired result.

    Usually, HTTP GET requests are used for this, although it is possible to use other types of HTTP requests for monitoring other features and APIs, depending on the needs of the user. The predefined frequency of these checks can vary from every second for mission critical business services to more than a couple of hours for side projects.

    Most tools work by checking the response for a 200 OK HTTP response code. But depending upon your use case, you can configure a test that checks whether a certain page is inaccessible to users, and if so, sends you an error message. Furthermore, it is also possible to configure some uptime monitoring tools to look for a particular keyword or term within the response received.

    Why is Uptime Monitoring Important?

    According to a study by Google, 53% of users abandon a website that takes more than three seconds to load. A website that is accessible at all times translates to increased customer satisfaction and a more optimized user experience.

    If a large chunk of your revenue comes from your website, then you clearly need all your website services to always run without fail. For ecommerce sites, downtime means revenue loss. If the site goes down during peak hours, sales will take a massive hit, not to mention the damage to reputation and loss of customer trust.

    If you use an uptime monitoring service, you will be instantly notified when your website is unavailable. These tools often provide analytics, allowing you to identify trends in your availability. For example, it is possible that many people visit your website from a specific region on a public holiday, and this causes your server to crash.

    Benefits of Uptime Monitoring

    Improving your website’s uptime has many benefits, let’s see a few cases in which implementing uptime monitoring on your website can really help you.

    Improved Availability and Search Engine Ranking

    Even if the downtime doesn’t seem like a big deal, it affects your site rankings with the majority of search engines. Google’s crawlers constantly scan your website to assess its availability, performance, and content. Even the all-powerful Google is aware that occasionally there will be outages, but prolonged or frequent disruption will definitely hurt your SEO ranking.

    Website uptime monitoring helps you stay informed about any disruptions to your website. This includes even the minor ones that you might not be aware of otherwise, but that which search engines picked up on. Early detection of outages lets you take swift action to safeguard your page rankings.

    Detect Intrusions

    You never know when your site might become the target of hackers. Attackers use a variety of techniques including DNS spoofing and DDoS (Distributed Denial of Service). At some point, they might take down your website, divert visitors from it (typically to a malicious website), or take advantage of the interaction between you and your users to insert or extract private data.

    Many modern uptime monitoring tools check for changes to the DNS records periodically so that you instantly find out if something shady is going on. Some also monitor certificates, ensuring that you will be notified if a hacker tries to tamper with your SSL certificates.

    Builds Trust with Visitors

    There is not a single person on Earth who enjoys a website that performs slowly, is unavailable, or just isn’t responsive. Should your website experience any downtime, only some of your most loyal clients will wait for that downtime to be resolved. But in many cases visitors will just flock towards your competition. You won’t see that client again if your rivals provide a better, more dependable experience.

    A recent survey found that 9% of users who experience a temporarily downed website won’t visit it again. During quiet periods that might not sound like much, but at peak times, or during special events such as Black Friday that 9% could represent a huge proportion of your income.

    Detect SLA Breaches

    If you are working with a reputable cloud provider, the chances are that, either knowingly or unknowingly, you have signed a service level agreement. These agreements provide assurance that a particular service will be available without disruption or downtime.

    Let’s assume a scenario in which your website goes down in the middle of the night for a couple of hours due to an outage at your cloud provider’s end. Fortunately, all this happened when your clients didn’t need your website so you never even found out about the outage.

    If you knew about the outage, you would have found out that your cloud provider is unreliable, and take the necessary steps to avoid this in the future. Moreover, many reputable cloud providers offer money back when they suffer extended outages.

    For instance, AWS will not charge you for any Single EC2 Instance that is unavailable for more than six minutes within any one hour. Even if you don’t want to shift cloud providers, getting a generous discount on your bill is always desirable – uptime monitoring makes it easy for you to do that.

    What to Look For in an Uptime Monitoring Tool

    Most website uptime monitors in the market will verify that services and websites are operational by testing their status and monitoring their uptime. However, some tools go beyond simple uptime tracking and provide more insights and useful stats.

    When considering which uptime monitoring tool to opt for, these are the essential features that are a must:

    1. Monitoring Frequency: A typical website uptime tracker ideally checks the status of the site every couple of seconds – more frequent checks mean quicker detection of issues.
    2. Multi-Location Monitoring: If the tool you choose is equipped with global monitoring locations, you’ll be able to simulate user experiences from various regions. This helps identify regional performance issues related to servers.
    3. Alerting Capabilities: Always check for alerting options such as email, SMS, or integrations with incident management tools such as Slack and PagerDuty. Customizable alert thresholds and escalation policies are a bonus.
    4. Protocol Support: Make sure that the monitor you choose supports the relevant protocols for your applications. For example, if you are serving your website over both IPv4 and IPv6, you would want a service that can handle both.
    5. Content Verification: A good uptime tracker should be able to check specific content such as login forms or key elements of your web pages. This feature is vital for ecommerce stores and web applications.

    Top Website Monitoring Tools in 2024

    You can keep an eye out for any downtime on your website with a variety of monitoring tools available nowadays. There are options for every scenario – from traffic volume tracking to status checks on your website.

    Here are the top 4 uptime monitoring tools we would recommend.

    Site24x7

    Site24x7 lets you check your site’s availability at intervals as short as 60 seconds using monitoring data from over 110 locations worldwide. Additionally, you can keep an eye on your online apps and APIs. Performance trends over time can also be easily identified by analyzing historical data from this tool.

    Key Benefits:

    • Synthetic Monitoring and Real User Monitoring (Web)
    • 120+ Global Monitoring Locations
    • Public and Private Cloud Monitoring with log management

    Site24x7 also allows users to check and configure HTTP headers of your requests. You can even perform advanced checks to see whether a word or a phrase is present on a page by searching the response body using regular expression patterns.

    Using Site24x7’s browser plugin, you can keep track of important business transactions and verify them by mimicking traffic from several places. You can either manually specify which button to click on each page or import test scripts from Selenium IDE (a common web automation tool) to run on a real browser, such as Firefox or Chrome, on a regular basis.

    Pingdom

    Pingdom is a popular tool for tracking the performance of websites. In addition to uptime monitoring, it provides useful features such as real user monitoring, page speed monitoring, artificial interaction testing, immediate warning, and root cause analysis.

    Key benefits:

    • Page speed analysis
    • Transaction monitoring
    • Detailed comparison of usage metrics

    As for alerts, Pingdom provides real-time warnings via email and SMS for uptime monitoring, 24/7. Additionally, they have more than 70 locations from which your website’s performance is examined, allowing you to see how your website is doing across the globe.

    UptimeRobot

    UptimeRobot combines website, SSL, Ping, Port, Cron job, and Keyword Monitoring all into one solution. Some advanced capabilities include the ability to construct custom HTTP queries with configurable headers, semi-customizable status pages, response times monitors, email-delivered incident updates to subscribers, and maintenance windows.

    Key benefits:

    • Domain and SSL monitoring
    • Cron job monitoring (sometimes called heartbeat monitoring) to monitor tasks, such as wp-cron, that must be performed regularly on a schedule.
    • Custom HTTP requests
    uptime monitoring

    With UptimeRobot, you can watch your website from several places up to once every 60 seconds for premium plans, and once every five minutes for free. You can get alerts via SMS, RSS, Twitter, email, and push notifications for iPad and iPhone when a website goes offline.

    Uptrends

    Uptrends provides a range of products such as real user monitoring and synthetic monitoring. With their synthetic monitoring, you can keep an eye on your HTTP(s) endpoints, DNS, security certificates, or any other online services such as SOAP or REST API endpoints using servers from 233 different geographical locations worldwide.

    Key benefits:

    • Smart alerting and automation features
    • Infrastructure Monitoring
    • Location-based performance metrics

    Uptrends displays all data using interactive charts that allow you to filter by date and time, zoom in on particular features, and examine your stats more closely in order to look for trends in your performance over time.

    Furthermore, if there are any speed-related problems with your website, identifying and pinpointing the source becomes easy thanks to their website performance monitoring services.

    Wrapping Up

    It is evident that ignoring uptime monitoring can have unwanted repercussions for revenue, brand reputation, and user experience. Effective uptime monitoring helps businesses guarantee the dependability and accessibility of their services, which in turn improves customer happiness and boosts revenue.

    If you’re looking for a simple and powerful way to manage your PHP web applications and websites on any cloud server provider, you should try RunCloud.

    RunCloud is a modern web server panel that automates server configuration and security updates, provides backup and restore features, supports multiple PHP versions and frameworks, offers one-click SSL and Git deployment, and much more.

    With RunCloud, you don’t need to be a Linux expert to build a website. You can use our graphical interface and build a business on the cloud affordably.Join thousands of web developers who use RunCloud to manage their cloud servers and web applications. Sign up for RunCloud today!

  • PHP Security – Best Practices To Secure Your Web App in 2025

    PHP Security – Best Practices To Secure Your Web App in 2025

    According to a recent report by SiteLock, on average, websites are attacked 94 times a day, and are visited by bots 372 times a day.

    While many of these bots are nothing to worry about, a percentage of them will be malicious, hunting out vulnerabilities, which is why it’s vital to remain vigilant where your website’s security is concerned, and in particular, we’re focusing today on PHP security.

    The role of PHP, a widely embraced server-side scripting language, continues to become even more pronounced in shaping the robustness and reliability of web applications.

    It’s worth noting that PHP isn’t just another player in this arena – it’s a formidable leader, accounting for a staggering 76.8% of all websites. Since PHP plays a critical role in web development, ensuring the safety and integrity of your web applications has never been more crucial.

    According to the PHP introduction manual, PHP is designed specifically to be a more secure language for writing CGI programs than Perl or C, and with the correct selection of compile-time and runtime configuration options, and proper coding practices, it can give you exactly the combination of freedom and security you need.

    In this article, you’ll discover the essential strategies and tactics to better protect your PHP web applications.

    Let’s get started!

    PHP Version Management

    Always Use the Latest Version of PHP

    Using a secure PHP version is vital in safeguarding your web application. The latest PHP releases offer not only a technological leap, but also security upgrades to protect against evolving security challenges. As a result, older versions of PHP are outdated – check the PHP docs to see if your PHP version has reached end of life.

    You should occasionally check the PHP Supported Versions page to ensure that your PHP installation remains in sync with the latest offerings. By doing so, you’ll be taking a proactive stance against security breaches, and enhancing the overall resilience of your web application.

    Use RunCloud Docker to Isolate Your Web Applications

    If, for any valid reason, upgrading to the latest PHP version is not feasible, an alternative approach to bolster your web application’s security is to use RunCloud Docker. By isolating your older PHP application within a separate container, you effectively create an additional layer of security for your entire system.

    This strategy ensures that your older application runs independently from the rest of your web applications. Even if the older PHP version may have certain vulnerabilities, confining it within a distinct container minimizes the risk of those vulnerabilities spreading to other applications in your environment. It essentially creates a protective barrier, allowing you to run legacy software without compromising the security of your newer, more up-to-date applications.

    Refer to our in-depth post on containerization to learn more about how you can leverage Docker to manage your servers.

    PHP Configuration for Security

    Turn Off PHP Execution

    One of the quickest ways to enhance the security of your PHP web application is by disabling PHP execution in directories where it serves no functional purpose. This proactive measure prevents unauthorized access and uncontrolled code execution within your web application.

    By restricting PHP execution in non-essential directories, you reduce the attack surface for potential threats. Hackers often seek out vulnerabilities that allow them to execute malicious PHP scripts on your server. By turning off PHP execution where unnecessary, you not only deny them the opportunity, but also ensure that your application functions securely.

    Properly Configure the PHP.ini File and Other Requisites

    When you are running a PHP application, you should properly configure your php.ini file. In this file, you have the power to fine-tune various PHP settings to align with your application’s security requirements.

    For instance, you can disable features that are not needed, reducing the potential attack vectors. Additionally, setting appropriate values for variables such as max_execution_time and memory_limit ensures that your application operates within secure constraints.

    RunCloud simplifies this process by allowing you to manage these settings directly from its user-friendly dashboard, making it convenient to maintain the security and performance of your PHP web application.

    Disabling PHP functions for PHP security

    Leveraging PHP Libraries

    When it comes to protecting your web application, one effective strategy is to use established PHP libraries. These libraries serve as valuable resources for implementing common security functions such as authentication, authorization, and encryption. They have undergone rigorous testing and have proven their reliability over time.

    By using these well-vetted libraries, you significantly reduce the likelihood of implementation errors in your application’s security measures. This approach not only streamlines the development process, but also enhances the overall security of your web application. It allows you to benefit from the collective knowledge and experience of the PHP community, providing robust solutions to common security challenges.

    Dependency and Component Security

    While it is recommended to use third party components, sometimes they can have security vulnerabilities that are addressed in newer versions. To ensure the security of your web application, it’s necessary to track the security of your code dependencies and third-party components.

    Using outdated libraries and third-party components can leave your application vulnerable to exploits and security breaches. Cyber threats continually evolve, and older dependencies may not receive updates or patches to address newly discovered vulnerabilities.

    By keeping your code dependencies up to date, you reduce the likelihood of attackers exploiting vulnerabilities in outdated components. Regular updates not only bolster your application’s security, but also contribute to its stability and performance, providing a safer and more reliable experience for your users.

    Do Not Store Passwords

    We cannot stress this point enough – when it comes to the security of user data in your web application, a fundamental principle is to store passwords securely.

    Do not store passwords in plain text – ever!

    It is essential to use strong, one-way hashing algorithms such as bcrypt.

    Hashing is a process that transforms a user’s password into a unique string of characters, making it extremely difficult for anyone, including system administrators, to reverse the process and obtain the original password. This is crucial because it adds a layer of protection to user credentials, preventing unauthorized access even if your database is compromised.

    On the other hand, storing passwords in plain text, or using reversible encryption techniques, poses a significant security risk. In these cases, if an attacker gains access to your database or security measures are breached, they can easily obtain and misuse user passwords, potentially causing significant harm to your users and your application’s reputation.

    We recommend reading this article by Okta to understand bcrypt in more detail, and learn how to implement it securely.

    Enhancing Application Security

    Don’t Rely on Cookies for Security

    While cookies play an integral role in session management and user experience on web applications, it’s essential to understand that they should not be the sole means of securing your application. Cookies, by themselves, are not foolproof safeguards against security threats. Instead, they should be viewed as just one layer of your security strategy.

    To make a robust application, it’s crucial to implement additional security measures. This includes, but is not limited to, robust input validation and proper authentication mechanisms. These measures not only complement cookie-based session management, but also provide an extra layer of protection against various vulnerabilities and threats.

    Validate User Input

    When developing an application, you should never trust user input implicitly. User input can be a potential method for attacks such as SQL injection and cross-site scripting (XSS). To safeguard against these common vulnerabilities, you should always validate and sanitize user input.

    By validating user input, you ensure that the data entered by users sticks to predefined criteria, and you can reject or sanitize any input that doesn’t meet these criteria. This is a fairly complex topic and if you don’t understand it fully then it can lead to security vulnerabilities. It’s advisable to use input validation libraries and functions that have been designed for this purpose.

    Regular Security Checks

    Safeguarding your web application is not a one-time effort but an ongoing commitment. Regular security audits are an essential part of maintaining a robust security application. Automated security scanners can be valuable in identifying potential vulnerabilities within your application.

    However, for larger websites, it is advisable to take an extra step. It’s recommended to hire a team of white hat hackers who can perform thorough security testing. These ethical hackers simulate real-world attacks to find vulnerabilities and, if they succeed, they provide guidance on how to remedy these issues.

    Final Thoughts

    By following the best practices outlined in this guide, you are taking a significant step toward bolstering the security of your PHP web application. However, it’s crucial to recognize that security is not a one-time task – it’s a continuous commitment that requires vigilance.

    If you’re unsure about where to start or want to simplify the process of securing your web applications, consider using RunCloud.

    When you deploy & manage your servers using RunCloud – they’re equipped with sensible and secure default settings, but you retain complete access and control of your infrastructure.

    RunCloud empowers you to implement these best practices effortlessly, ensuring that your PHP web application operates within a secure environment. So, why wait? Take the proactive step towards enhanced security – sign up for RunCloud today!

  • How to Create and Manage Cron Jobs on Linux

    How to Create and Manage Cron Jobs on Linux

    One of the most valuable benefits of having computers take charge of many aspects of our lives is the way they can complete tasks over and over again, following a defined schedule without complaint. How do they do this? The answer is something called “cron jobs”.

    In this post, you’ll learn exactly what a cron job is, why people use them, and how you can use cron jobs yourself for automating mundane tasks on your server.

    But even if you’re not a Linux expert then don’t worry, we will also share a novel method for novice Linux users to manage their system much more effectively using cron jobs.

    Let’s get started!

    What is a Cron Job?

    A cron job is a command or a script that is executed by the cron daemon, a background service that runs on Linux systems and which checks for scheduled tasks. A cron job consists of two parts: a schedule and a command.

    • The schedule defines when and how often the command should run.
    • The command defines what should be executed.

    Let’s take a look at each of them individually.

    Understanding Cron Schedules

    The schedule is specified using a special syntax that consists of five fields:

    1. minute
    2. hour
    3. day of month
    4. month
    5. day of week.

    Each field can have a single value, a range of values, a list of values, or a special character. The fields are separated by spaces or tabs.

    Here is an example of a schedule:

    30 10 * * 1-5

    The above schedule means that the specified command should run at 10:30 AM on every weekday (Monday to Friday). The asterisk (*) means any value, and the dash (-) means a range of values. You can also use a comma (,) to separate multiple values, a slash (/) to specify increments, and predefined keywords, such as @reboot, @daily, @weekly.

    You can use these predefined keywords to make your scripts more readable. For example, if you want to run something once a week then instead of writing 0 0 * * 0, you can simply write @weekly.

    To learn more about creating cron schedules, we recommend you take a look at these useful articles:

    Understanding Cron Task

    The second part of the cron syntax defines a task that needs to be completed. It can be either any valid Linux command, or a path to a script that can be executed. The command can have arguments, redirections, pipes, etc. The output of the command is usually sent to the user’s email, unless it is redirected to a file or another command.

    Here is an example of a command:

    /usr/bin/backup.sh

    This command runs a script that performs a backup operation. The script must have the executable permission, and the correct shebang line.

    Why Use Cron Jobs?

    Cron jobs are extremely valuable for automating repetitive or periodic tasks, such as backups, updates, notifications, etc. You can use these schedules for a variety of tasks such as:

    • Importing data from another system on a recurring basis
    • Making changes to properties in your CRM based on time and date (such as annually, monthly, or daily)
    • Running system management commands, such as clearing the cache, updating packages, checking disk space, etc.
    • Running scripts or programs that perform specific tasks, such as generating reports, sending emails, scraping websites, etc.
    • Scheduling backups of your files, databases, or websites
    • Many popular web platforms such as Magento and WordPress rely on cron jobs to perform various tasks related to their functionality and performance. Some of these tasks are: indexing databases, sending newsletters, processing orders, etc.

    Suggested read: Understanding WordPress Cron Jobs

    How to Create a Cron Job

    To create a cron job on Linux, you need to edit the crontab file. This is a text file that stores the cron jobs for a particular user account on the computer. You can use the crontab -e command to edit the crontab file using your default editor. If you are running the command for the first time, you may be asked to choose an editor, such as nano, vim, emacs, etc.

    Suggested read: How to create WordPress cron jobs with wp-cli tool

    Select the number corresponding to your desired editor to use that one, or just press ‘Enter’ to use the default editor.

    When working on the crontab file, you should keep following things in mind:

    1. Lines starting with the hash (#) sign are comments, and are completely ignored by the computer
    2. Blank lines are also ignored
    3. All other lines represents an individual cron job

    As noted previously, cron jobs follow the schedule command format. If we want to use the schedule and command described above, we will add the following line to the crontab file.

    Note that at the end of the command, we have added a helpful comment that will make it easy to identify this cron task if we ever wish to make changes to it in the future.

    30 10 * * 1-5 /usr/bin/backup.sh # Run backup.sh at 10:30 AM on weekdays

    You can add, modify, or delete lines in the crontab file to create or update your cron jobs. After you save and exit the editor, the cron daemon will reload the crontab file and apply the changes. You can also use the crontab -l command to list the current crontab file, or the crontab -r command to remove the crontab file.

    For more details on the cron schedule syntax, you can check the crontab man page.

    How to Manage a Cron Job

    Cron jobs are usually set and forget – there isn’t much that you usually need to do once it has been enabled. However, if you suspect that your jobs are not running properly, then you can use the following tips to manage and troubleshoot your cron jobs:

    • To disable a cron job temporarily, you can comment out the line in the crontab file by adding a hash sign # at the beginning of the line.
    • To enable a cron job, you can uncomment the line in the crontab file by removing the hash sign # at the beginning of the line.
    • To view the status of the cron daemon, you can use the systemctl command or the service command, depending on your Linux distribution. For example, systemctl status cron or service cron status.
    cron status linux
    • To restart the cron daemon, you can use the systemctl command or the service command, depending on your Linux distribution. For example, systemctl restart cron or service cron restart.

    Creating Cron Jobs the Easy Way with RunCloud

    Managing Linux can be hard and difficult, especially for beginners or non-technical users. Linux commands and scripts can be complex and error-prone, and require a lot of knowledge and experience to use them effectively. This is why we built RunCloud!

    RunCloud is a cloud server management panel that simplifies and automates the process of creating and managing cron jobs on Linux servers.

    We provide a feature-rich GUI that helps you create and edit cron jobs right from the dashboard, without the need to use the terminal or edit the crontab file manually.

    To create a new job on your server, simply open your RunCloud dashboard and click on the “Cronjob” tab in the left menu.

    On the next screen, just click on “Add New Job” to get started.

    When creating a new job, simply fill in the basic information, such as the name of the job and the command that you want to execute – everything else will be pre-filled for you.

    cron jobs runcloud

    The above screenshot shows an example of a cron job created using RunCloud. This cron job will run the WordPress cron events for the app-pat2 web application every minute, using the runcloud user and the wp-cli tool.

    Let’s take a look at each of the settings that you can modify.

    • Job Label: This is a name or description for the cron job, which can help you identify and organize your cron jobs.
    • User: This is the system user that will execute the cron job. You can choose any user that has the permission to run the command or script.
    • Vendor Binary: This is the binary or interpreter that will run the command or script. You can choose from a list of vendor binaries provided by RunCloud, such as /bin/bash, /usr/bin/php, etc. or you can write your own binary inside the command field.
    • Command: This field contains the actual command or script that will be executed by the cron job. You can write any valid Linux command or a path to a script that can be executed. In this case, the command is using the wp-cli tool to run the WordPress cron events for the app-pat2 web application.
    • Run In: This is the schedule or frequency of the cron job. You can choose from a list of predefined settings, such as every minute, every hour, every day, etc., or you can use the custom settings to specify your own schedule using the cron syntax.

    Why Use RunCloud?

    RunCloud’s cron job feature is more powerful than the traditional way of creating and managing cron jobs on Linux systems, because it offers the following advantages:

    • It has a user-friendly and intuitive GUI that makes it easy to create and edit cron jobs, without the need to use the terminal or edit the crontab file manually.
    • It provides predefined settings and custom settings for scheduling your cron jobs, which can save you time and avoid errors in writing the cron syntax.
    • It provides a list of vendor binaries that you can use to run your commands or scripts, which can simplify your commands and ensure compatibility with your server environment.
    • It allows you to choose any system user that has the permission to run the command or script, which can enhance the security and flexibility of your cron jobs.
    • It allows you to quickly Activate or Disable individual cron jobs without ever needing to log in to your server.
    • It enables you to run cron jobs on demand right from your RunCloud dashboard.

    Conclusion

    In this article, we have shown you how to create and manage cron jobs on Linux using the crontab command and the cron daemon. Cron jobs are a powerful and convenient way to automate tasks on Linux systems. We hope you have found this article useful and informative. If you have any questions or feedback, please feel free to leave a comment below.

    If you are looking for a simple and powerful way to create and manage cron jobs on Linux servers, you should try RunCloud.

    RunCloud is a cloud server management panel that simplifies and automates the process of managing Linux servers.

    RunCloud is more than just a cron job manager. It is a complete solution for managing your web applications, databases, backups, security, and performance on Linux servers. You can use RunCloud to deploy, configure, and optimize your web applications using any PHP version and web server stack.

    RunCloud is compatible with any cloud provider, such as AWS, Google Cloud, DigitalOcean, Linode, Vultr, etc. If you want to experience the power and simplicity of RunCloud, you can sign up for a RunCloud account today!