月度归档:2014年03月

阿里云 php php-fpm mysql nginx apc

vi /etc/yum.repos.d/nginx.repo

[root@w1 ~]# vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

[root@w1 ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.esocc.com
 * extras: mirror.esocc.com
 * updates: mirror.esocc.com
nginx                                                    | 2.9 kB     00:00
nginx/primary_db                                         |  28 kB     00:00
Setting up Update Process
No Packages marked for Update
[root@w1 ~]# yum list|grep nginx
nginx.x86_64                              1.4.7-1.el6.ngx               nginx
nginx-debug.x86_64                        1.4.7-1.el6.ngx               nginx
[root@w1 ~]#
[root@w1 ~]# yum install nginx
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.esocc.com
 * extras: mirror.esocc.com
 * updates: mirror.esocc.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:1.4.7-1.el6.ngx will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch            Version                    Repository      Size
================================================================================
Installing:
 nginx          x86_64          1.4.7-1.el6.ngx            nginx          312 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 312 k
Installed size: 771 k
Is this ok [y/N]: y
Downloading Packages:
nginx-1.4.7-1.el6.ngx.x86_64.rpm                         | 312 kB     00:10
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : nginx-1.4.7-1.el6.ngx.x86_64                                 1/1
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* http://nginx.org/en/docs/

Commercial subscriptions for nginx are available on:
* http://nginx.com/products/

----------------------------------------------------------------------
  Verifying  : nginx-1.4.7-1.el6.ngx.x86_64                                 1/1

Installed:
  nginx.x86_64 0:1.4.7-1.el6.ngx

Complete!
[root@w1 ~]#
[root@w1 ~]# service nginx status
nginx is stopped
[root@w1 ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@w1 ~]# service nginx start
Starting nginx:                                            [  OK  ]
[root@w1 ~]#
[root@w1 nginx]# yum install php-fpm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.esocc.com
 * extras: mirror.esocc.com
 * updates: mirror.esocc.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-fpm.x86_64 0:5.3.3-27.el6_5 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5 for package: php-fpm-5.3.3-27.el6_5.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.3-27.el6_5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch           Version                Repository       Size
================================================================================
Installing:
 php-fpm            x86_64         5.3.3-27.el6_5         updates         1.1 M
Installing for dependencies:
 php-common         x86_64         5.3.3-27.el6_5         updates         525 k

Transaction Summary
================================================================================
Install       2 Package(s)

Total download size: 1.7 M
Installed size: 6.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): php-common-5.3.3-27.el6_5.x86_64.rpm              | 525 kB     00:00
(2/2): php-fpm-5.3.3-27.el6_5.x86_64.rpm                 | 1.1 MB     00:00
--------------------------------------------------------------------------------
Total                                           5.1 MB/s | 1.7 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-common-5.3.3-27.el6_5.x86_64                             1/2
  Installing : php-fpm-5.3.3-27.el6_5.x86_64                                2/2
  Verifying  : php-fpm-5.3.3-27.el6_5.x86_64                                1/2
  Verifying  : php-common-5.3.3-27.el6_5.x86_64                             2/2

Installed:
  php-fpm.x86_64 0:5.3.3-27.el6_5

Dependency Installed:
  php-common.x86_64 0:5.3.3-27.el6_5

Complete!
[root@w1 nginx]#
[root@w1 nginx]# service php-fpm status
php-fpm is stopped
[root@w1 nginx]# service php-fpm start
Starting php-fpm:                                          [  OK  ]
[root@w1 nginx]#

[root@w1 php-fpm]# yum install php-pecl-apc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.esocc.com
 * extras: mirror.esocc.com
 * updates: mirror.esocc.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-apc.x86_64 0:3.1.9-2.el6 will be installed
--> Processing Dependency: /usr/bin/pecl for package: php-pecl-apc-3.1.9-2.el6.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php-pecl-apc-3.1.9-2.el6.x86_64
--> Running transaction check
---> Package php-pear.noarch 1:1.9.4-4.el6 will be installed
--> Processing Dependency: php-cli >= 5.1.0-1 for package: 1:php-pear-1.9.4-4.el6.noarch
--> Running transaction check
---> Package php-cli.x86_64 0:5.3.3-27.el6_5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch          Version                 Repository      Size
================================================================================
Installing:
 php-pecl-apc        x86_64        3.1.9-2.el6             base            96 k
Installing for dependencies:
 php-cli             x86_64        5.3.3-27.el6_5          updates        2.2 M
 php-pear            noarch        1:1.9.4-4.el6           base           393 k

Transaction Summary
================================================================================
Install       3 Package(s)

Total download size: 2.7 M
Installed size: 8.7 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): php-cli-5.3.3-27.el6_5.x86_64.rpm                 | 2.2 MB     00:00
(2/3): php-pear-1.9.4-4.el6.noarch.rpm                   | 393 kB     00:00
(3/3): php-pecl-apc-3.1.9-2.el6.x86_64.rpm               |  96 kB     00:00
--------------------------------------------------------------------------------
Total                                           4.8 MB/s | 2.7 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-cli-5.3.3-27.el6_5.x86_64                                1/3
  Installing : 1:php-pear-1.9.4-4.el6.noarch                                2/3
  Installing : php-pecl-apc-3.1.9-2.el6.x86_64                              3/3
  Verifying  : php-pecl-apc-3.1.9-2.el6.x86_64                              1/3
  Verifying  : 1:php-pear-1.9.4-4.el6.noarch                                2/3
  Verifying  : php-cli-5.3.3-27.el6_5.x86_64                                3/3

Installed:
  php-pecl-apc.x86_64 0:3.1.9-2.el6

Dependency Installed:
  php-cli.x86_64 0:5.3.3-27.el6_5         php-pear.noarch 1:1.9.4-4.el6

Complete!
[root@w1 php-fpm]#

aliyun 主机修改hostname

1. modify /etc/hosts
[root@AY14032111447fdZ ~]# more /etc/hosts
127.0.0.1 localhost
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
#10.162.90.107 AY14032111447fdZ
10.162.90.107 w1.newhost.com

2.修改/etc/sysconfig/network的hostname一行。
[root@AY14032111447fdZ ~]# vi /etc/sysconfig/network
[root@AY14032111447fdZ ~]# more /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=w1.newhost.com
GATEWAY=218.244.142.242

3. 运行hostname命令
[root@AY14032111447fdZ ~]# hostname w1.newhost.com

4.重新登陆,已经改过来了
[louis@w1 ~]$ hostname
w1.newhost.com
[louis@w1 ~]$ hostname -s
w1