Heim  >  Artikel  >  Backend-Entwicklung  >  nginx 源码包安装 nginx rewrite nginx php nginx.conf在哪

nginx 源码包安装 nginx rewrite nginx php nginx.conf在哪

WBOY
WBOYOriginal
2016-07-29 08:51:161122Durchsuche

首先上 http://nginx.org/download/ 这里面下载一个自己需要的nginx 版本包。使用wget 下载

如果需要重定向安装对应的包

yum -y install pcre*<pre name="code" class="plain">wget http://nginx.org/download/nginx-1.7.8.tar.gz

下载完成后开始解压对应的包

tar -zxvf nginx-1.7.8.tar.gz

  1. 解压完成后 使用 cd切换到对应的源码目录
  2. 运行
  3. ./configure --prefix=/usr/local/nginx \
    --with-http_ssl_module 
    --with-http_stub_status_module --with-pcre

    如果没有报错直接运行 make && make install 
    cd /usr/local/nginx/sbin
    ./nginx 启动对应的nginx服务

    启动成功后使用浏览器访问对应ip就可以了。
  4. 如果访问不了请关闭服务器的防火墙或添加80端口映射

以上就介绍了nginx 源码包安装,包括了nginx方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn