nginx安装到指定位置

206 阅读1分钟

cd /usr/local #下载解压 wget nginx.org/download/ng… tar -zxvf nginx-1.4.2.tar.gz

注意:这只是源码

cd nginx-1.4.2

设置常量

./configure
--prefix=/自定义位置/
--sbin-path=/自定义位置/nginx
--conf-path=/自定义位置/nginx.conf
--pid-path=/自定义位置/nginx.pid
--with-http_ssl_module
--with-pcre=/usr/local/pcre-8.38 \ # 刚刚安装的 pcre 的位置 --with-zlib=/usr/local/zlib-1.2.11 \ # 刚刚安装的 zlib 的位置 --with-openssl=/usr/local/openssl-1.0.1t #刚刚安装的 openssl 的位置

编译

make && make install

重要:如果不执行则不会创建真正的 nginx 文件

test -d