`

cygwin 安装nginx

阅读更多
//下载
wget http://nginx.org/download/nginx-1.7.6.tar.gz

tar -xzvf nginx-1.7.6.tar.gz
http://blog.csdn.net/dyllove98/article/details/8892509
//安装gcc
setup-x86_64.exe -q -P make
setup-x86_64.exe -q -P gcc-g++

//zlib
http://www.zlib.net/
[root@localhost mrms]# tar -zxvf zlib-1.2.7.tar.gz

[root@localhost mrms]# cd zlib-1.2.7

[root@localhost zlib-1.2.7]# ./configure 

[root@localhost zlib-1.2.7]# make

[root@localhost zlib-1.2.7]# make install

//pcre
http://www.pcre.org/
手动下载安装
[root@localhost mrms]# tar -zxvf pcre-8.21.tar.gz

[root@localhost mrms]# cd pcre-8.21

[root@localhost pcre-8.21]# ./configure 

[root@localhost pcre-8.21]# make

[root@localhost pcre-8.21]# make install

//http://www.openssl.org/source/


//安装
cd  nginx-1.7.6

$ ./configure --with-pcre=../pcre-8.36 --with-zlib=../zlib-1.2.8
checking for OS
 + CYGWIN_NT-6.1 1.7.32(0.274/5/3) x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.3 (GCC)
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... not found
checking for CYGWIN_NT-6.1 specific features
checking for nobody group ... not found
checking for nogroup group ... not found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... not found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... not found
checking for statvfs() ... found
checking for dlopen() ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... not found
checking for TCP_KEEPIDLE ... not found
checking for TCP_FASTOPEN ... not found
checking for TCP_INFO ... not found
checking for accept4() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... not found
checking for POSIX semaphores ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
checking for md5 in system md library ... not found
checking for md5 in system md5 library ... not found
checking for md5 in system OpenSSL crypto library ... not found
checking for sha1 in system md library ... not found
checking for sha1 in system OpenSSL crypto library ... not found
creating objs/Makefile

Configuration summary
  + using PCRE library: ../pcre-8.36
  + OpenSSL library is not used
  + using builtin md5 code
  + sha1 library is not found
  + using zlib library: ../zlib-1.2.8

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

[root@localhost nginx-1.2.6]# make && make install


出现crypy错误,看下面老外安装的过程
估计需要安装devel下面的包




3 - Installing Cygwin

Run setup.exe and hit "Next" 6 times (you want "Install from Internet", choose the mirror of your choice). You will arrive at a huge list of packages to choose from. Tip: you can maximize that window.

To select a package, click in the "New" column (it cycles through Skip, Keep, Uninstall, etc.). When a version number is displayed, it will be installed.

Select these additional packages (dependencies for these packages will be automatically selected):

Admin/cygrunsrv
Devel/autoconf
Devel/automake
Devel/bison
Devel/curl-devel
Devel/flex
Devel/gcc
Devel/libiconv
Devel/libmcrypt-devel
Devel/libtool
Devel/libxml2
Devel/libxml2-devel
Devel/make
Devel/patchutils
Devel/pcre
Devel/pcre-devel
Editors/vim
Libs/jpeg
Libs/libmcrypt

Then hit "Next" to install. Tip: you can run setup.exe anytime to add or remove packages.

NOTE: these packages are those I needed for my own Nginx, MySQL and PHP ./configure's options. If your ./configure's options differ from mine, you may need to select additional packages or your ./configure's will fail for missing dependencies.

--

Now that Cygwin is installed, run c:\cygwin\Cygwin.bat to get a shell Window. Your home directory (c:\cygwin\home\Administrator) will be created and prepared.

Copy the following files in c:\cygwin\home\Administrator:

nginx-0.6.32.tar.gz
mysql-5.0.67.tar.gz
php-5.2.6.tar.gz
php-5.2.6-fpm-0.5.8.diff.gz
getaddrinfo-1.6.3.tar.gz

4 - Installing Nginx under Cygwin

Open Cygwin and extract nginx-0.6.32.tar.gz:

cd
tar xvfz nginx-0.6.32.tar.gz
cd nginx-0.6.32

Now, configure Nginx:

./configure --with-http_ssl_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module

And finally, compile and install Nginx:

make
make install

--

Now we will prepare our "www" directory:

mkdir /www

As well as our Nginx configuration:

/usr/local/nginx/conf/nginx.conf:

worker_processes  5;



events {

  worker_connections  64; # VERY important. Do not leave 1024 there.

}



http {

  include       mime.types;

  default_type  application/octet-stream;



  sendfile        on;



  keepalive_timeout  65;



  server {

    listen       80;

    server_name  localhost;



    location / {

      root   /www;

      index  index.php index.html;

    }



    location ~ \.php$ {

      root   /www;



      fastcgi_pass   127.0.0.1:9000;

      fastcgi_index  index.php;

      fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

      include        fastcgi_params;

    }

  }

}


You may adjust this configuration file to suit your needs.
http://www.softwareprojects.com/resources/programming/t-how-to-install-nginx-php-php-fpm-and-mysql-under-1616.html


配置文件

/usr/local/nginx/conf/nginx.conf

启动命令
/usr/local/nginx/sbin/nginx


   2008/01/12 16:34:56 [emerg] 2496#0: the maximum number of files supported by select() is 64的错误提示,这表示FD_SETSIZE的值比nginx配置文件中worker_connections指令所指定的值,你可以把nginx.conf里的worker_connections选项改小一些,比如44,加了--with-cc-opt=”-D FD_SETSIZE=4096”后就不会碰到这问题
分享到:
评论

相关推荐

    nginx-1.3.13

    nginx的Windows版本使用原生Win32 API(非Cygwin模拟层)。当前nginx/Windows只使用select作为通知方法,所以不要期待它有很高的性能和扩展性。鉴于这点和一些已知问题,nginx/Windows目前还处于beta阶段。nginx/...

    Cygwin 2.873

    Cygwin 2.873的安装过程通常是通过Cygwin的setup程序完成的,这是一个图形化的安装管理器,允许用户选择需要安装的软件包。这些软件包涵盖了各种类别,包括开发工具、系统工具、网络工具等,覆盖了几乎所有的Unix/...

    nginx windows usage(翻译).pdf

    - **使用原生Win32 API**:Nginx Windows版使用的是原生的Win32 API,而非通过Cygwin之类的模拟层实现。这意味着Nginx能够更紧密地与Windows操作系统交互,从而获得更好的兼容性和性能优化。 - **select方法作为...

    RVM_Ruby1.9.3_Rails3(2-Ruby on Rails3安装配置)

    本文将详细介绍如何在 Windows 7 环境下通过 Cygwin 安装和配置 Ruby on Rails 3,包括必要的依赖库如 Git、RVM、Ruby 1.9.3、Rails 3、MongoDB、Nginx、Unicorn、RSpec、Guard 和 Spork 等。通过这些步骤,您可以...

    Nginx RTMP服务器(Windows)搭建和测试说明.zip

    在Windows上,可以使用Cygwin或者MSYS2等环境来编译Nginx。你需要安装必要的编译工具(如make、gcc等),然后按照以下步骤操作: - 解压Nginx源码并进入目录。 - 配置Nginx编译选项,包括添加RTMP模块。例如:`./...

    engine 2.3.2 cygwin 编译,包含所有模块, 修正源码中很多在windows上编译报错的问题

    在Cygwin环境下,开发者需要确保所有依赖项都已安装,并且源码中的路径和系统调用适应于Cygwin的环境。例如,可能需要将源码中的绝对路径改为相对路径,或者替换某些特定于Unix的系统调用。 “tengine-2.3.2_win64_...

    tengine-2.3.2_win64.rar

    标签 "tengine-2.3.2 nginx cygwin" 进一步指明了主要的技术元素:Tengine 的版本号,Nginx(因为 Tengine 是基于 Nginx 的),以及编译环境 Cygwin。 压缩包内的文件名列表揭示了 Tengine 运行所需的动态链接库...

    PDENV v1.4.0

    PDENV(PHP Developer Environment)是一个帮助PHP开发/运维人员快速搭建高性能Nginx/PHP/MongoDB/MySQL/Memcached调试(生产)环境的安装套件。主要特点:用Nginx取代Apache, 性能优于Apache,占用更少的内存和CPU资源 ...

    tengine-2.3.2 for windows full modules

    Tengine是一款基于Nginx的高性能Web服务器和反向代理服务器,由淘宝网发起并维护。这个名为“tengine-2.3.2 for windows full modules”的版本是专为Windows平台设计的,它包含了所有可用的模块,这使得它能够支持更...

    vagrant-lemp, 使用 trusty64,php5,mysql和 Nginx 进行简单的Vagrant设置.zip

    vagrant-lemp, 使用 trusty64,php5,mysql和 Nginx 进行简单的Vagrant设置 vagrant简介这个项目自动...要求CYGWIN 或者任何其他可以用于 vagrant ssh 命令的ssh终端 shell如何构建虚拟机构建虚拟机很简单:host $ git

    Shell脚本实现检测Cygwin最快的镜像站点

    这篇文章主要讲解如何使用Shell脚本来检测Cygwin的最快镜像站点,这个脚本的原理同样适用于其他开源软件如apache和nginx。通过自动化的方式,你可以更有效地找到最适合自己下载的镜像源,从而提高下载速度。 首先,...

    Tengine for windows

    Tengine web server for windows ,兼容nginx Tengine 使用cygwin编译适用于windows x64,编译了健康检查模块,health check check interval=3000 rise=2 fall=2 timeout=1000 type=http; check_...

    ngwsx-0.8.36

    1) native porting of nginx on windows. 2) single process mode. 3) windows service supported. 4) iocp event method. 5) file aio. 6) zlib-1.2.3. (statically link) 7) pcre-7.9. (statically link) 8) using...

    Zend_Studio配置调试教程

    - 首先,下载与PHP版本匹配的Zend Debugger,如`ZendDebugger-5.2.14-cygwin_nt-i386.zip`。 - 解压文件,找到对应的`ZendDebugger.dll`(Windows)或`ZendDebugger.so`(Linux)文件。 - 将`ZendDebugger.dll`...

    279个开箱即用的shell脚本(new)2024年新版

    - **邮件工具安装:** `yum install mailx` 安装邮件工具。 - **配置邮件:** 编辑`/etc/mail.rc`文件设置发件人邮箱、SMTP服务器等参数。 - **条件判断:** 判断某个IP是否已经在iptables规则中存在。 - **邮件发送:**...

    ZendDebugger for php5.2.x

    5. **重启Web服务器**:如Apache或Nginx,使配置生效。 **三、使用IDE集成** 1. **Eclipse PDT**:Eclipse的PHP开发工具,支持直接集成`Zend Debugger`,提供丰富的调试功能。 2. **NetBeans**:另一款流行的...

    libgd-2.2.5.7z

    libgd for windows 单文件版本,包含libgd,zlib,png,jpeg,webp源码, 以及x64编译后的动态库文件,工程使用vs2010,全静态链接编译,在nginx,tengine for cygwin 编译时用到,可直接替换cygwin下的 libdg-3.dll, 可省...

    bugzilla用户指导

    3. **Web服务器**:通常推荐使用Apache或Nginx作为Web服务器。 4. **Bugzilla**:下载并解压Bugzilla软件包到指定目录。 5. **Perl模块**: - **DBD::mysql**:用于连接MySQL数据库的Perl驱动程序。 - **...

    OpenSA:资产管理,资产采集,灰色发布,反向代理,批量任务,任务编排,计划任务,日志审计,权限管理,角色管理,部门管理,运维自动化

    生产环境请使用nginx + uwsgi,不对公网开放,或者使用SSL双向认证 命令和文件分发基于SSH协议,支持Linux / Windows(cygwin)|支持快速修改为ansible 使用2.7版本inspina模版 支持国际化(默认中/英),有些细节未...

    java版sm4源码-zhongyin.github.io:中银.github.io

    Cygwin 的 Windows) —— :rocket: 最快的 WebAssembly 解释器,以及最通用的运行时 - Wt, C++ Web 工具包 - 事后之见 - 轻量级数据处理骨架 - 为物联网 (IoT) 设计和优化的开源大数据平台。 - 具有一些高级功能的 ...

Global site tag (gtag.js) - Google Analytics