installation, configuration of LNMP

Source: Internet
Author: User
Tags snmp openldap

First, the local installation of the virtual machine, installed on the virtual machine centos6.5, due to the habit of the problem, do not like to operate the Linux system directly on the virtual machine, accustomed to SSH in the past, directly with the Xshell operation, which is completely personal habits problem;

1, with Xshell through SSH connection up, to note that the current virtual machine installed system installed SSH; can be viewed by command: RPM-QA | grep ssh;

2, if not installed: Use the command yum install SSH installation (Note that this may be the root permission)

3. Start ssh: Command service sshd start; Restart (Service sshd restart)

4, if you want to set up boot ssh, you can use the command: Chkconfig sshd on

5, if still not even up, it may be the problem of the system firewall, shut down the firewall: service iptables stop, normal should be able to connect up.

Second, in order to prevent problems in the construction process, it is recommended to update GCC, gcc++ and yum Update, because here with Yum installation:

1. Install the package and Library files command: yum-y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libx ML2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel gd* bzip2 bzip2-devel ncurses ncurses-devel net-snmp -devel Curl Curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel OpenSSL openssl-devel openldap openld Ap-devel nss_ldap openldap-clients openldap-servers libmcrypt libmcrypt-devel

2. Update Yum command: YUM-Y update

Third, check whether Apache, MySQL, PHP installed, if installed to uninstall them all:

1. See if APACHE:RPM–QA is installed | grep httpd

2. See if MYSQL:RPM–QA is installed | grep MySQL

3. See if PHP:RPM–QA is installed | grep php

4, uninstall APACHE:RPM-E httpd--nodeps

5. Uninstall MYSQL:RPM-E MySQL--nodeps

6, uninstall Php:rpm-e php–nodeps

Iv. Installation and Construction LNMP

1, installation Nginx:yum install Nginx, after installation can start Nginx:service nginx start; set on start: Chkconfig–levels 235 nginx on (set 2, 3, 5-stage boot)

Note: If prompted: No package Nginx available. Workaround:

Installing Epel (Extra Packages for Enterprise Linux)

A, go to Epel website Http://fedoraproject.org/wiki/EPEL download

b, my system is centos5.7,cpu is x86_64, so I downloaded is wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

If it is CENTOS6, you should download wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

C, installation Epel

RPM-IVH epel-release-5-4.noarch.rpm

Run the Yum install again, it will prompt the installation to succeed

The installation of the Epel is related to the CentOS system version, the CPU hardware architecture,

View the system version (LSB-RELEASE-A),

View CPU hardware architecture (ARCH)

Epel It is Rhel's Fedora software repository that provides high-quality software packages for Rhel and derivative distributions such as CentOS, scientific Linux, and more. Loaded with EPEL, just like in Fedora, you can install the software by using Yum install Package-name.

2, installation mysql:yum install MySQL mysql-server mysql-devel; start Mysql:service mysqld start; set boot start: Chkconfig–levels 235 mysqld on ; set MySQL account password: mysqladmin–u root password ' password '

3, installation Php:yum install PHP lighttpd-fastcgi php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc Php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy php-common php-devel php-fpm
Install PHP and the required components to enable PHP to support MySQL, fastcgi mode

Install FPM (fastcgi process Manager) and Mod_fastcig module: yuminstall php php-fpm mod_fastcgi

Start PHP-FPM process: Service PHP-FPM start

Set boot up: Chkconfig--levels 235 php-fpm on

Five, configure Nginx support PHP

1. Change the configuration file to backup file

Mv/etc/nginx/nginx.conf/etc/nginx/nginx.confbak

2, because the original configuration file to write their own so you can use the default configuration file as a configuration file

Cp/etc/nginx/nginx.conf.default/etc/nginx/nginx.conf

3, modify Nginx configuration file, add fastcgi support

Index index.php index.html index.htm;
Join index.php
Location ~ \.php$ {
root/usr/share/nginx/html;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param Script_filename/usr/share/nginx/html$fastcgi_script_name;
Include Fastcgi_params;
}
Remove the above code comments and modify the default path to Nginx

4, configure PHP, edit the php.ini file, add cig.fix_pathinfo= at the end of the file 1

5. Restart Nginx

Service Nginx Restart

6. Restart PHP-FPM

Service PHP-FPM Restart

VI. Create a new test.php file to test if nginx resolves PHP

1, vim/usr/share/nginx/html/test.php

<?php phpinfo ();?>

2. Access the file via URL: http://192.168.17.129/test.php

Success!

installation, configuration of LNMP

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.