Documentation

Visit Our xCloud Knowledge Base

Here is your one-stop source for in-depth articles, FAQs, and tutorials for you to excel at hosting & managing your websites.


How to find Default Paths for PHP, Nginx, and MySQL Configurations in xCloud server

When managing a server on a platform like xCloud, knowing where to find configuration files is crucial.

How To Find Default Paths in xCloud #

This guide provides detailed information on how to find default paths for PHP, Nginx, MySQL, and other related configurations on an xCloud server.

1. Site Path #

The site path is where the files for each of your websites are stored. This directory typically contains the website’s HTML, PHP scripts, images, and other assets needed to display and run the site. Keeping your site files organized and accessible in this directory makes it easier to manage and update your site. For most setups on xCloud, the standard site path is:

  • Site Path:
 /var/www/{site-name}

Replace {site-name} with the actual name of your website. For example, if your site is named “example.com” the path would be /var/www/example.com
This location is commonly used because it keeps site files separate and organized under the /var/www directory, which is a conventional location for web files on Linux servers.

2. NGINX Configuration Path #

Nginx is a powerful and popular web server used to serve websites and applications. Each website that Nginx serves typically has its own configuration file, which contains settings such as server names, root directories, and proxy configurations. These configuration files are stored in the following path:

  • Nginx Config Path:
 /etc/nginx/sites-available/{site-name}

Here, {site-name} should be replaced with the name of your specific site. For example, a website named “example.com” would have its configuration file at /etc/nginx/sites-available/example.com
After creating or modifying a configuration file in this directory, you usually create a symbolic link in the /etc/nginx/sites-enabled/ directory to activate the site.

3. PHP FPM Pool Configuration #

PHP FastCGI Process Manager (FPM) is a PHP handler that allows for faster processing and better performance by managing pools of PHP workers. Each site or application can have its own FPM pool configuration, which specifies settings like the number of child processes, memory limits, and execution timeouts. These pool configuration files are located in:

  • PHP FPM Pool:
 /etc/php/{php-version}/fpm/pool.d/

Substitute {php-version} with the version of PHP that your site is using, such as 7.4 or 8.0. For example, if you are using PHP version 8.0, the path would be /etc/php/8.0/fpm/pool.d. Within this directory, you will find files named after your site or application, which contain pool-specific settings with the www.site-username.conf format.

4. Find Default Paths for PHP INI Configuration #

The php.ini file is the main configuration file for PHP. It sets important options such as memory limits, file upload sizes, and execution time. There are separate php.ini files for different execution contexts: one for PHP-FPM (used by web servers like Nginx) and another for the CLI (Command Line Interface). The paths for these files are:

  • FPM Configuration:
 /etc/php/{php-version}/fpm/php.ini
  • CLI Configuration:
 /etc/php/{php-version}/cli/php.ini

Replace {php-version} with the specific PHP version you are using. For instance, if using PHP 8.0, the FPM configuration path would be /etc/php/8.0/fpm/php.ini, and the CLI path would be /etc/php/8.0/cli/php.ini. These files control the PHP environment for web and command-line scripts, respectively.

5. Find Default Paths for SSL Certificates #

SSL certificates are essential for securing the connection between a user’s browser and your server. Certificates can come from different sources, such as Let’s Encrypt, which provides free SSL certificates, or custom providers like Cloudflare. The paths to these certificates vary depending on the source:

  • Let’s Encrypt Certificates:
 /etc/letsencrypt/live/{site-name}/fullchain.pem
  • Custom, Cloudflare, or Other Certificates:
 /etc/nginx/ssl/{site-name}/fullchain.pem

Replace {site-name} with your actual site name. For example, the path for a site named “example.com” using Let’s Encrypt would be /etc/letsencrypt/live/example.com/fullchain.pem. For custom certificates, ensure that the files are placed in the /etc/nginx/ssl/{site-name}/ directory and referenced correctly in your Nginx configuration.

6. Log File Paths #

Log files are vital for monitoring and troubleshooting server operations. They record information about server access, errors, and other events, providing insights into server performance and identifying issues. Common log file paths include:

  • Debug Log:
/var/www/{site-name}/wp-content/debug.log

This file logs PHP-related debugging messages for sites using WordPress or custom PHP scripts.

  • Nginx Log:
/var/log/nginx/{site-name}*.log

This directory contains general log files related to Nginx, capturing various server events.

  • Nginx Access Log:
/var/log/nginx/{site-name}-access.log

This file logs all access requests to your site, providing details about visitor IPs, request types, and response statuses.

  • Nginx Error Log:
/var/log/nginx/{site-name}-error.log

This file logs any errors encountered by Nginx, including configuration issues, server errors, and script errors.

  • MySQL Log:
/var/log/mysql/

This directory contains logs related to MySQL database activities, which can be useful for monitoring queries, replication issues, and server performance.

7. 7G Firewall Configuration #

The 7G Firewall is a set of rules designed to protect web servers from common threats like spam, SQL injection, and other malicious attacks. Configuration files for the 7G Firewall on an xCloud server can be found here:

  • General 7G Configuration:
/etc/nginx/conf.d/7g-firewall.conf

This file contains the main rules that apply to the entire server.

  • Site-Specific 7G Configuration:
/etc/nginx/xcloud-conf/7g.conf

This file includes conditional rules tailored for individual sites.

These files are critical for securing your server and should be reviewed and updated regularly to adapt to new threats.

8. Site Backup Path #

Backing up your site is crucial to prevent data loss. On xCloud servers, backups are typically stored in a hidden directory under the root user’s home directory:

  • Backup Path:
/root/.backup/

This directory contains backup archives of your site files and databases. Regularly check this directory to ensure backups are being created and consider copying backups to an off-site location for added security.

9. Redis User File Location #

Redis is a popular in-memory data structure store used as a database, cache, and message broker. On xCloud servers, user access control for Redis is managed using the users.acl file:

  • Redis User File:
/etc/redis/users.acl

This file defines user permissions and access control lists (ACLs) for Redis. Make sure to configure this file to restrict access appropriately and secure your Redis installation.

10. Cron job List Path #

Cron jobs are scheduled tasks that run automatically at specified intervals. They are useful for automating repetitive tasks such as backups, updates, and maintenance. The list of cron jobs is typically stored in:

  • Cronjob List Path:
/etc/cron.d/

This directory contains files that define scheduled tasks for various applications and scripts. You can add or modify cron jobs here to schedule tasks like database backups, system updates, and routine maintenance scripts.

These paths are common default locations on xCloud servers, but they can vary based on your specific configuration or server setup. It is always a good practice to double-check these paths, especially after custom configurations or installations, to ensure your server operates securely and efficiently.

What are your feelings
Updated on September 5, 2024

Server Name

RAM

SSD

xCloud Provider Price/m
(For LTD users)

VULTR Price/m

DO Price/m

Newcomer

1GB

25GB

$4.50

$5.00

$6.00

Basic

2GB

55GB

$9.00

$10

$12.00

Standard

4GB

80GB

$18.00

$20

$24.00

Professional

8GB

160GB

$36.00

$40

$48.00

Business

16GB

320GB

$72.00

$80

$96.00

Server Name

RAM

SSD/NVMe

xCloud Provider Price/m
(For LTD users)

VULTR Price/m

DO Price/m

Lite

1GB

32GB

$5.40

$6.00

$8.00

Personal

2GB

88GB

$16.20

$18.00

$24.00

Growing

4GB

128GB

$21.60

$24.00

$32.00

Elite

8GB

256GB

$43.20

$48.00

$64.00

Titanium

8GB

384GB

$86.40

$96.00

$96.00

Ultimate

32GB

512GB

$172.80

$192.00

$192.00