• Home
  • HIFI Music
  • Movies
  • Travel
  • Reviews
    • Headphones
    • Car Audio
    • Home Cinema
    • Photography
  • Guides
    • Video Game
    • Audio Video
  • Gallery
  • Nocturnal
  • VANC
    • Fuji X Portrait
  • Follow Me On

  • Home
  • HIFI Music
  • Movies
  • Travel
  • Reviews
    • Headphones
    • Car Audio
    • Home Cinema
    • Photography
  • Guides
    • Video Game
    • Audio Video
  • Gallery
  • Nocturnal
  • VANC
    • Fuji X Portrait
IvanYolo » Web Guide » How To Setup Your First LEMP Stack with Centmin Mod (Linux, Nginx, MariaDB/MySQL, PHP)

How To Setup Your First LEMP Stack with Centmin Mod (Linux, Nginx, MariaDB/MySQL, PHP)

Share
Tweet
Pin
Share
0 Shares

Want to set up your own server but not sure how to or just planning to get out of the slow performance of shared hosting environment? Well, you’ve just landed on the right blog post here mate!

Lets get started with setting up LEMP web stack (Linux, Nginx, MariaDB/MySQL, PHP) to host your first website. Yes, I’m using Nginx over Apache on all my production sites because it’s super fast than Apache webserver. It loads the website in seconds. Trust me, you’ll like the SPEED.

For configuration wise, NGINX will be a little harder to configure than Apache but no worries here, this is a very straight forward 15 minutes web server setup tutorial to get your web server up and running, hosting your website in no time.

First what you need is a VPS to get started here, i recommend Linode or Digital Ocean, websites like Nocturnal Malaysia Clubbing and this blog are powered by Linode. To get started a VPS with 512MB or 1GB memory is sufficient already for your new site/blog.

In this tutorial, i will be using Centmin Mod on CentOS 7 and it is a super quick installation of NGINX web server, MySQL and PHP. Lets get started!

Step 1 – VPS is all you need


Purchase a Linode VPS, starting with a 1GB for testing. I chose Linode over Digital Ocean because of its high performance SSD server and affordable 2GB RAM VPS at $10 per month compared to Digital Ocean’s 1GB at $10 per month. That’s an additional 1GB RAM in difference, you know?

Step 2 – Pointing Domain Name To Your VPS


Point your domain name to the VPS ip address. You can use the DNS Management provided by your domain name registrar or the website where you have purchase the domain name. E.g on Namecheap, we access Domain List and create a new A records pointing to the server ip address. The easiest way is to use Linode DNS Manager if you have purchase a Linode VPS, it will create the A records for you on the go. Find out how to setup Linode DNS and all you need is just change the nameservers below

ns1.linode.com
ns2.linode.com
ns3.linode.com
ns4.linode.com
ns5.linode.com

Step 2 – Access via SSH Console


Access your VPS using SSH, you can use Putty to access SSH or use WinSCP with SFTP (For Windows). Login as root and enter the root password. You can create your own username for security purposes to prevent brute force attack. In future, I will also guide on securing your VPS. But right now, if you’re using it alone and nobody else then skip to step 2 and start with the installation right away.

adduser username
passwd username
gpasswd -a username wheel

Step 3 – The LEMP Stack Installation Begins


Copy and paste the command below into your console and press enter. The update for the CentOS will start and the installation of NGINX web server, PHP, MySQL, and other services will take about 30 minutes to an hour to complete. Keep in mind you will only need to run this command once, that was your first time setting up your server.

Now, go grab an iced cold coffee drink, sit back and enjoy!

yum -y update; curl -O https://centminmod.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh

Step 4 – Centmin Mod Menu / Add Nginx Vhost


Adding a Nginx Vhost is to create folders and configurations for your website. If you want to use WordPress, access the menu and select #22 to add WordPress Nginx Vhost with Cache Plugin. Most of the time, you will be using this command to access the menu to do update. Type the command in your SSH below

cd /usr/local/src/centminmod
./centmin.sh

Now you can access the menu (as shown in the picture above), select option ‘2‘ if you’re hosting HTML files or select option 22 to use WordPress. e.g select #22 and the script will install WordPress, create database and folders for you.

Wait until the WordPress Vhost installation to complete and exit the menu selecting option #24. You can browse to the following directory /home/nginx/domains/yourdomainname.com/public and to view all your WordPress source files.

Step 5 – DNS Propagation

Wait for at least 24 hours for the DNS propagation and always use intoDNS.com to check for DNS issues.

And… guess what? It’s all done! Now you have your super-FAST self-hosted WordPress blog on your own VPS server, and less worry with all the complicated Nginx rewrite rules.

But of course, you can configure the server even further for optimization once you have mastered Nginx and CentOS. You can update the PHP to the latest 7.0.14 stable with Opcode Cache, update Nginx, optimize MySQL database, PHP-FPM and as well enable the ultimately powerful Nginx Pagespeed module which we will be covering in our next guide.

Current LEMP Stack setup as below
CentOS 7
PHP 5.3.29
Nginx 1.11.8
MariaDB 10.1.20
Wordpress 4.7

#Tips – For an unmanaged VPS setup, you always need to keep the server, scripts, applications, and services updated with the latest security patches, this is necessary tasks to do to keep your server updated all the time and secured.

Share
Tweet
Pin
Share
0 Shares
Centmin Mod SetupCentOS VPSLEMP Stack SetupLinode VPSNginx SetupServer Setup GuideWeb Server Guide
Share

Web Guide

Ivan Cheam
Ivan Cheam is a frontend web developer by day and blogger by night at IvanYoLo. He love photography, listening to music, movies, feeding his betta pet, travel and blogging. Feel free to follow me on Facebook and Instagram.

You might also like

Moving from Shared Hosting to Linode VPS Hosting
July 31, 2017
How To Setup Linode DNS & Custom Nameservers
January 8, 2017
  • Follow Me On

  • Sign Up Newsletter

  • Recent Posts

    • Best Fujifilm Vintage Film Simulation Recipes
      January 13, 2021
    • Best US TV Shows 2020 To Watch On Holidays + BONUS!
      December 20, 2020
    • Black Friday 2020: Best Deals on SSD & PC Gaming Parts
      November 24, 2020
  • Popular Tags

    4K Blu-ray 4K HDR Blu-ray Movies 2017 Movies Audiophile Audiophile Music Audiophile Songs Best Netflix Blu-ray Bodyslam Car Audio Catchy Hip Hop Songs Chinese Rapper Dolby Atmos Dolby Atmos Movies Ford Fiesta Fujifilm Fujifilm Mirrorless Camera HD audio HD Songs Horror Movies Jazz Jazz Playlist Jazz Singers Kitaro Linode VPS Lucid Dream Music Videos Netflix Netflix TV Series Palmy Popular Thai Singers Project Kratos Ragnarok Eternal Love Ragnarok Mobile Ragnarok Mobile Guide Spotify SQ Thai Pop Rock Thai Songs VAVA Violette Wautier Vocal Jazz Weight Gain WordPress Caching WordPress Tips


  • About IvanYolo

    Welcome to my official blog. I am a Spotify playlist curator and blogger from Malaysia who write reviews & guides for Hi-Fi music, audiophile, car audio, hobbies, fitness, web design tips, gaming guides, travel, photography and anything that are weird but good! Get to know more about Ivan Cheam.

    Now, welcome to Ivan Cheam official blog at IvanYolo.com.

  • Popular Posts

    • SQ Car Audio: Path to the Audiophile World
      December 31, 2016
    • Yamaha Firmware Update 1.31 with Tidal & Deezel
      October 7, 2017
    • A Little SQ Demo on Ford Fiesta Car Audio Part 1
      January 7, 2017
  • RSS Nocturnal

    • Legacy Festival 2020 Online Edition
    • One Asia Music Festival 2020, 14-15 Nov
    • Tommy Cham Sunset Miri TC Vol.34 Mixtape
    • 10 Reasons Influencers Should Hire a Personal Photographer
  • More Curated Music


  • About Me
  • Privacy Policy
  • Terms of Use
2021 © Copyright Ivan Cheam. All rights reserved.