Want to be here? contact us bar

Lnmp installation and use tutorial

2013.11.16 Server related
  • Article Introduction
  • Upgrade version
  • Comments&Suggestions

From free virtual host to virtual host, to winvps, to linuxvps Is this growth?

Starting from winvps, you can also configure the environment like an operating computer... Since I arrived at Linux, I have been like a blind person, totally blind!

Before that, Yixiaobai also taught me a secret script, "Install a panel"... It's really convenient to install a panel, but some panels occupy too much memory...

In Ah Fu's words, the more features and vulnerabilities you open, the less secure your website will be...

It was not until yesterday that my friend Ah Fu pushed me to use lnmp to match the language environment... ok Don't calm down!

After connecting to ssh, start the wget command:

Domestic selection:

wget -c http://soft.vpser.net/lnmp/lnmp0.9-full.tar.gz

Selection abroad:

wget -c http://soft.vpser.net/lnmp/lnmp0.9.tar.gz

In fact, there are not many domestic vps, but many foreign low-priced vps, so Ah Fu directly wrote the tutorial with the second command. (The difference between the two installation packages is that the following one is without software, and the upper one is with full software, so you don't need to download it during installation.)

The following is a row by row copy of carriage returns.

tar zxvf lnmp0.9.tar.gz

cd lnmp0.9

./centos. sh/* If you have Debian or ubuntu, use it/ Debian.sh or/ ubuntu.sh*/

After entering, the following will appear (the bold part is the domain name you want to enter. It is recommended not to use the domain name you want to build a website):

=========================================================================
LNMP V0.9 for CentOS/RadHat Linux VPS  Written by Licess
=========================================================================
A tool to auto-compile & install Nginx+MySQL+PHP on Linux

For more information please visit http://www.lnmp.org/
=========================================================================
Please input domain:
(Default domain: www.lnmp.org): myvps.rffan.info /*Here is the domain name, but do not enter the domain name you want to do in the future*/
===========================
domain=myvps.rffan.info
===========================
===========================
Please input the root password of mysql:
(Default password: root): rffan123456  /*Here is the root password of MySQL*/
===========================
mysqlrootpwd=rffan123456
===========================
===========================
Do you want to install the InnoDB Storage Engine?
(Default no, if you want please input: y, if not please press the enter button):*/
INPUT error,The InnoDB Storage Engine will NOT install!

Press any key to start…

Press Enter to wait for the installation to complete. The estimated time is about 20-40min

The prompt message after installation is as follows:

========================== Check install ================================
Install lnmp 0.9 completed! enjoy it.
=========================================================================
LNMP V0.9 for CentOS/RadHat Linux VPS  Written by Licess
=========================================================================

For more information please visit http://www.lnmp.org/

lnmp status manage: /root/lnmp {start|stop|reload|restart|kill|status}
default mysql root password:rffan123456
phpinfo : http://myvps.rffan.info/phpinfo.php
phpMyAdmin : http://myvps.rffan.info/phpmyadmin/
Prober : http://myvps.rffan.info/p.php
Add VirtualHost : /root/vhost.sh

The path of some dirs:
mysql dir:   /usr/local/mysql
php dir:     /usr/local/php
nginx dir:   /usr/local/nginx
web dir :     /home/wwwroot

=========================================================================
=========================================================================
Manager for LNMP V0.9  ,  Written by Licess
=========================================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to Manage status of lnmp
For more information please visit http://www.lnmp.org

Usage: /root/lnmp {start|stop|reload|restart|kill|status}
=========================================================================
Nginx is runing!
php-fpm is runing!
SUCCESS! MySQL running (13615)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 :::22                       :::*                        LISTEN

The following is a tutorial...

First, make sure you are in the root directory

cd /root

Then we started our way to build the station. Use the following command

sh vhost.sh

Come and start building the station. After entering the command, you will be prompted as follows. Note: Don't type a wrong word. If you type a wrong word, you can only ctrl+c to cancel and start again. Well, the next step is to bind domain names

[ root@MyVPS ~]# sh vhost.sh
=========================================================================
Add Virtual Host for LNMP V0.9 , Written by Licess
=========================================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to add virtual host for nginx
For more information please visit http://www.lnmp.org/

=========================================================================
Please input domain:
(Default domain: www.lnmp. org): www.rffan.info/* Enter your domain name here*/

===========================
domain=www.rffan.info
===========================
Do you want to add more domain name? (y/n)/* This is to ask whether you want to add a domain name again*/
Y/* Ah Fu chose Y, because Ah Fu still has one without www to bind*/
Type domainname,example(bbs.vpser.net forums.vpser.net luntan.vpser.net):
Rffan.info/* Enter the domain name without www here*/
===========================
domain list=rffan.info
===========================
Please input the directory for the domain: www.rffan.info:/**/
(Default directory: /home/wwwroot/www.rffan.info):/home/www/rffan.info
===========================
Virtual Host Directory=/home/www/rffan.info
===========================
===========================
Allow Rewrite rule? (y/n)/* Here you are asked whether to add pseudo static, of course, choose Y*/
===========================
y
Please input the rewrite of programme :
wordpress,discuz,typecho,sablog,dabr rewrite was exist.
(Default rewrite: other): wordpress*/
===========================
You choose rewrite=wordpress
===========================
===========================
Allow access_log? (y/n)/* Log files, SEO analysis spiders, and also useful when being roosted. It is recommended to clean them regularly*/
===========================
y
Type access_log name(Default access log file:www.rffan.info.log):

===========================
You access log file=www.rffan.info.log
===========================

Press any key to start create virtual host.../**/
Create Virtul Host directory……
set permissions of Virtual Host directory……
You select the exist rewrite rule:/usr/local/nginx/conf/wordpress.conf
Test Nginx configure file……
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

Restart Nginx……
=========================================================================
Add Virtual Host for LNMP V0.9 , Written by Licess
=========================================================================
For more information please visit http://www.lnmp.org/

Your domain:www.rffan.info
Directory of www.rffan.info:/home/www/rffan.info

=========================================================================

Ok, after following the above operation, the domain name binding is completed. Now let's upload files and create a database.

When uploading files, if there are ready-made documents on the network, it is OK to directly wget them. The command is as follows

wget -c  http://cn.wordpress.org/wordpress-3.5.1-zh_CN.tar.gz /*This website is the address of the latest Chinese version of wordpress*/

Tar zxvf wordpress-3.5.1-zh_CN.tar.gz If your zip package is zip, unzip wordpress-3.5.1-zh_CN.zip

Cp - a wordpress/*/home/www/rffan.info/* The home/www/rffan.info here can be replaced by your website*/

Chown - R www: www/home/www/rffan. info/* This sentence means to give nginx sufficient permissions */the folder must have sufficient permissions!

OK is OK, but if you don't want to use commands, you can look back at the use of winscp. I believe WINSCP is more suitable for the taste of children's paper playing linux vps for the first time.

For security reasons, it is recommended to block php errors, that is, display_errors=off in php. in

Let's create the database

Enter in the browser:

http://IP/phpmyadmin/

Of course, you can choose the language on the login page. If your English is good, then -- continue to use English. Ah Fu doesn't mind~

Then enter the user name: root password: ffan123456 

Maozi enters phpmyadmin, click the database above,

Then enter the name of the data to be created in the middle.

At this point, all the necessary preparations for creating a website are OK.

Then enter your web address in the browser (provided that you have resolved your domain name to your VPS in DNS) and install it according to the prompts~Good luck~

Useful twenty-one
  • 2013.11.16 It's my first time to meet you!

Waiting for your suggestions on this topic

Comment

Can also input two hundred and forty Characters

Hi, Welcome to join the Wordpress technical exchange group and take you to fly!

I want to join the group
Want to be here? contact us bar
 Wordpress acceleration

I will recommend A more powerful one for you to see?

  • Punk me