CentOS 6.4系统下编译安装LNMP、配置PHP环境

2023-08-09发布者:ylm大小: 下载:0

文件大小:

软件介绍

一、准备工作

上pkgs.org下载rmpforge。rpmforge是一个第三方yum源。

image.png


选择相应的版本下载安装。

// 安装成功后,清空yum list 并 重新获取
[root@pangou Desktop]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base extras rpmforge updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@pangou Desktop]# yum -y list
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
//  ......

卸载已存在的apache服务和php
 

[root@pangou Desktop]# yum remove httpd php*

安装development Tools 

[root@pangou Desktop]# yum -y groupinstall "Development Tools"

二、安装nginx

创建nginx目录,下载nginx,并解压缩

[root@pangou Downloads]# mkdir nginx
[root@pangou Downloads]# cd nginx/
[root@pangou nginx]# pwd
/root/Downloads/nginx
[root@pangou nginx]# wget http://nginx.org/download/nginx-1.4.0.tar.gz
--2013-04-30 23:13:44--  http://nginx.org/download/nginx-1.4.0.tar.gz
Resolving nginx.org... 206.251.255.63
Connecting to nginx.org|206.251.255.63|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 773451 (755K) [application/octet-stream]
Saving to: “nginx-1.4.0.tar.gz”

100%[============================================================================================================================>] 773,451      184K/s   in 4.5s    

2013-04-30 23:13:48 (166 KB/s) - “nginx-1.4.0.tar.gz” saved [773451/773451]

  [root@pangou nginx]# ls
  nginx-1.4.0.tar.gz
  [root@pangou nginx]# tar -zxvf nginx-1.4.0.tar.gz

  [root@pangou nginx]# ls
  nginx-1.4.0 nginx-1.4.0.tar.gz

编译安装nginx

// 编译  安装路径/opt/nginx
[root@pangou nginx-1.4.0]# ./configure --prefix=/opt/nginx/

编译中如出现报错如:

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

就是用yum自行结局依赖关系

[root@pangou nginx-1.4.0]# yum install pcre pcre-devel

然后重新上面的编译

// 编译  安装路径/opt/nginx
[root@pangou nginx-1.4.0]# ./configure --prefix=/opt/nginx/

// 编译成功后
[root@pangou nginx-1.4.0]# make && make install

// 最后安装完成

启动nginx服务

[root@pangou nginx]# cd /opt/nginx/sbin/
[root@pangou sbin]# ./nginx

访问127.0.0.1


发表评论(共0条评论)
请自觉遵守互联网相关政策法规,评论内容只代表网友观点,发表审核后显示!

版权声明:

1 本站所有资源(含游戏)均是软件作者、开发商投稿,任何涉及商业盈利目的均不得使用,否则产生的一切后果将由您自己承担!

2 本站将不对任何资源负法律责任,所有资源请在下载后24小时内删除。

3 若有关在线投稿、无法下载等问题,请与本站客服人员联系。

4 如侵犯了您的版权、商标等,请立刻联系我们并具体说明情况后,本站将尽快处理删除,联系QQ:2499894784

返回顶部