Install lnmp in centos

Source: Internet
Author: User

Method 1: one-click installation of http://lnmp.org/

Method 2: Install yum

Preparation:

1. configure the firewall and enable port 80 and port 3306.
VI/etc/sysconfig/iptables
-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, which causes firewall startup failure. The correct rule should be added to the default port 22.
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.

Note: If the iptables file cannot be found, run iptables-A input-M state -- state new-m tcp-p tcp -- dport 80-J accept first.

Then:After the service iptables save is saved, restart to have the iptables file.


2. Disable SELinux
VI/etc/SELinux/config
# SELinux = enforcing # comment out
# Selinuxtype = targeted # comment out
SELinux = disabled # Add
: WQ save, close
Shutdown-R now # restart the system

Note: Why is it disabled? Because the security is too high, it is generally difficult to control

Installation:

1. Install nginx
Yum install nginx # Install nginx. Enter y as prompted to install nginx.
Service nginx start # Start
Chkconfig nginx on # Set to boot
/Etc/init. d/nginx restart # restart
Rm-RF/usr/share/nginx/html/* # Delete the default ngin test page


Http://blog.csdn.net/ltx851201/article/details/7893295

To be continued


Install lnmp in centos

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.