Believe me: Installing the LNMP one-key package is the easiest and most time-saving way to set up a production CentoOS server. After installation, your server will installed with Nginx, PHP, MySQL, phpMyAdmin, Zend and ready to serve.
LNMP one-key package is a bunch of shell scripts that automate the installation of Nginx, PHP and MySQL server production environment. It’s written by Licess.
Please follow the steps carefully and leave a comment when in doubt.
To make the narrative easier, let’s suppose that you have a domain name: www.lovelyoldies.com that points to your server’s IP 18.104.22.168 . For easier administration, set up a second level domain name admin.lovelyoldies.com and point it to 22.214.171.124 too.
Connect to your VPS console using your root account (using Putty, Tunnelier, etc):
1. Create a temp directory under root if it is not there and go to that directory. This is where you will put the installation files.
2. Download the lnmp package and unpack and then enter the unpacked directory.
wget -c http://soft.vpser.net/lnmp/lnmp0.8.tar.gz
tar zxvf lnmp0.8.tar.gz
3. Run the installation
You will be prompted to enter a domain name. DO NOT enter your domain name that will be used for you site. In our example, enter admin.lovelyoldies.com or the IP address 126.96.36.199.
You will be prompted to enter a password for mysql root user. Enter a password and write it down. You will be using the user name root together with this password to log on to phpmyadmin.
Now, stand up from your computer and chat to your wife or play with your children. It’s going to take a while. During this time Nginx, PHP, MySQL, phpMyAdmin, Zend will be installed.
After installation finishes, open http://admin.lovelyoldies.com with your web browser. A congratulation page appears (Sorry, it’s in Chinese).
All done! Bye!!
Wait… you will say…
If the congratulation page doesn’t appear, it means:
If you just set up the DNS record for your domain name, it’s going to take a while for it to point to the right IP. Of course, you don’t want to wait. Let’s make it effective immediately. Skip step four if your domain name is already pointed to the right IP.
4. If you are using Windows, go to C:\Windows\System32\drivers\etc and find the the file named “hosts” and open it with notepad. Add
5. Now,the PHP and Ngix that has been installed is not the newest version. You may want to update them for security reasons. Run (you are now at /root/temp/lnmp0.8/):
Enter the version number you want to upgrade to when prompted. Go to http://nginx.org/ to find available versions.
Enter the version number you want to upgrade to when prompted. Go to http://php.net/ to find available versions.
6. Create a folder where you would like to upload your site. In our example, /home/web/lovelyoldies.com/
7. Now we want our domain names to be tied to this folder. run:
Enter your domain name as prompted: lovelyoldies.com.
Then you are asked:”do you want to add more domain name?” Press y
Enter www.lovelyoldies.com as we want these two domain names to be the same site.
The you will be prompted: “Enter the directory name for the domain names” (something like this, you won’t miss it.)
8. Use your SFTP client (Tunnelier, FileZilla, etc) and upload your website to /home/web/lovelyoldies.com
All done! open http://lovelyoldies.com with your web browser! Bye
Wait… you will yell:-)
9. If you are installing a new wordpress site, you will need to go to (in our example):
Log on using root and your root password (see step 3) for mySQL and create a database and optionally assign a user to that database.
Then run the wordpress installation.
You are likely to meet more issues like setting up SSL, url rewriting… (if you need these) but I am going stop here.
2 Responses to “Step by step LNMP installation guide for CentoOS servers”
Leave a Reply
You must be logged in to post a comment.