马来西亚云服务

sudo apt update sudo apt install apache2

Enable the service:

sudo systemctl start apache2

sudo systemctl enable apache2

Test it by visiting “http://your_server_ip” — you should see the Apache default page.

B. Securing MySQL (Create Database, User)

Install MySQL:

sudo apt install mysql-server

Secure the installation:

sudo mysql_secure_installation

Create a database and a user:

CREATE DATABASE mydb;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'securepassword';
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;

This setup ensures that your database is ready for any CMS or custom PHP application.

C. Configuring PHP & Testing phpinfo()

Install PHP and modules:

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

Create a test file:

echo "<?php phpinfo(); ?>" > /var/www/html/info.php

Visit “http://your_server_ip/info.php” to verify PHP functionality.

VPS Malaysia offers optional LAMP stack installation to simplify this step for beginners.

3. Configuring a Domain & Virtual Host

A. Pointing Domain DNS Records

To connect your domain name with your VPS:

DNS propagation can take up to 24–48 hours globally, but often updates in a few hours in Malaysia.

B. Creating /etc/apache2/sites-available/yourdomain.conf

Create the necessary folders:

sudo mkdir -p /var/www/yourdomain

Sample virtual host config:

<VirtualHost *:80>
    ServerAdmin adminyourdomain.com
    ServerName yourdomain.com
    DocumentRoot /var/www/yourdomain
    <Directory /var/www/yourdomain>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Enable it:

a2ensite yourdomain.conf

systemctl reload apache2

C. Enabling SSL With Let’s Encrypt

Install Certbot:

sudo apt install certbot python3-certbot-apache

Run Certbot:

sudo certbot --apache -d yourdomain.com

Set up auto-renew:

sudo crontab -e

0 0 * * * /usr/bin/certbot renew --quiet

4. Uploading Your Website Files

A. Using FTP/SFTP

SFTP is secure and preferred over FTP:

To create a user for uploads:

sudo adduser uploader

sudo usermod -aG www-data uploader

B. Permissions and Ownership Settings

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

chmod -R 755 /var/www/yourdomain

Avoid giving write access to all users. Proper permissions improve security and performance.

5. Testing & Go‑Live

A. Checking Web Server Logs

Useful Apache logs:

tail -f /var/log/apache2/access.log

tail -f /var/log/apache2/error.log

Check for common issues:

B. Final Performance Tweaks

a2enmod cache

sudo a2enmod expires

sudo systemctl restart apache2

VPS Malaysia’s SSD RAID 10 and DDoS protection ensure optimal speed and uptime.

Want to skip the hassle? Explore our Managed Linux VPS Plans →

6. Shared Hosting vs. Linux VPS: Why Upgrade?

FeatureShared HostingLinux VPS (VPS Malaysia)
PerformanceShared resourcesDedicated resources
Root Access
Custom ConfigLimitedFull control
PriceLowScalable mid-range
SecurityBasicAdvanced
ScalabilityLimitedHigh
Shared Hosting vs. Linux VPS

Fact: Linux powers over 75% of the world’s web servers. VPS-hosted sites can load up to 300% faster than shared hosting.

7. Ready to Host a Website on a Linux VPS With Ease?

Linux VPS Hosting

Launching your website doesn’t have to be complex. With VPS Malaysia, you get:

Whether you’re hosting a business website, blog, or custom web application, a Linux VPS provides you with unmatched control and flexibility. And with VPS Malaysia’s infrastructure and local support, you’re never alone in the process.

Still unsure? Reach out to use VPS Malaysia’s most reliable Linux VPS hosting services. Our team is here to help you every step of the way.

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