• 马来西亚云服务

    sudo ufw allow OpenSSH sudo ufw enable

    E. Installing fail2ban for Brute-Force Protection

    sudo apt install fail2ban
    
    Fail2ban monitors log files and bans suspicious IPs

    5. Installing a Web Server (Apache/Nginx)

    A. Choosing Between Apache and Nginx

    Apache is easier for beginners, while Nginx offers better performance under heavy load.

    B. Step-By-Step Installation and Testing

    sudo apt install apache2
    
    sudo systemctl status apache2

    Access your server IP in a browser to test.

    C. Creating a Virtual Host File

    Create a new config file under /etc/apache2/sites-available/yourdomain.conf and configure your server blocks.

    D. Placing Your Website Files Correctly

    Place your site files in /var/www/yourdomain and set permissions accordingly.

    E. Restarting and Enabling Your Web Server

    sudo systemctl restart apache2
    
    sudo systemctl enable apache2

    6. Setting Up MySQL and PHP (LAMP Stack Option)

    A. Installing MySQL Server and Securing It

    sudo apt install mysql-server
    
    sudo mysql_secure_installation

    B. Installing PHP and Required Modules

    sudo apt install php libapache2-mod-php php-mysql

    C. Testing PHP Processing With info.php

    Create a file in /var/www/html/:

    <?php phpinfo(); ?>

    Visit your-vps-ip/info.php in a browser.

    D. Creating and Configuring Databases

    Use mysql -u root -p to log in and create your database:

    CREATE DATABASE mydatabase;

    7. DNS and Domain Configuration

    A. Understanding DNS Basics

    DNS translates your domain name to your VPS IP address.

    B. Setting A and CNAME Records for Your Domain

    Use your domain registrar’s dashboard to point the A record to your server IP.

    C. Using Malaysian DNS Providers or Cloudflare

    Consider Cloudflare for free DNS and extra security, or local DNS for lower latency.

    D. Propagation Time and Troubleshooting

    DNS changes can take up to 48 hours. Use tools like dnschecker.org to monitor.

    8. Securing Your VPS and Website

    A. Installing and Configuring SSL Using Let’s Encrypt

    sudo apt install certbot python3-certbot-apache
    
    sudo certbot --apache

    B. Enabling HTTPS Redirection

    Certbot auto-configures HTTPS. Manually update Apache configs if needed.

    C. Setting Automatic Security Updates

    Install unattended upgrades:

    sudo apt install unattended-upgrades

    D. Backing Up Your Server Regularly (rsync, cron)

    Schedule backups using cron jobs with rsync or other backup tools.

    9. Deploying Your First Website

    A. Uploading Website Files via SFTP

    Use FileZilla or command-line SFTP to upload to /var/www/yourdomain.

    B. Setting Permissions and Ownerships

    sudo chown -R www-data:www-data /var/www/yourdomain

    C. Configuring the Web Server to Serve Your Domain

    Enable your virtual host:

    sudo a2ensite yourdomain.conf
    
    sudo systemctl reload apache2

    D. Testing Everything Live (Load Time, Access)

    Verify your site loads, DNS resolves, and SSL works. For WordPress users, see Installing WordPress on VPS.

    10. Final Thoughts and Ongoing Maintenance

    A. VPS Checklist for Malaysian Users

    Ensure updates, backups, firewalls, and SSL are active. Review our Linux VPS security guide.

    B. Monitoring Tools (Uptime Robot, Netdata)

    Use tools like UptimeRobot, Netdata, or Nagioses for performance and uptime alerts.

    C. When to Scale or Upgrade Your VPS

    Monitor RAM/CPU via htop. Upgrade when resource usage consistently nears 80%.

    11. Where to Get Help (Forums, Communities)

    Visit Ubuntu forums, Stack Overflow, or local tech groups for support.

    By following this comprehensive Linux VPS setup guide, you can confidently host and manage your website in Malaysia. With proper setup, security, and ongoing maintenance, your VPS can support scalable and secure web projects tailored to local needs.

    Kaif

    Share
    Published by
    Kaif
    9 months ago

    Recent Posts

    Is WordPress 6.9 a Game Changer? Here’s a Look

    1. Introduction WordPress 6.9, codenamed "Gene," is the final major release of 2025 and one…

    7 days ago

    Docker vs Kubernetes: Containerization Showdown

    1. Introduction to Containerization 1.1 What Is Containerization and Why It Matters Modern software development…

    1 week ago

    How to Set Up n8n? A Step-by-Step Guide for Self-Hosted Workflow Automation

    1. Introduction If you've ever wanted to automate repetitive tasks — like syncing data between…

    3 weeks ago

    Top Survival Games Perfect for Dedicated Server Hosting

    Introduction Survival games have become one of the most enduring and beloved genres in modern…

    1 month ago

    Containerize and Deploy Node.js Applications With VPS Malaysia

    1. What is Node.js? Node.js lets you use JavaScript to build the "brain" of a…

    1 month ago