Cloud server


  • Various server solutions: web server; email server; DNS server; database server




  • Web server backup

    The purpose of network server backup is to ensure that when the server or network fails, the system can still maintain high availability and uninterrupted services to avoid a single point of failure (Single Point of Failure). Failure, SPOF). Redundancy can improve the reliability, fault tolerance and stability of the system, which is especially important for systems that provide critical services.

    1. Hardware layer redundancy

    The redundancy at the hardware layer mainly uses redundant hardware to prevent system downtime caused by a single hardware failure. Common hardware redundancy technologies include:

    2. Load Balancing

    Load balancing is the process of spreading incoming traffic across multiple servers to prevent one server from being overloaded and improve overall system availability. Load balancing can often be combined with redundancy to achieve automatic failover. Common load balancing techniques include:

    3. Failover

    Failover means that when the main server or device fails, it automatically switches to a backup system to ensure system continuity. Failover can occur at multiple levels, including the application layer, server layer, and network layer.

    4. Data backup and data synchronization

    Data backup ensures that when a system failure occurs, data will not be lost and can be quickly restored. Common data backup methods include:

    5. Geo-Redundancy

    Geographical redundancy is to deploy servers in different geographical locations to cope with system interruptions caused by regional disasters (such as earthquakes, fires, etc.). This strategy ensures that even if one data center fails, data centers in other regions can still provide services.

    6. High Availability Clusters

    High availability clusters (HA Clusters) are a group of servers working together to ensure continuous operation and automatic failover of applications. When one of the servers fails, the other servers take over. Common high-availability clustering technologies include:

    7. Cloud backup

    Utilizing the cloud service provider's backup mechanism can effectively reduce the burden of server management. Most cloud service providers (such as AWS, Google Cloud, Microsoft Azure) offer features such as automatic failover, load balancing, and data redundancy.

    Summarize

    Network server redundancy is a multi-level strategy, involving redundancy mechanisms at the hardware, network, data, and application levels. Depending on the system’s needs and budget, you can choose the appropriate backup technology



    Apache HTTP Server

    What is Apache HTTP Server?

    Apache HTTP Server (often referred to as Apache or httpd) is an open source web server software developed and maintained by the Apache Software Foundation. It is widely used for website hosting and supports the publishing of various web content and applications.

    Main features of Apache HTTP Server

    Advantages of Apache HTTP Server

    Apache HTTP Server has the following main advantages:

    1. Free and open source:Not only is it free, but it also has an active community and rich resource support.
    2. Cross-platform support:Supports multiple operating systems such as Windows, Linux, macOS, etc.
    3. Highly customizable:Users can install or configure different modules according to their needs to flexibly adjust functions.
    4. Stability and reliability:Apache has many years of development history, and its stability and reliability are trusted by the industry.

    Scenarios suitable for using Apache HTTP Server

    Apache HTTP Server is suitable for the following scenarios:



    Apache HTTP Server logs

    Default log file path

    Main log file types

    access.log format example (Common Log Format)

    127.0.0.1 - frank [10/Jul/2025:13:55:36 +0800] "GET /index.html HTTP/1.1" 200 2326

    error.log format example

    [Fri Jul 05 13:55:36.123456 2025] [core:error] [pid 12345] [client 127.0.0.1:54321] AH00123: File does not exist: /var/www/html/favicon.ico

    Modify record location and format

    Available in the Apache configuration filehttpd.conforsites-available/*.confMedium setting:

    ErrorLog "/var/log/apache2/error.log"
    CustomLog "/var/log/apache2/access.log" combined
    

    Analysis tools



    error.log file

    Use logrotate to binning

    On Linux systems, it is recommended to uselogrotateTool to regularly split and compress Apache log files and automatically retain historical records.

    Setting example

    generally/etc/logrotate.d/apache2or/etc/logrotate.d/httpdIs Apache’s logrotate configuration file:

    /var/log/apache2/*.log {
        daily
        missingok
        rotate 7
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
            if systemctl status apache2 > /dev/null ; then \
                systemctl reload apache2 > /dev/null; \
            fi
        endscript
    }
    

    Manual cutting log (not recommended for long-term use)

    mv /var/log/apache2/error.log /var/log/apache2/error.log.old
    systemctl reload apache2
    

    This method needs to ensure that Apache will regenerate new files after reloading.

    Windows system processing method

    ErrorLog "|bin/rotatelogs.exe logs/error-%Y-%m-%d.log 86400"
    

    This setting will generate an error log every day.

    suggestion



    error.log format

    Basic concepts

    error.logThe format cannot be likeaccess.logthrough thatLogFormatThe directive is customizable, but can be adjusted by adjusting Apache'sLogLevelwith enablingmod_log_debugModule to control output content and detail.

    Common error message formats

    [Fri Jul 05 14:20:30.123456 2025] [core:error] [pid 12345] [client 192.168.0.1:54321] AH00123: File does not exist: /var/www/html/favicon.ico
    

    You cannot directly change the formatting order or content template, but you can control the type and level of detail that appears.

    Set error level

    AvailableLogLevelAdjust record detail:

    LogLevel warn
    

    The levels are in order (from most to least):trace8、...、trace1debuginfonoticewarnerrorcritalertemerg

    Detailed settings for the module

    LogLevel core:info rewrite:trace3 ssl:warn
    

    Use mod_log_debug to increase debugging output

    If enabledmod_log_debugmodule, which can be passed throughDebugLogandDebugLevelLog custom error messages:

    DebugLog /var/log/apache2/debug.log
    DebugLevel 2
    

    Advanced method: rewrite the output format

    If you really need to customize the error log format, you can consider:

    summary



    Apache HTTP Server supports PHP

    Basic concepts

    Apache itself does not directly execute PHP. It needs to use PHP modules or external processing methods to parse the PHP code and return the results.

    Integration method

    Common platform suites

    Linux sample settings (PHP-FPM, recommended usage for newer versions)

    
        ServerName example.com
        DocumentRoot /var/www/html
    
        
            SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost/"
        
    
    

    Windows example setup (manual installation of PHP modules)

    Download the Windows version of PHP and make sure Apache is compatible with the PHP version. Apache 2.4 is often used with PHP 7.xphp7apache2_4.dllMods.

    # Load PHP module
    LoadModule php7_module "C:/php/php7apache2_4.dll"
    
    #Specify PHP installation directory
    PHPIniDir "C:/php"
    
    # Support PHP extension
    AddHandler application/x-httpd-php .php

    Example: If Apache is installed onC:/Apache24/, PHP is installed onC:/php/,make surephp7apache2_4.dllExists in the PHP directory.

    Windows example setup (XAMPP method)

    XAMPP is an integrated package with built-in Apache + MariaDB + PHP + Perl, suitable for Windows users to quickly build.

    1. Download and installXAMPP
    2. Start XAMPP Control Panel and clickStartApache and MySQL
    3. existC:/xampp/htdocs/Establishinfo.php
    4. The content is as follows:
    <?php
    phpinfo();
    ?>
    

    Open the browser and enterhttp://localhost/info.php, if the PHP information page is displayed, it means success.

    suggestion



    Web server periodically executes PHP

    Using crontab (Linux systems)

    In a Linux environment, PHP scripts can be executed regularly via crontab schedule.

    1. Open the crontab editor:
       crontab -e
    
    2. Add a schedule, for example, execute it every 5 minutes:
       */5 * * * * /usr/bin/php /var/www/html/script.php

    Note: Make sure the path is correct. Both PHP executable files and scripts need execution permissions.

    Use the Windows Work Scheduler

    If the server is Windows, PHP can be executed regularly through the "Job Scheduler".

    1. Open the "Work Scheduler" and add basic tasks.
    2. Set trigger time and frequency.
    3. Set the action to execute the program and fill in:
       Program: Full path to php.exe
       Parameter: Full path to PHP script, for example C:\xampp\htdocs\script.php

    Simulate schedule through browser

    If the scheduling tool cannot be used, it can also be triggered indirectly through the following methods:

    Things to note when writing PHP scripts



    Apache HTTP server security

    basic principles

    Hidden version and system information

    Avoid leaking Apache and operating system versions:

    ServerTokens Prod
    ServerSignature Off
    

    File and directory access control

    Restrict directory access to prevent arbitrary browsing:

    
        AllowOverride None
        Require all denied
    
    
    
        AllowOverride None
        Require all granted
    
    

    .htaccess usage restrictions

    Close if not necessary.htaccessTo avoid performance and security risks:

    AllowOverride None
    

    Disable unnecessary mods

    List currently loaded modules:

    apachectl -M
    

    Disable unused modules (based on actual needs):

    HTTP method restrictions

    Allow only necessary HTTP methods:

    
        
            Require all denied
        
    
    

    SSL / TLS security settings

    Enable HTTPS and disable legacy protocols:

    SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
    SSLCipherSuite HIGH:!aNULL:!MD5
    SSLHonorCipherOrder On
    

    Prevent directory listing

    To avoid showing the archive list:

    Options -Indexes
    

    Request size and timeout limits

    Prevent DoS and resource exhaustion:

    Timeout 60
    LimitRequestBody 10485760
    

    Error and record security

    LogLevel warn
    

    With protective module

    PHP related security (if using PHP)

    suggestion



    Block user attempts to hack your website

    Situation description

    existaccess.logorerror.logA large number of requests for non-existent or suspicious files were found, such as:

    /tgrs.php
    /z.php
    /system_log.php
    /wp-login.php
    /.env
    

    This is usuallyAutomated scanning or attack scripts, the purpose is to detect vulnerabilities.

    Step one: Make sure it’s not a misjudgment

    Method 1: Use Apache to block IP directly

    In Apache settings or VirtualHost add:

    
        Require all granted
        Require not ip 1.2.3.4
    
    

    Suitable for a small number of clearly malicious IPs.

    Method 2: Block specific request paths (commonly used)

    Directly block known malicious file names:

    
        Require all denied
    
    

    Or use regular expansion:

    
        Require all denied
    
    

    Method three: mod_security (strongly recommended)

    mod_securityIs Apache's Web Application Firewall that automatically blocks scanning behavior.

    Works best with the OWASP CRS (Core Rule Set).

    Method 4: mod_evasive (anti-violence request/scan)

    Automatically block IPs for a large number of requests in a short period of time:

    DOSHashTableSize 3097
    DOSPageCount 5
    DOSSiteCount 50
    DOSPageInterval 1
    DOSSiteInterval 1
    DOSBlockingPeriod 600
    

    The same IP will be automatically blocked if it scans the page within a short period of time.

    Method 5: Fail2ban (the most practical and recommended)

    Analyze malicious behavior from Apache logs and automatically block IPs (firewall level).

    Effect:

    Method 6: Reduce response information (do not reply to 404 details)

    Avoid letting attackers know too much:

    ServerTokens Prod
    ServerSignature Off
    

    Method 7: Only allow existing files to be accessed

    Reject all PHP requests for files that do not exist:

    
        Require expr %{REQUEST_FILENAME} -f
    
    

    PHP directly 403s non-existent instead of letting PHP handle it.

    Suggested practical practices (practical combination)

    important ideas



    Mail Server

    What is Mail Server?

    Mail Server is a software system specifically used for the delivery, reception and storage of email. It supports multiple email protocols such as SMTP, IMAP, and POP3. Depending on your needs, you can choose a free or commercial email server.

    List of major Mail Servers

    1. ArGoSoft Mail Server
    2. Thunderbolt Email Server
    3. Microsoft Exchange Server
    4. Postfix
    5. hMailServer

    ArGoSoft Mail Server

    Thunderbolt Email Server

    Microsoft Exchange Server

    Postfix

    hMailServer

    Comparison summary

    characteristic ArGoSoft thunder and lightning Microsoft Exchange Postfix hMailServer
    Applicable objects Individuals, small teams Medium and large enterprises Businesses and Government Agencies Medium and large enterprises Small and medium enterprises
    functional strength Basic powerful comprehensive flexible medium
    cost Free version available commercial authorization high free free
    Installation difficulty Simple medium high high Simple


    ISC DNS server

    What are ISC DNS servers?

    The ISC DNS server is a set of open source DNS software developed and maintained by the Internet Systems Consortium (ISC). The most well-known version is BIND (Berkeley Internet Name Domain). BIND It is one of the most widely used DNS servers on the Internet, providing name resolution and DNS zone management functions.

    Main functions

    advantage

    Suitable for objects

    ISC DNS servers are suitable for network administrators, small and medium-sized businesses, and organizations that require customized name resolution services.

    How to obtain

    You can start fromISC official websiteDownload the latest version of BIND and install it according to your operating system.



    Cloudflare

    What is Cloudflare?

    Cloudflare is a company that provides web acceleration, security and content delivery network (CDN) services. Its main purpose is to assist websites in speeding up access, enhancing security, and protecting websites from threats such as DDoS attacks.

    Key features of Cloudflare

    Advantages of Cloudflare

    Key benefits of using Cloudflare include:

    1. Improve website access speed and improve user experience.
    2. Effectively resist malicious attacks and ensure website security.
    3. The basic version of CDN and security features are provided for free, suitable for small and medium-sized websites.
    4. Automatically manage SSL/TLS certificates to reduce website management burden.

    Where to use Cloudflare

    Cloudflare is great for:



    Database server

    What is DB Server?

    DB Server (database server) is a server dedicated to storing, managing and processing data. It provides efficient query capabilities, supports simultaneous access by multiple users, and ensures data security and consistency. Depending on their needs, businesses and individuals can choose different database server software.

    Main DB Server List

    1. MySQL
    2. Microsoft SQL Server(MS SQL)
    3. Oracle Database
    4. PostgreSQL
    5. MongoDB

    MySQL

    Microsoft SQL Server(MS SQL)

    Oracle Database

    PostgreSQL

    MongoDB

    Comparison summary

    characteristic MySQL MS SQL Oracle PostgreSQL MongoDB
    Applicable objects Small and medium-sized applications Enterprise applications Large businesses and governments mixed use development Big data and unstructured data
    cost Free/Commercial version Authorization required Expensive licensing free Free/Commercial version
    performance medium high very high high flexible
    data model correlation correlation correlation Associations and extensions Document type


    MariaDB

    MariaDB is an open source relational database management system (RDBMS) created by the creators of MySQL and is fully backwards compatible with MySQL. It is designed for high performance, stability, and security and is used worldwide, especially in enterprise environments.

    Main features of MariaDB

    Install MariaDB

    On most Linux systems, MariaDB can be installed via a package manager, such as on Ubuntu:

    
    sudo apt update
    sudo apt install mariadb-server
            

    Once the installation is complete, MariaDB can be started and secured:

    
    sudo systemctl start mariadb
    sudo mysql_secure_installation
            

    Basic instructions

    Here are some commonly used MariaDB commands:

    MariaDB application scenarios



    ODBC Driver

    What is an ODBC Driver?

    ODBC (Open Database Connectivity) Driver is a standard database connection interface that allows applications to communicate with different types of databases through a unified API. ODBC Driver It is the middleware software responsible for translating requests made by applications so that they can interact with back-end databases.

    ODBC Driver functions

    How ODBC works

    1. The application makes database requests (such as SQL queries).
    2. The ODBC driver converts the request into a language understood by the database.
    3. The database processes the request and returns the results.
    4. The ODBC driver converts the results into a format usable by the application.

    Advantages of ODBC Driver

    Disadvantages of ODBC Driver

    Common ODBC Drivers

    How to configure the ODBC Driver

    1. Download and install the ODBC Driver for the corresponding database.
    2. Configure the data source name (DSN) through the ODBC Data Source Administrator.
    3. Use the configured DSN to connect to the database in your application.


    cloud computing

    definition

    Cloud Computing is a model that provides computing resources through the Internet, including servers, storage spaces, databases, networks, software and analysis tools, etc. Users can dynamically access these resources on demand without building or maintaining physical equipment themselves.

    Core features

    Three major service models

    Application scope

    advantage

    challenge

    main suppliers

    future trends

    Cloud computing will continue to integrate with edge computing, artificial intelligence, 5G, and quantum computing, developing towards a smarter and more distributed hybrid cloud and multi-cloud environment, accelerating the digital transformation and automation process of enterprises.



    T:0000
    資訊與搜尋 | 回阿央首頁 | 回prodsvr首頁
    email: Yan Sa [email protected] Line: 阿央
    電話: 02-27566655 ,03-5924828
    泱泱科技
    捷昱科技泱泱企業