Category Archives: System Engineering

How To Configure ModSecurity To Protect Website From Cyber Attacks?

ModSecurity is a robust open-source web application firewall (WAF) designed to detect and prevent attacks on websites by monitoring and filtering HTTP traffic.

It acts as a layer of defense, helping to guard against security threats such as SQL injections, cross-site scripting (XSS), and other common vulnerabilities in web applications. By blocking or logging malicious requests, ModSecurity enhances your website’s security and helps protect your server from being compromised.

In cPanel, ModSecurity can be easily configured to meet the security needs of your site. Here’s a step-by-step guide on how to configure it:

Step-1 Log in to cPanel

Start by accessing your cPanel account.

Step-2 Locate ModSecurity

In the Security section, find and click on the ModSecurity icon. This will bring up the ModSecurity configuration panel.

Step-3 Enable Or Disable ModSecurity

ModSecurity can be enabled or disabled for individual domains on your account. Choose the domain(s) you want to configure. By default, enabling ModSecurity offers a baseline level of protection.

Step-4 Configure Rules

Many cPanel providers allow you to configure specific security rules for ModSecurity, either by uploading custom rule sets or by using pre-configured rules. If you have the option to edit or add rules, you can tailor ModSecurity’s responses to match your security needs, increasing or decreasing the sensitivity as needed.

Step-5 Test Your Configuration

Once ModSecurity is configured, it’s essential to test your website for functionality. Sometimes, ModSecurity rules can be too strict, inadvertently blocking legitimate traffic. Check your site thoroughly to ensure that all pages load correctly and that no critical functions are affected.

You may also ModSecurity logs, they can provide insights into blocked requests and potential threats. Regularly reviewing these logs will help you understand the types of attacks your site is facing, allowing you to adjust rules or security levels if necessary.

    By configuring ModSecurity through cPanel, you’re adding an essential layer of security to your website, protecting it from many of the most common web-based attacks.

    How To Adjust PHP Memory Limit For Better Website Performance?

    People may need to set or increase the amount of memory PHP scripts can consume in various situations. Running complex applications like WordPress, Magento, Joomla, or Drupal often requires higher memory limits because these platforms handle multiple functions, plugins, and themes. This increased demand can quickly exceed default limits, leading to errors or incomplete processes.

    Common Errors Due To Low PHP Memory

    When PHP memory is low, various errors can arise, affecting website functionality. A common error is the “Allowed memory size exhausted” message, indicating that a script needs more memory than the allocated limit. This can cause pages to load partially or fail altogether, resulting in broken forms, incomplete image uploads, or failed processing of large files.

    Low memory also often leads to “500 Internal Server Error” messages, as insufficient memory prevents scripts from running properly. Complex plugins or themes, especially on WordPress, may stop working or create blank pages due to memory constraints. Increasing the memory limit can resolve these issues, ensuring smoother site performance and fewer interruptions.

    PHP memory error often occurs when:

    • A large script or complex function runs.
    • A low PHP memory limit is set on the server.
    • A website has too many active plugins or heavy themes.
    • Server settings have insufficient memory allocation by default.

    To set the maximum amount of memory that PHP scripts can consume, you’ll need to adjust the memory_limit setting in the MultiPHP INI Editor in cPanel. Here’s how:

    To quick fix a PHP memory error via cPanel:

    1. Login to cPanel – Use your credentials to access your cPanel dashboard.
    2. Locate the “MultiPHP INI Editor” – This tool allows you to modify PHP configuration.
    3. Select Your Domain – Choose the domain where the error occurs.
    4. Adjust PHP Memory Limit – Find the memory_limit setting and increase the value (e.g., 256M or 512M).
    5. Save Changes – Click “Apply” or “Save” to update the configuration.

    Now check if the error is resolved. Simply refresh your website to confirm the issue is fixed.

    The Step-By-Step Guide To Adjust PHP Memory Limit:

    Step-1 Log in to cPanel: Access your cPanel.

    Step-2 Open MultiPHP INI Editor: Scroll down to the Software section and click on MultiPHP INI Editor.

    Step-3 Choose a Location: You’ll see two options to configure PHP settings:

    • Basic Mode: Provides a user-friendly interface to select the PHP directives.
    • Editor Mode: Lets you directly edit the php.ini file for finer control.

    For most users, Basic Mode is easier to work with.

    Step-4 Select the Domain: From the drop-down menu, select the domain or location you want to apply the memory limit change to.

    Step-5 Find the memory_limit Setting: In the list of settings, locate the memory_limit option.

    Step-6 Adjust the Memory Limit: Enter your desired memory limit in MB. For example: 128M (128 megabytes), 256M, or even 512M for resource-intensive applications.

    Be sure to enter a value within the limits allowed by your hosting provider.

    Step-7 Save Changes: Click Apply or Save at the bottom of the page to confirm the new memory limit.

    When You Need To Adjust The PHP Memory Usage?

    Uploading large files is another common reason for adjusting memory. When users upload bigger files, such as images or videos, PHP scripts use more memory to process these uploads. If the limit is too low, uploads may fail or time out, resulting in a poor user experience.

    For data-intensive scripts, like those managing extensive database queries, complex arrays, or calculations, having enough memory is crucial. Large data sets or intensive processes need more memory to run smoothly; otherwise, they can cause errors or stall during execution.

    People may also notice “out of memory” errors appearing in logs or on their sites during specific tasks. Increasing the memory limit helps prevent these issues, ensuring the site functions reliably.

    Image and video processing is a common feature on many websites, especially for media-heavy applications. Resizing, cropping, or editing media requires significant memory resources, so sites that handle many images or videos need higher limits to process them efficiently.

    Lastly, improving site performance and stability is often a motivation for setting a higher memory limit. If a site experiences lags during peak traffic or intensive tasks, increasing the PHP memory can help manage this load, offering a smoother experience for users.

    How To Restrict File Upload Size On Your Website Using cPanel?

    cPanel provides a straightforward way to restrict image upload sizes to control file storage and enhance website performance through the PHP.ini Manager, which allows you to adjust the upload file size limits.

    If you’re managing a WordPress site, you can do same with the help of plugin as we have discussed in this lesson.

    Here’s a step-by-step guide to setting upload size restrictions using the PHP.ini Manager in cPanel.

    Step 1: Log In to cPanel

    Access your website’s cPanel.

    Step 2: Access The PHP.ini Manager

    In the Software section, look for MultiPHP INI Editor. This is where you can modify PHP settings for different domains.

    Click on MultiPHP INI Editor to open the configuration tool.

      Step 3: Select The Domain

      Choose the domain you want to configure from the dropdown menu. If you want these settings to apply to all sites on the server, you may need to select the root directory or the specific domain directory.

        Step 4: Adjust The Upload Size Limits

        In the PHP configuration editor, locate the following settings to control the file upload size:

        • upload_max_filesize: This setting defines the maximum size of each file that can be uploaded. Set it to the desired limit for image uploads (e.g., 2M for 2 megabytes).
        • post_max_size: This controls the maximum size for all POST data. Make sure it’s equal to or larger than upload_max_filesize to avoid upload issues.
        • max_execution_time: This optional setting adjusts the time allowed for uploads. You may increase it slightly if users face issues with large files timing out.

        Simply update these values:

        • upload_max_filesize = 2M
        • post_max_size = 2M
        • max_execution_time = 300

        After values are updated, Save it to confirm the changes.

          Step 5: Test The New Settings
          1. Go to your website and try uploading an image file that exceeds the new limit to ensure the restriction is working.
          2. If the upload fails with a size-related error, the configuration is correctly set.
          Other Tips For Optimizing Image Upload Sizes
          • Compress Images Before Uploading: Encourage users to compress images for faster site performance.
          • Use Image Optimization Plugins: For WordPress, plugins like Smush or Imagify can further optimize image sizes automatically.

          By using the PHP.ini Manager in cPanel to restrict image upload sizes is a practical way to control file sizes and improve your site’s efficiency. By following these steps, you can ensure your site remains fast and responsive even with multiple image uploads.

          How To Reduce Website’s Image Load Times Using cPanel?

          Image optimization is the process of reducing an image’s file size without compromising its quality, enabling faster load times and improved site performance.

          This is achieved by compressing images, choosing the right file formats (like JPEG for photos and PNG for graphics), and adjusting dimensions to fit the website’s design requirements. Optimized images lead to quicker page loads, lower bandwidth usage, and better SEO rankings, enhancing user experience and site functionality across devices.

          Optimizing images is crucial to improve site load times and overall user experience. Here’s a step-by-step guide to image compression for Faster loading directly from your cPanel.

          Step 1: Log in to Your cPanel Account

          Begin by logging into your cPanel account. You’ll need access to the Images section, so ensure you’re using an account with these permissions. Once you’re on the cPanel dashboard, locate the Images icon under the Files section.

          Step 2: Access the Optimize Website Tool

          In the Images section, look for the Optimize Website tool. This tool allows you to compress and optimize images on your site with ease. Click on it to open the options for compressing images and optimizing how they load.

          Step 3: Choose Your Optimization Level

          The Optimize Website tool provides a few different options for optimization. You’ll generally see:

          • Compress All Content: This option compresses all content on your website, including images, HTML, and scripts, which may be too aggressive for some sites.
          • Compress Static Content: This choice compresses images and other static files, leaving dynamic content untouched. This option is often recommended as it reduces the size of files without altering user-generated or dynamically generated pages.

          Select the option that best suits your needs and proceed by clicking the appropriate choice.

          Step 4: Confirm Your Selection

          After you choose your optimization level, you’ll need to confirm your selection. cPanel will apply the settings to compress your images as specified. At this point, the tool will reduce the file size of your images, helping your site load faster without any noticeable quality loss for most users.

          Step 5: Review and Test Your Website

          Once the compression is complete, it’s a good idea to test your website’s load time to observe the improvements. You can use online tools like Google PageSpeed Insights or GTmetrix to see how much your load times have improved. Testing ensures that the compression has enhanced your site’s performance effectively.

          By following these steps, you can easily compress and optimize your website’s images from cPanel, improving load times and offering a smoother experience for your users.

          How To Enable mod_expires To Cache Your Website Files For Speed?

          Mod_Expires is a built-in module for the Apache web server, available on all Sangkrit.net hosting plans. This module leverages the functionality of mod_expires to manage how long a client’s web browser caches website resources.

          Here’s how it works: Mod_Expires manipulates the “Expires” headers sent by the hosting server. This gives you control over how long a browser stores cached copies of website resources. By adjusting these cache durations, you can optimize your site’s performance while considering your website’s update frequency.

          Important Note: If the server response already includes an “Expires” header (e.g., generated by a CGI script or a proxied origin server), Mod_Expires won’t modify or add an “Expires” or “Cache-Control” header in those cases.

          How To Enable mod_expires Via .htaccess?

          If Mod_Expires is not enabled you will need to enable it in your .htaccess file which is present in your website’s root directory, sometimes hidden and can be viewed by changing the view option from the top right corner of cPanel’s file manager. You can enable it on a per-directory basis and it applies recursively.

          Sangkrit.net uses the vendor-provided code from Apache mod_expires. Apache HTTPD documentation is accurate for using .htaccess files on your hosting account.

          Locate your .htaccess file: This file is usually located in your website’s root directory (e.g., /var/www/html/). The following given example enables mod_expires for a set of common image types and CSS files:

          # Activate mod_expires for this directory
          ExpiresActive on
          # locally cache common image types for 7 days
          ExpiresByType image/jpg "access plus 7 days"
          ExpiresByType image/jpeg "access plus 7 days"
          ExpiresByType image/gif "access plus 7 days"
          ExpiresByType image/png "access plus 7 days"
          # cache CSS files for 24 hours
          ExpiresByType text/css "access plus 24 hours"

          Similarly, you can configure mod_expires in your .htaccess file with more options by adding extra caching rules.

          Open the .htaccess file and add the following code to specify the caching duration for different file types:

          <IfModule mod_expires.c>
              ExpiresActive On
              # Set expiration for images
              ExpiresByType image/jpg "access plus 1 month"
              ExpiresByType image/jpeg "access plus 1 month"
              ExpiresByType image/gif "access plus 1 month"
              ExpiresByType image/png "access plus 1 month"
              # Set expiration for CSS and JavaScript
              ExpiresByType text/css "access plus 1 week"
              ExpiresByType application/javascript "access plus 1 week"
              ExpiresByType text/javascript "access plus 1 week"
              # Set expiration for other file types
              ExpiresByType text/html "access plus 1 day"
              ExpiresByType application/pdf "access plus 1 month"
              ExpiresDefault "access plus 1 week"
          </IfModule>

          How To Enable mod_expires Via Apache Server?

          Alternatively, if you have root or administrative access to your server you can enable mod_expires directly in Apache by using the command line. Simply, access your server and do as directed.

          Step-1 Enable the module by running the following command:

          bash
          sudo a2enmod expires

          Step-2 After enabling the module, restart Apache to apply the changes. Simply use the following command for restarting apache :

          bash
          sudo service apache2 restart

          Now clear your browser cache to ensure you see the latest changes.

          You may also check HTTP headers by using browser developer tools (Network tab) to confirm that the “Expires” or “Cache-Control” headers are set correctly for the specified file types.

          By enabling mod_expires, you can significantly reduce page load times, as browsers will cache static files and serve them locally on subsequent visits.

          How To Enable Mod_Expires Via WordPress Plugins?

          WordPress users may also use some cache plugins such as WP Super Cache or W3 Total Cache to get this thing done from their admin area dashboard. Read this lesson to know the complete process.

          Why Sangkrit.net Hosting Owners Don’t Need Cache Plugins?

          Website cache conducts a process of temporarily storing digital copies of web pages and their resources such as HTML files, images, CSS, JavaScript, and other elements in static form.

          These cached copies are then served to users when they browse the website, as a result, the load on the server is reduced as the requests are decreased, and the processes used for generating the same content repeatedly are also lessened. Thus, caching significantly improves website performance, its loading speed, and overall user experience.

          So everytime when it comes to website optimization and performance enhancement, caching is often one of the first techniques recommended. Caching stores copies of web pages or parts of pages to deliver content more quickly to users. Typically, website owners resort to various cache plugins or tools to improve loading speeds, especially for WordPress or other CMS-based websites. However, if you’re using Sangkrit.net hosting, you can skip the hassle of managing cache plugins. This is because Sangkrit.net’s hosting and servers come with cPanel integrated with Nginx cache, allowing users to activate powerful caching mechanisms with a single click.

          This article explains why Sangkrit.net hosting users don’t need any external cache plugins or tools and how the built-in Nginx caching in cPanel provides a comprehensive and efficient solution for optimizing website speed and performance.

          The Advantages of Built-In Nginx Cache

          Effortless Activation from cPanel

          Sangkrit.net hosting plans include cPanel, which is the most popular control panel for web hosting. What sets Sangkrit.net apart is the integration of Nginx as a reverse proxy cache. This means that Nginx sits between the user’s browser and the web server, caching the content and serving it to users directly without having to process requests repeatedly on the server.

          The caching can be activated with just one click from the cPanel dashboard. Users do not need to install additional plugins or configure complex settings to benefit from caching. Once the Nginx cache is enabled, the server automatically handles the caching process for both static and dynamic content. This makes it especially beneficial for beginners or those who want a hassle-free way to optimize their websites.

          Superior Speed with Nginx Caching

          Nginx is widely known for its high performance, especially when it comes to handling multiple requests simultaneously. Unlike traditional caching mechanisms, Nginx operates as a reverse proxy, which allows it to cache static assets such as images, JavaScript, and CSS files, as well as dynamic content. By caching at the server level, Sangkrit.net’s Nginx integration reduces the load on the web server, leading to faster loading times.

          Since the cache is handled by the server itself, it is much more efficient than using third-party cache plugins. With a cache plugin, the server still has to load WordPress or another CMS to serve cached content, whereas Nginx can directly serve cached content without invoking the web application, leading to substantial performance improvements.

          Reduced Server Load

          The primary purpose of caching is to reduce the load on the server. When cache plugins are used, they still operate within the environment of the content management system (e.g., WordPress), which requires server resources to process even cached requests. On the other hand, Nginx handles caching outside the CMS, serving cached responses directly from the memory or disk.

          This server-level caching approach not only frees up resources for other processes but also significantly reduces server response time. For Sangkrit.net users, this means that websites can handle more traffic with the same amount of server resources. The server-level caching also helps to prevent overload during traffic spikes, ensuring consistent website performance.

          Why Cache Plugins Become Unnecessary?

          Compatibility Issues with Plugins

          Cache plugins often have compatibility issues, especially with complex themes, eCommerce functionalities, and other plugins. These compatibility issues can cause unexpected errors, such as broken layouts or malfunctioning features. With Sangkrit.net’s Nginx caching, the cache works independently of the CMS and is applied at the server level, eliminating the potential for such conflicts.

          Furthermore, there is no need to troubleshoot the cache plugin settings or adjust the configuration based on different requirements, as the Nginx cache system has already been optimized to deliver maximum performance.

          Simplified Cache Management

          Managing cache plugins often requires regular maintenance, including purging the cache when updates are made to the site. Failing to do so can cause visitors to see outdated content. With Sangkrit.net’s built-in Nginx caching, cache purging can be done effortlessly through cPanel, which simplifies the management process. The system can also be configured to automatically refresh the cache at specified intervals.

          Users no longer need to worry about adjusting cache settings or dealing with complex cache invalidation rules. This makes it a better solution for those who prefer a simplified caching solution without compromising on performance.

          Increased Security & Reduced Risk

          Cache plugins, like any other plugin, can introduce security risks if not properly maintained. They may contain vulnerabilities that could be exploited by hackers. Additionally, using multiple plugins for caching and optimization may increase the risk of plugin conflicts, which can lead to website downtime.

          Sangkrit.net users can avoid these risks entirely by using the server-level Nginx caching. Since the caching is handled at the server level, there is no need to rely on potentially vulnerable third-party plugins for performance enhancements. The server configuration itself ensures the caching system remains secure and functional.

          How To Enable The Nginx Caching?

          Enabling Nginx caching is straightforward and can be done in just a few steps:

          1. Log in to cPanel: Once you log in, locate the Nginx caching option within the cPanel dashboard.
          2. Turn on Nginx Caching: Enable caching with a single click, its there on the right side. The system is designed to be user-friendly, so no technical knowledge is required.
          3. Configure Cache Settings (Optional): While the default configuration works well for most users, advanced settings can be adjusted to control the caching behavior for specific pages or file types.
          4. Purge Cache When Necessary: Users can easily clear the cache from the cPanel dashboard when changes are made to the website that need to reflect immediately.

          The Sangkrit.net’s hosting infrastructure is optimized for speed and reliability, with Nginx as a key component for delivering high performance. The combination of Nginx caching and SSD storage ensures that websites load quickly and handle traffic spikes with ease.

          Sangkrit.net offers 24/7 customer support to assist users with any issues they may encounter. This means that even if you have questions about enabling Nginx caching or configuring your hosting, help is always available.

          How To Redirect HTTP URLs to HTTPS Via .htaccesss File?

          After the SSL is installed on your domain name, you will need to redirect all non-secure HTTP links to their secure HTTPS connection for several important reasons.

          For any website to work over SSL, there are some modifications you will need to make to your .htaccess file, and then it will redirect your visitors to the HTTPS version of your website. To start with the process of HTTP redirection simply login to your Sangkrit.net account and follow these steps:

          1. Go to your product page.
          2. Under the Server, click Manage for cPanel
          3. In the Account Dashboard, click File Manager.
          4. In the cPanel File Manager, click Settings.
          5. Make sure that Show Hidden Files (dotfiles) is checked, and click Save.
          6. Click on public_html, and open your .htaccess if you already have one. If not, click File+, name the file .htaccess and click Create New File.
          7. Select the .htaccess file, and click Edit.
            • If you just created your .htaccess file, use this code:
              RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^(www\.)?coolexample\.com RewriteRule ^(.*)$ https://www.coolexample.com/$1 [R,L]
            • If your .htaccess file already exists, insert the lines that begin with ReWriteCond and RewriteRule directly after the already existing ReWriteEngine On.
            • Click Save Changes and Close. 

          That’s it. Visit your website and you’ll be re-directed to the HTTPS version.

          How To Redirect HTTP To HTTPS In WordPress?

          1. Log into your WordPress Dashboard.
          2. Visit Settings, click General.
          3. Locate the following fields:
            • WordPress Address (URL)
            • Site Address (URL)
          4. In each field, update your URLs from http to https
          5. Scroll down and click Save Changes.
          6. Open your current .htaccess file in the /public_html/ folder with the cPanel file manager for editing. If you don’t already have a .htaccess file, you’ll need to create one.
          7. Insert the following code at the top of your .htaccess file:
          8. Click Save Changes at the top-right corner of the screen.

          In some cases, you will need to edit your .htaccess file, if you don’t want that then use a WordPress plugin like Really Simple SSL. This saves you from the technical steps edit file editing on the server.

          The Importance Of Redirecting HTTP To HTTPS After Installing SSL

          Redirecting HTTP to HTTPS after installing an SSL Certificate is important as both HTTP and HTTPS versions start to work simultaneously on your website and most of your traffic continues to land on the old HTTP version. It is crucial for several other reasons as well –

          1. Website Security: HTTPS encrypts data transmitted between the user’s browser and your website, making it secure and protecting sensitive information such as login credentials, payment details, and personal data. If your website is accessible via HTTP, users’ data may be vulnerable to interception and tampering.
          2. User Experience: Search engines like Google prioritize HTTPS websites in their search rankings. This means that redirecting to HTTPS can improve your website’s visibility and attract more organic traffic. Additionally, users are becoming increasingly aware of the importance of online security and are more likely to trust and interact with websites that use HTTPS.
          3. Compliance: Many industries and regulatory bodies require websites to use HTTPS to protect sensitive data. By redirecting HTTP to HTTPS, you ensure that your website complies with these regulations.
          4. Mixed Content Issues: When a webpage loads content over both HTTP and HTTPS, it can cause security issues and disrupt the user experience. Redirecting to HTTPS ensures that all content is loaded securely.

          Methods Of Redirecting HTTP to HTTPS

          There are several ways to redirect HTTP to HTTPS, including:

          • Using server configuration: Most web servers (like Apache and Nginx) allow you to configure redirects using their built-in features. This method contains some very technical steps.
          • Using a .htaccess file: If you’re using Apache, you can create a .htaccess file in your website’s root directory and add a redirect rule. This method is easier in comparison to the above method.
          • Using a plugin or tool: Many content management systems (CMS) and web hosting providers offer plugins or tools that can automatically redirect HTTP traffic to HTTPS. This is the easiest one, WordPress users can simply use the ‘Really Simple SSL’ plugin.

          Redirecting HTTP to HTTPS is essential for ensuring the security, user experience, compliance, and overall success of your website. The next lesson will guide you through the complete process of redirecting the HTTP version of your website to the secure HTTPS version.

          How To Easily View & Edit Hidden Files On Your Web Hosting?

          Hidden files on a server or hosting are invisible by default. They start with a dot (.), such as .htaccess or .env. These files are typically not displayed as they are considered system or configuration files used by the server to manage server settings or website behavior.

          For example, .htaccess can control server rules for a website, while .env files store environment variables for web applications.

          To edit hidden files on your server or hosting, you will need to change the file manager settings to view and edit such files –

          Step 1 Access your cPanel account.

          Step 2 Locate the file manager and click the “File Manager” icon.

          Step 3 In the File Manager, click “Settings” at the top right, check the “Show Hidden Files (dotfiles)” option, and click “Save.”

          Step 4 Navigate to the directory where the hidden file (such as .htaccess) is located.

          Step 5 Right-click the file, select “Edit,” make the necessary changes, and save.

          That’s it. You may ensure the modifications work correctly on your website.

          When editing hidden files on a server, follow some precautions to avoid disrupting your website functionality or any server configurations.

          Always create a backup before making changes, so you can restore the original if needed. This can be easily done by double-clicking to download the file.

          Be cautious with syntax, as even minor mistakes can cause errors. For instance, editing .htaccess improperly could restrict the site access. So make incremental changes and test the site thoroughly after each edit. You may also use a staging environment to test changes before applying them to the live website.

          cPanel Hosting Explained: A Beginner’s Guide To Building Website

          cPanel Hosting is a user-friendly web hosting service that provides an easy control panel to manage your website’s backend, hosted on a server.

          The cPanel interface simplifies managing your website’s resources, such as files, databases, email accounts, domains, and security settings. It allows users to perform tasks like installing software, monitoring website statistics, and managing FTP accounts without requiring advanced technical skills.

          How To Use cPanel To Make Your Website?

          Step1 Register a Domain Name

          Start by purchasing a domain name from Sangkrit.net. Choose a name that aligns with your brand or business.

          Step-2 Subscribe to cPanel Hosting

          Go to the hosting section at Sangkrit.net and subscribe to a suitable cPanel hosting plan based on your requirements (disk space, bandwidth, etc.).

          There are various hosting plans at Sangkrit.net:

          1. Starter Hosting: Offers 1 website, 30 GB storage, unmetered bandwidth.
          2. Economy Hosting: Offers 1 website, 100 GB space, unlimited bandwidth, 100 email accounts, and 10 MySQL databases.
          3. Deluxe Hosting: Offers Unlimited websites, space, and bandwidth, 500 email accounts, and 25 MySQL databases.
          4. Ultimate Hosting: Offers Unlimited websites, space, bandwidth, 1000 email accounts, unlimited MySQL databases, double processing power & memory, premium DNS, and a 1-year SSL certificate.

          These options offer increasing resources and features based on the plan and its pricing.

          Step-3 Access the cPanel Dashboard

          After subscribing, you’ll be able to access your cPanel dashboard from your account’s ‘My Products’ page. It takes a minute and the automated process will let you add your domain name to your cPanel hosting and then access the cPanel admin area where you can upload or make your website.

          Step-4 Make Website With WordPress

          1. In the cPanel dashboard, locate the “Installatron” application installer.
          2. Click on WordPress and follow the prompts to install it on your domain.
          3. Select the domain name, configure the installation settings, and click “Install.”
          4. Once installed, configure WordPress settings such as the website title, permalinks, and general settings to suit your needs.
          5. To start managing your website, log in to the WordPress dashboard using your admin username and password (set during installation).
          6. Choose a theme from the “Appearance” section to define your website’s look and feel.
          7. Install plugins to add functionality (e.g., Social Sharing, SEO tools, contact forms, etc).
          8. Add pages, posts, images, and other content from the WordPress admin dashboard.

          Step-5 Ensure Website Security

          Regularly update WordPress, themes, and plugins, keep website backups, and use cPanel’s security tools to manage SSL certificates and malware scans.

          cPanel hosting at Sangkrit.net is ideal for beginners and experienced web developers. It offers a powerful and intuitive platform for website management.

          How To Prevent Online Directory Browsing Or Listing Via cPanel?

          Directory listing is a default server feature that shows the contents of a directory (folder) when there is no index file such as index.php or index.html in the folder.

          When directory listing is enabled, visitors can see a list of all files and subdirectories within that directory and they can also download any file, and that might pose a security risk as it may expose any sensitive files or configuration information.

          Disabling directory listing prevents such exposures, it forces the server to show a “403 Forbidden” error if there is no index file.

          This can either be done manually by adding a line of code on .htaccess file as shown below:

          Step-1 Open your cPanel dashboard.

          Step-2 Go to “File Manager” and open the root directory of your website (usually public_html) or any directory where you want to disable directory listing.

          Step-3 Look for the .htaccess file in the root directory.

          Step-4 If it doesn’t exist, create a new file named .htaccess.

          Step-5 Add this line inside the .htaccess file: “Options -Indexes”

          Step-6 Save the file and exit.

            Directory listing is now disabled for your site.

            Alternatively,

            Step-1 On cPanel, navigate to the “Advanced” section,

            Click the “Indexes” link or icon.

            Step-2 Click the folder icon and enter a directory

            Step-3 Click the directory name to configure a directory and turn indexing on or off.

            Step-4 Select the “No Indexing” option

            Step-5 Click the “Save” button.

              Another way of doing the same thing is:

              Step-1 Navigate to the “File Manager”

              Step-2 Right-click the directory and select “Manage Indices”.

              Step-3 This automatically takes you to the “Indexes” page (where we were in step 2 of the above method).

              Step-4 Click the folder icon and enter a directory

              Step-5 Click the directory name to configure a directory and turn indexing on or off.

              Step-6 Select the “No Indexing” option

              Step-7 Click the “Save” button.

                Following any of the above methods is going to disable the directory listing.

                How To Create And Manage SRV Records Using cPanel?

                An SRV (Service) record is a DNS record that defines the location of services on a domain, such as SIP (Session Initiation Protocol), XMPP (Extensible Messaging and Presence Protocol), or game servers. Unlike other DNS records like A records (which map domain names to IP addresses), SRV records help identify a service’s hostname, port, and priority on a domain, allowing different services to be hosted on separate servers.

                An SRV record has the following components:

                • Service: The name of the service (e.g., _sip for SIP or _xmpp for XMPP).
                • Protocol: Either TCP (Transmission Control Protocol) or UDP (User Datagram Protocol), which defines the protocol used by the service.
                • Priority: Similar to MX records, the priority dictates which server should be used first when multiple are available (lower numbers represent higher priority).
                • Weight: Specifies the relative weight for records with the same priority. It helps in load balancing, where a higher weight means more traffic should be directed to that server.
                • Port: The port number through which the service is accessible (e.g., 5060 for SIP).
                • Target: The hostname of the server providing the service (e.g., server.example.com).

                For instance, an SRV record might be used to define that a particular service (e.g., SIP) should be resolved to a specific hostname on a particular port, while also specifying which server should be tried first (via priority).

                Why You Might Use an SRV Record

                1. VoIP (Voice over IP): SRV records are frequently used to direct voice traffic for services like SIP to the correct server.
                2. XMPP/Jabber: To direct instant messaging traffic via XMPP servers.
                3. Load Balancing: Distribute network traffic across multiple servers with the same priority and weight.
                4. Game Servers: To resolve different game servers to different addresses or ports.

                How To Create An SRV Record On cPanel?

                If you’re hosting your website or services with cPanel, you can easily create an SRV record to help route traffic to specific services on your domain.

                Follow these steps to create an SRV record in cPanel:

                Step-1 Log into cPanel

                Access your cPanel control panel using your login credentials. Typically, the URL is yourdomain.com/cpanel.

                Step-2 Go to the Zone Editor

                Find and click on Zone Editor in the Domains section of the cPanel dashboard. This is where you manage DNS records for your domain.

                Step-3 Select the Domain

                Once you’re in the Zone Editor, you’ll see a list of your domains. Find the domain where you want to create the SRV record and click Manage.

                Step-4 Add SRV Record

                In the Manage section, click on + Add Record (usually near the top of the page). From the dropdown, select SRV Record.

                Step-5 Fill in the SRV Record Details:

                • Service: Enter the name of the service, starting with an underscore (e.g., _sip or _xmpp).
                • Protocol: Enter the protocol, also with an underscore (e.g., _tcp or _udp).
                • Priority: Choose a priority number (e.g., 1 for the highest priority).
                • Weight: If you want load balancing between multiple servers, set a weight (e.g., 5). If you’re not load balancing, you can set this to 0.
                • Port: Enter the port number on which the service is hosted (e.g., 5060 for SIP).
                • Target: Enter the hostname of the server (e.g., sip.example.com) where the service is running.

                Step-6 Set the Time-to-Live (TTL)

                TTL determines how long the SRV record is cached. The default value is usually fine, but you can set it lower (e.g., 300 seconds) if you want updates to propagate quickly.

                Step-7 Save the Record

                Once you’ve filled in all the necessary details, click Save or Add Record to finalize the creation of your SRV record.

                Step-8 Test Your SRV Record

                After adding the SRV record, it may take a few minutes to propagate. You can test it using tools like DNS lookup services or the command line (e.g., nslookup for Windows or dig Linux/Mac).

                Depending on the service you’re configuring (e.g., SIP server or XMPP), you may need to update the client or server settings to start using the new SRV record.

                Finally, ensure the SRV record works correctly by monitoring the service traffic to the specified target and port. Double-check the values (especially protocol, port, and target) if there are issues.

                  This way, you can efficiently create an SRV record for your domain in cPanel, ensuring your services are properly routed and functioning smoothly.

                  How To Restore MySQL Databases Using cPanel?

                  In the previous lesson, you learned how to easily generate and download MySQL database backups anytime from the cPanel. Next is how to restore them.

                  To restore a MySQL database from cPanel, you need to follow these steps:

                  Step 1: Log into cPanel

                  Open your browser and log into your cPanel account by entering your username and password.

                  Step 2: Access the Backup Feature

                  Once logged in, scroll to the Files section on the cPanel dashboard. Click on Backup or Backup Wizard.

                  Step 3: Choose the Database Restore Option

                  Under the Restore a MySQL Database section, locate the Restore a MySQL Database Backup option. Select this to begin the process.

                  Step 4: Upload Your Database Backup

                  Click the Choose File button and select the .sql or .gz backup file you downloaded. After selecting the file, click on Upload or Restore to initiate the restoration process.

                  Step 5: Completion

                  Once the file is uploaded, cPanel will automatically restore your database. As soon as the restoration is complete, you will receive a confirmation message.

                  By following these steps, your MySQL database will be successfully restored in cPanel.

                  How To Backup & Download MySQL Databases Using cPanel?

                  You can easily generate and download MySQL database backups anytime from the cPanel, by following these steps:

                  Step 1: Log into cPanel

                  Open your browser and log into your cPanel account by entering your username and password.

                  Step 2: Access the Backup Feature

                  Once logged in, navigate to the Files section on the cPanel dashboard. Click on Backup or Backup Wizard, both of which allow you to back up your database.

                  Step 3: Choose the Database Backup

                  If you’re using the Backup Wizard, choose the option to back up a specific part of your site. Under the Partial Backups section, locate the Download a MySQL Database Backup option. A list of databases will appear; select the name of the database you wish to back up.

                  Step 4: Download the Backup

                  After selecting the database, the backup process will begin automatically. Your browser will prompt you to download the .sql or .gz file. Save the backup file to your local computer.

                  This backup file can be used for future database restoration.

                  Wildcard & Multi-Domain SSL Certificates: Which One Do You Need?

                  A Wildcard SSL Certificate and a Multi-Domain SSL Certificate (SAN or Subject Alternative Name certificate) allow you to secure multiple websites or subdomains under a single certificate. Here’s an explanation of each.

                  Wildcard SSL Certificate

                  A Wildcard SSL certificate is designed to secure a domain and all its subdomains.

                  For example, if you have a Wildcard SSL for *.example.com, it will secure the main domain, example.com, as well as any subdomains such as blog.example.com, shop.example.com, and other subdomains like mail.example.com. This makes it ideal for businesses or website owners managing several subdomains under one domain, ensuring that all of them are encrypted without needing separate certificates.

                  Multi-Domain SSL Certificate (SAN Certificate)

                  A Multi-Domain SSL, or SAN SSL, is meant to secure multiple distinct domain names within a single certificate. It can cover different domains, subdomains, or even various domain extensions.

                  For example, one SAN certificate could secure example.com, example.net, shop.example.org, and anotherdomain.com. This type of SSL is useful for businesses or individuals managing multiple domains or websites, allowing them to secure each domain or subdomain without purchasing separate SSL certificates.

                  The main difference between the two is that Wildcard SSL focuses on securing all subdomains of a single domain, whereas Multi-Domain SSL allows for securing multiple different domains and subdomains with one certificate.

                  Another important thing you should know is that all multi-domain SSL certificates are wild-card compatible but not all wild-card certificates are multi-domain compatible so choose wisely.

                  Benefits of These SSL Certificates

                  Both Wildcard and Multi-Domain SSL certificates are cost-effective, reducing the need to purchase and manage multiple certificates. They also simplify the management process, as you only need to handle one certificate instead of several, especially when it comes to renewals.

                  Apart from this, both certificate types ensure that all domains and subdomains under the certificate are encrypted and secure, enhancing the security of your web presence.

                  Whether you need to secure multiple subdomains or entirely different domain names, Wildcard and Multi-Domain SSL certificates offer convenient and flexible solutions to ensure that your websites remain secure.

                  Which SSL Do You Need?

                  The choice between the two comes down to whether you’re primarily securing subdomains of a single domain or need to cover multiple domains. If your focus is securing multiple subdomains under one main domain, a Wildcard SSL is the best fit.

                  However, if you need to secure entirely different domains, then a Multi-Domain SSL is the solution. Both options offer robust security but are tailored for different needs. You can easily subscribe to your choice of SSL certificate from here.

                  Reasons Why Your Website Displays ‘Not Secure’ SSL Warning

                  A “Not Secure” warning on your website typically appears when the website does not have an SSL, the SSL is invalid, or is not properly configured. This lesson lists various reasons why your website may show such types of warnings on certain web browsers.

                  You Have No SSL Certificate

                  If you have not yet subscribed to an SSL certificate and your website is using HTTP instead of HTTPS then most browsers will show a “Not Secure” warning on your website. The main reason behind this is HTTP connections are not encrypted, leaving data vulnerable to interception.

                  How To Fix It? Subscribe and install an SSL certificate on your website.

                  Your SSL Certificate Is Expired

                  If your SSL certificate has expired, the browser will treat the website as insecure and show the warning, even though you had HTTPS enabled before.

                  How To Fix It? Renew expired SSL certificates promptly.

                  Mismatched Domain SSL Certificate

                  If your SSL certificate is not properly configured to match your domain (e.g., you installed the certificate for example.com but visitors are accessing www.example.com), a warning will be triggered.

                  How To Fix It? You may either subscribe to a multi-domain wildcard SSL certificate or force all traffic to the correct version of your website and set up a redirect using .htaccess or server configuration.

                  If you realize that your SSL certificate was issued for the wrong version of your domain, request a reissue from your Certificate Authority (CA).

                  Mixed Content

                  Even if your site uses HTTPS, if some elements like images, scripts, or stylesheets are loaded over HTTP, browsers will show a “Not Secure” warning due to the mixed content.

                  How To Fix It? Ensure all links, images, and scripts on the site are loaded over HTTPS to avoid mixed content warnings. Use a plugin such as Really Simple SSL to fix insecure content warnings.

                  Untrusted Certificate Authority (CA)

                  If your SSL certificate was issued by a Certificate Authority (CA) that is not trusted by major browsers, or if it’s self-signed, the website will be flagged as “Not Secure.”

                  How To Fix It? Subscribe your SSL certificate from a trusted authority.

                  How To Enforce HTTPS (SSL) URLs On Your Website?

                  SSL securely transforms data from the client to the server by adding encryptions. Before it was used to protect transactions and customer data, but now it has become Google’s official Internet ranking factor.

                  Once you subscribe and install SSL on your website, the website starts using both HTTP and HTTPS URLs which means visitors landing on HTTP from old links such as old search archives or links on other websites will continue to land on HTTP. Whereas visitors using the new HTTPS will get HTTPS. Here you will need to make sure that all visitors must land on secure HTTPS URLs of your website and that can only be done by enforcing SSL all over your website.

                  To force your website to use HTTPS on all links you will need to redirect HTTP to HTTPS and there are various methods of doing this.

                  Redirecting HTTP To HTTPS Via cPanel

                  1. Simply log in to your hosting account and open cPanel.
                  2. In cPanel, navigate to ‘Domains’ and toggle the “Force HTTPS Redirect” option for your domain.

                  Redirecting HTTP To HTTPS Via .htaccess File

                  Another way of enforcing SSL is by adding a few lines of code in .htaccess file which is located in the root directory of your website.

                  1. Log in to your hosting account and open cPanel.
                  2. Navigate to cPanel -> File Manager
                  3. Open Public_HTML and then the directory where your website is located. If your website is on the main domain i.e. yourdomain.com then it would be located in the Public_HTML directory itself.
                  4. Add the following code and save the file.

                  RewriteEngine On
                  RewriteCond %{HTTPS} off
                  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

                  Or, for forcing SSL over one specific domain name use this code:

                  RewriteEngine On
                  RewriteCond %{SERVER_PORT} 80
                  RewriteRule ^(.*)$ https://www.url.com/$1 [R,L]

                  Or, for forcing SSL over some such as domain.com/subdir. First, create a new .htaccess file in that specific directory and then add the following code:

                  RewriteEngine On
                  RewriteCond %{SERVER_PORT} 80
                  RewriteCond %{REQUEST_URI} subdir
                  RewriteRule ^(.*)$ https://www.url.com/subdir/$1 [R,L]

                  If you see some existing code in your .htacess file then add these lines on the top where rules start with similar prefixes.

                  By default .htaccess is kept as a hidden file so if don’t find it on your cPanel hosting’s file manager then click the ‘Settings’ icon (visible on the top right corner of the file manager) and tick ‘Display hidden files’ option.

                  And if you don’t find any .htaccess file in the file manager then probably your website is not using such .htaccess file. In that case, simply create one by naming it .htaccess and then open it for editing.

                  Don’t forget to change domain.com with your own domain name and SUBDIR with the name of the sub directory where you want to force an HTTPS connection.

                  Redirecting HTTP to HTTPS In WordPress

                  WordPress users may simply use a plugin called Easy HTTPS Redirection (SSL). The plugin lets you automatically set up a redirection to the HTTPS version of a URL when anyone tries to access the old HTTP version.

                  How To Use Remote SSL On Your Website?

                  Remote SSL allows you to manage SSL certificates for domains or websites that are hosted remotely, meaning outside of your current cPanel hosting environment. It offers the ability to install an SSL certificate on a website that is hosted on a different server from where the SSL certificate was generated or managed.

                  How Does Remote SSL Work?

                  Normally, SSL certificates are generated and installed on the same server where the domain is hosted. But with Remote SSL, you can generate the certificate in your cPanel environment and then transfer it to a different server where the website is hosted.

                  Remote SSL management can be useful if you’re handling multiple hosting environments or need to install SSL certificates on servers that don’t have direct integration with cPanel.

                  How To Use Remote SSL On cPanel?

                  1. Access SSL/TLS Manager: Log in to your cPanel dashboard and navigate to the “SSL/TLS” section.
                  2. Generate SSL Certificate: Use the cPanel interface to generate a new SSL certificate or import an existing one.
                  3. Transfer to Remote Server: After generating the SSL certificate, download the necessary files (certificate, private key, and CA bundle) and manually upload them to the remote server where your website is hosted. Use the appropriate SSL installation method depending on the remote server’s software (e.g., Apache, Nginx).
                  4. Remote Installation: On the remote server, follow the usual procedure for installing an SSL certificate.

                  This approach allows you to secure websites hosted elsewhere while managing your SSL certificates centrally from your cPanel.

                  How To Use Internationalized Domain Names?

                  A domain name that is in your local language or doesn’t use English alphabets or has some special characters is called Internationalized domain name. Earlier you learned about registering domain names in your local language. Once you do that, you will need to add it to your hosting so you can make a website over it.

                  The process of adding an Internationalized Domain Name is different from adding a general domain name. This lesson gives you an easy step-by-step process of adding such domains to your cPanel hosting.

                  To add a domain with international characters (IDN – Internationalized Domain Name) in cPanel, follow these steps:

                  1. Convert the domain to Punycode: International domains with non-ASCII characters need to be converted into a format called “Punycode” to be compatible with the Domain Name System (DNS).
                  2. Use Punycode Converter: Use an online converter like Punycoder or any other tool to convert your international domain (e.g., täst.com) into its Punycode equivalent (e.g., xn--tst-qla.com).
                  3. Log in to cPanel: Access your cPanel dashboard by logging in through your hosting provider.
                  4. Navigate to Domains Section: In cPanel, go to the “Domains” section and click on Addon Domains or Aliases, depending on how you want to manage the domain.
                  5. Enter the Punycode Version of the Domain: In the “New Domain Name” field, enter the Punycode version of the domain (e.g., xn--tst-qla.com). cPanel will handle the domain using its ASCII representation.
                  6. Complete the Process: Fill in the necessary details, such as the subdomain or document root, and click Add Domain.
                  7. DNS Configuration: Make sure your domain’s DNS is pointed correctly to your hosting server by updating your domain’s DNS settings at your domain registrar.

                  Once you’ve added the domain, you’ll be able to manage it just like any other domain in cPanel. The international version of the domain (with the special characters) will still function properly, even though cPanel recognizes it in Punycode.

                  How To Update ‘A’ Record IP Address On Domain Name?

                  An A (Address) record is a type of DNS (Domain Name System) record that links a domain name to a specific numerical address of the server where the website or service is hosted, this is called IPv4 address.

                  So when you copy the shared or dedicated IP address of your hosting and paste it in the A record of your DNS, it will ensure that when someone types your domain name in the web browser, it will open your website by resolving to the correct IP address of the server that is hosting your website.

                  To update your domain name’s IP address in the A record on Sangkrit.net, you will need to follow these steps:

                  Step 1. Log In to Sangkrit.net

                  • Visit System.Sangkrit.net.
                  • Click “Sign In” at the top-right corner and enter your account credentials.

                  Step 2. Access Your Domain Settings

                  • Once logged in, click on your username and select “My Products” from the dropdown menu.
                  • Scroll down to the “Domains” section.
                  • Locate the domain you want to update and click on “DNS” next to it to manage the DNS settings.

                  Step 3. Find the A Record

                  • On the DNS Management page, scroll down to the “Records” section.
                  • Look for the A (Host) record, which should have a value like “@” under the Host column and your current IP address under the Points to column.

                  Step 4. Edit the A Record

                  • Next to the A record, click on the pencil icon to edit the entry.
                  • In the “Points to” field, enter the new IP address you want to assign to your domain.

                  Step 5. Save Changes

                  • After updating the IP address, click Save to apply the changes.

                  Now allow DNS propagation time as changes can take some time to propagate across the internet, usually within a few minutes to 48 hours.

                  Following these steps, you can easily update your domain’s IP address in the A record on Sangkrit.net.

                  How To Search And Replace Across The MySQL Database Via cPanel?

                  There are several scenarios where someone might need to edit or perform a search and replace operation on MySQL database tables. The reasons for editing MySQL database can be website migration, updating URLs, migrating to HTTPS, fixing errors, replacing content, etc.

                  To search and replace across a MySQL database via cPanel, follow these steps:

                  Step 1: Access phpMyAdmin in cPanel

                  1. Log in to cPanel: Use your username and password to access your cPanel account.
                  2. Open phpMyAdmin: Scroll down to the “Databases” section and click on phpMyAdmin.

                  Step 2: Select the Database

                  1. Choose Your Database: In phpMyAdmin, locate the list of databases on the left-hand side. Click on the database where you want to perform the search and replace operation.
                  2. Backup Your Database (Optional but recommended): Before making any changes, it’s wise to back up your database. You can do this by selecting Export at the top menu and saving the file to your local computer.

                  Step 3: Execute the Search and Replace Query

                  1. Go to the SQL Tab: Once your database is selected, click the SQL tab at the top of the phpMyAdmin interface.
                  2. Enter the SQL Query: In the query box, enter the following SQL command and click the ‘Go’ button.

                  UPDATE table_name
                  SET column_name = REPLACE(column_name, ‘old_value’, ‘new_value’);

                  • Replace table_name with the name of the table you want to update.
                  • Replace column_name with the name of the column where the search and replace should occur.
                  • Replace 'old_value' with the text you want to search for.
                  • Replace 'new_value' with the text you want to replace it with.

                  For example, if you want to replace all instances of “oldsite.com” with “newsite.com” in the wp_posts table under the post_content column, the query would look like this:

                  UPDATE wp_posts
                  SET post_content = REPLACE(post_content, ‘oldsite.com’, ‘newsite.com’);

                  Clicking the Go button will execute the query. phpMyAdmin will now search for the old value and replace it with the new one.

                  Step 4: Review the Changes

                  1. Check the Results: After running the query, review your website or relevant database entries to ensure the search and replace operation works correctly.
                  2. Restore from Backup if Necessary: If something goes wrong, you can restore your database using the backup you created earlier.

                  Step 5: Repeat for Other Tables (If Necessary)

                  If you need to perform the search and replace across multiple tables or columns, repeat the process, adjusting the table_name and column_name values as needed.

                  Remember:

                  • To be cautious when performing database operations, as they can affect your website’s functionality.
                  • Always back up your database before making significant changes.
                  • Consider using a WordPress plugin like Better Search Replace for more complex or extensive search and replace operations, especially if you’re dealing with serialized data.