-
nginx源码安装安装环境:操作系统:Ubuntu 12.04Nginx: V1.4.2PCRE: V8.33zlib: V1.2.8下载上述源包到当前用户主目录(本机:/home/tdtc100)。1. 安装zlib(1)解压缩[plain]tdtc100@ubuntu:~$ tar zxvf zlib-1.2.8.tar.gz(2)安装[plain]tdtc100@ubuntu:~$ cd zlib-1.2.8tdtc100@ubuntu:~/zlib-1.2.8$ ./configuretdtc100@ubuntu:~/zlib-1.2.8$ maketdtc100@ubuntu:~/zlib-1.2.8$ sudo make install2. 安装PCRE(1) 安装依赖包c++[plain]sudo apt-get install build-essential注:如果不安装,在进行(3)时,会出现:[plain]configure: error: You need a C++ compiler for C++ support.(2)解压缩[plain]tdtc100@ubuntu:~$ tar zxvf pcre-8.33.tar.gz(3)安装[plain]tdtc100@ubuntu:~$ cd pcre-8.33tdtc100@ubuntu:~/pcre-8.33$ ./configuretdtc100@ubuntu:~/pcre-8.33$ maketdtc100@ubuntu:~/pcre-8.33$ sudo make install3. 安装nginx(1)安装依赖包open-ssl library[plain]sudo apt-get install libcurl4-openssl-dev注:如果不安装,在进行(3)时,会出现:[plain]./configure: error: SSL modules require the OpenSSL library.You can either do not enable the modules, or install the OpenSSL libraryinto the system, or build the OpenSSL library statically from the sourcewith nginx by using --with-openssl=<path> option.(2)解压缩[plain]tdtc100@ubuntu:~$ tar zxvf nginx-1.4.2.tar.gz(3)安装参考官方文档[plain]tdtc100@ubuntu:~$ cd nginx-1.4.2tdtc100@ubuntu:~/nginx-1.4.2$ ./configure \> --sbin-path=/usr/local/nginx/nginx \> --conf-path=/usr/local/nginx/nginx.conf \> --pid-path=/usr/local/nginx/nginx.pid \> --with-http_ssl_module \> --with-pcre=../pcre-8.33 \> --with-zlib=../zlib-1.1.3tdtc100@ubuntu:~/nginx-1.4.2$ maketdtc100@ubuntu:~/nginx-1.4.2$ sudo make install-------------------------安装完毕-----------------------xiaobin_hlj80-------------------------------------------运行:[plain]tdtc100@ubuntu:/usr/local/nginx$ sudo ./nginx运行效果:
nginx源码安装
最新推荐文章于 2025-05-14 09:08:10 发布