CentOS 6.4 install nginx + php + mysql with yum

Source: Internet
Author: User

It may be difficult to install nginx in source code. Therefore, a simple yum installation method is recommended.
Add new source
[Root @ localhost ~] # Wget http://www.atomicorp.com/installers/atomic
[Root @ localhost ~] # Sh./atomic
Atomic Archive installer, version 2.0.9

BY INSTALLING THIS SOFTWARE AND BY USING ANY AND ALL SOFTWARE
Provided by atomicorp limited you acknowledge and agree:

THIS SOFTWARE AND ALL SOFTWARE PROVIDED IN THIS REPOSITORY IS
Provided by atomicorp limited as is, IS UNSUPPORTED AND ANY
Express or implied warranties, INCLUDING, but not limited to,
Implied warranties of merchantability and fitness for a participant
Purpose are disclaimed. in no event shall atomicorp limited,
COPYRIGHT OWNER OR ANY CONTRIBUTOR TO ANY AND ALL SOFTWARE PROVIDED
By or published in this repository be liable for any direct,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, but not limited to, PROCUREMENT OF SUBSTITUTE GOODS
Or services; loss of use, DATA, or profits; or business interruption)
However caused and on any theory of liability, whether in contract,
Strict liability, or tort (including negligence or otherwise)
Arising in any way out of the use of this software, EVEN IF ADVISED
Of the possibility of such damage.

Do you agree to these terms? (Yes/no) [Default: yes] yes
Copying ing the [atomic] yum archive for this system

Installing the Atomic GPG key: OK
Downloading atomic-release-1.0-16.el6.art.noarch.rpm: OK



The Atomic Rocket Turtle archive has now been installed and configured for your system
The following channels are available:
Atomic-[ACTIVATED]-contains the stable tree of ART packages
Atomic-testing-[DISABLED]-contains the testing tree of ART packages
Atomic-bleeding-[DISABLED]-contains the development tree of ART packages


[Root @ localhost ~] # Yum check-update
[Root @ localhost ~] # Yum-y install nginx mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php -pear php-pecl-memcache php-eaccelerator

Add nginx default homepage index. php
[Root @ localhost ~] # Vim/etc/nginx/conf. d/default. conf

Location /{
Root/usr/share/nginx/html;
Index index.html index.htm index. php;
}

Configure nginx to support php
[Root @ localhost ~] # Vim/etc/nginx/conf. d/default. conf

# Pass the PHP scripts to FastCGI server listening on Fig: 9000
#
Location ~ \. Php $ {
Root/usr/share/nginx/html;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME/$ document_root $ fastcgi_script_name;
Include fastcgi_params;
}
Configure php-fpm
[Root @ localhost ~] # Vim/etc/php-fpm.d/www. conf

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; Will be used.
; RPM: apache Choosed to be able to access some dir as httpd
User = nginx
; RPM: Keep a group allowed to write in log dir.
Group = nginx

Start mysql
[Root @ localhost ~] # Service mysqld start
Initialize the MySQL database: Installing MySQL system tables...
130324 14:00:01 [Note] libgovernor. so not found
OK
Filling help tables...
130324 14:00:13 [Note] libgovernor. so not found
OK

To start mysqld at boot time you have to copy
Support-files/mysql. server to the right place for your system

Please remember to set a password for the MySQL root USER!
To do so, start the server, then issue the following commands:

/Usr/bin/mysqladmin-u root password 'new-password'
/Usr/bin/mysqladmin-u root-h localhost. localdomain password 'new-password'

Alternatively you can run:
/Usr/bin/mysql_secure_installation

Which will also give you the option of removing the test
Databases and anonymous user created by default. This is
Stronugly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon:
Cd/usr;/usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
Mysql-test-run.pl for cd/usr/mysql-test; perl

Please report any problems with the/usr/bin/mysqlbug script!

[OK]
Starting mysqld: [OK]
[Root @ localhost ~] # Service nginx start
Starting nginx: [OK]
[Root @ localhost ~] #/Etc/rc. d/init. d/php-fpm start
Starting php-fpm: [OK]

Enter http: // ip/index. php In the browser

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.