Install centos in vmwarevm and use lnmp to install and deploy the environment

Source: Internet
Author: User

I. Introduction: The question is a bit of a detour, which means to complete the process in two steps. First, install the centos system in the vmwarevm, and then install the project deployment environment using the lnmp installation package in the centos system.

Preparations(It is very important that if no correct software is required, how can the installation be successful)

1. Download VMware. Please refer to Baidu for "VMware download" and find the software to install.

2. Download centos. Pay attention to the following points:

If the system is 32-bit, click this: http://mirror.symnds.com/distributions/CentOS-vault/6.3/isos/i386/

If the system is 64-bit, click this: http://mirror.symnds.com/distributions/CentOS-vault/6.3/isos/x86_64/

Install the software in 32 bits. Click the link in the red box to download the software.

The first installation of livecd. ISO, the second installation of livedvd. ISO found that after entering the system, the new file, after restarting the virtual machine, the file is gone. Khan.

The third installation of bin-DVD1.iso, measured successfully.

II. Install centos.

After the basic software is downloaded, you can install it. If the software is downloaded correctly, it is not a problem to install it. If not, you can select the default one, find a suitable one. VMware just goes on to the next step.

Centos install a recommended Tutorial: http://jingyan.baidu.com/article/915fc414dec2da51384b205c.html

3. Configure the environment for lnmp Installation(TIPS: The red font is the place to enter and note. The black font is just descriptive text)

  1. Configure the firewall and enable port 80 and port 3306.

    VI/etc/sysconfig/iptables # edit the firewall configuration file

    -A input-M state -- state new-m tcp-p tcp -- dport 80-J accept (allow port 80 to pass through the firewall)

    -A input-M state -- state new-m tcp-p tcp -- dport 3306-J accept (allow port 3306 to pass the firewall)

    Note: many users add these two rules to the last line of the firewall configuration, causing firewall startup failure.

    The correct rule should be added to the default port 22 rule. After the rule is added, the firewall rules are as follows:

    #########################################################    # Firewall configuration written by system-config-firewall    # Manual customization of this file is not recommended.    *filter    :INPUT ACCEPT [0:0]    :FORWARD ACCEPT [0:0]    :OUTPUT ACCEPT [0:0]    -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT    -A INPUT -p icmp -j ACCEPT    -A INPUT -i lo -j ACCEPT    -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT    -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT    -A INPUT -j REJECT --reject-with icmp-host-prohibited    -A FORWARD -j REJECT --reject-with icmp-host-prohibited    COMMIT    #########################################################  

    /Etc/init. d/iptables restart # restart the firewall to make the configuration take effect.

  2. Disable SELinux

    VI/etc/SELinux/config # Edit

    # SELinux = enforcing # comment out this line

    # Selinuxtype = targeted # comment out this line

    SELinux = disabled # Add this line

    : WQ # Save and exit

    Shutdown-R now # restart the system

4. Install lnmpRecommended Tutorial: http://lnmp.org/install.html this website is good, is also a learning place, you can look at more.

First, download and install lnmp under Cd/usr/local/src.

The tutorial is based on VPs, so some steps are not necessary, mainly as follows:

Run the following command in centos:Wget-C http://soft.vpser.net/lnmp/lnmp1.1-full.tar.gz & tar zxf lnmp1.1-full.tar.gz & CD lnmp1.1-full &./centos. Sh

Upload package, & (then) enter the directory of this package, & (then) run the./centos. Sh method to install.

5. Now that the installation is complete, you can run it.

Htpp: // localhost/phpinfo. php (lnmp has created the phpinfo file by default .)

Sat. Introduction to folder content

Lnmp (nginx + MySQL + PHP and other folders) is installed by default)

Default web project deployment location

Install centos in vmwarevm and use lnmp to install and deploy the environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.