安装 nginx 首先要有 gcc 的支持
详细看 http://blog.sina.com.cn/s/blog_538defc30100n4ll.html
--------------------------------------------------
这里一定要注意:
上面的链接中的服务器的系统的版本是
SunOS solaris10 5.10 Generic_137138-09 i86pc i386 i86pc
我本机的版本
SunOS PORTAL1 5.10 Generic_147147-26 sun4v sparc sun4v
通过 uname -a 进行查看
所以我去下了
gcc-3.4.6-sol10-sparc-local.gz(这个要跟系统对应 )
发现报
gcc -v报错:ld.so.1: gcc: fatal: libiconv.so.2: open failed: Nosuch file or directory
又去下了libiconv-1.9.2-sol10-sparc-local.gz
安装完成后就可以了。
总之如果没有gcc 先按上面的 文档链接进行 安装,要注意自己系统的版本就对了。
---------------------------------------------------
接下来就是 nginx 的安装
我下来两个包
pcre-8.10.tar.gz
nginx-1.4.1.tar.gz
先安装 pcre-8.10
gunzip pcre-8.10.tar.gz
tar -xvf pcre-8.10.tar
cd pcre-8.10
./configure
make
make install
再安装 nginx
./configure --prefix=/opt/wlan/nginx/soft/nginx(我nginx 安装的目录,你自己指定) --with-pcre=/opt/wlan/nginx/pcre-8.10(我pcre 的安装目录) --with-http_stub_status_module --with-cc=/usr/local/bin/gcc
--with-cc=/usr/local/bin/gcc 这里很重要。我不写成这样的话,安装就报错了。我在centOs ,rehat上不加这句是没有问题的,solaris 上这个不加不行,
具体的原因不了解,请高手解释。
之后
make
make install
安装成功后
到
cd /opt/wlan/nginx/soft/nginx/sbin
./nginx -t
显示
nginx: the configuration file /opt/wlan/nginx/soft/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/wlan/nginx/soft/nginx/conf/nginx.conf test is successful
说明安装成功了
启动是
./nginx
之后访问服务器的ip 地址可以看到
欢迎页面(nginx 默认80)
关闭
./ngins -s stop