centos 6.7 安装软件

设置固定ip
http://jingyan.baidu.com/article/455a99508be7cda167277865.html

centos6.7  nginx 1.8.0

1. nginx 安装

添加 nginx操作用户 useradd www
参见 http://blog.csdn.net/yuanchao99/article/details/46357173
手动安装 GEOip http://www.vpsee.com/2011/03/install-nginx-with-geoip-module-for-country-targeting/


    ./configure: error: C compiler cc is not found
    yum install gcc gcc-c++ ncurses-devel perl

yum install zlib-devel.x86_64
# wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
# tar -zxvf GeoIP.tar.gz
# cd GeoIP-1.4.6
# ./configure
# make; make install

# echo '/usr/local/lib' > /etc/ld.so.conf.d/geoip.conf
# ldconfig

下载 IP 数据库

MaxMind 提供了免费的 IP 地域数据库,这个数据库是二进制的,不能用文本编辑器打开,需要上面的 GeoIP 库来读取:

# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
# gunzip GeoIP.dat.gz


配置 Nginx

最后是配置 nginx,在相关地方加上如下的配置就可以了:

# vi /etc/nginx/nginx.conf

http {
...
geoip_country /home/vpsee/GeoIP.dat;
fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;
fastcgi_param GEOIP_COUNTRY_CODE3 $geoip_country_code3;
fastcgi_param GEOIP_COUNTRY_NAME $geoip_country_name;
...
}

server {
...
        location / {
            root   /home/vpsee/www;
            if ($geoip_country_code = CN) {
                root /home/vpsee/cn;
            }
            ...
        }
...
}

这样,当来自中国的 IP 访问网站后就自动访问到预定的 /home/vpsee/cn 页面。关于 Nginx + GeoIP 还有很多有用的用法,比如做个

简单的 CDN,来自中国的访问自动解析到国内服务器、来自美国的访问自动转向到美国服务器等。MaxMind 还提供了全球各个城市的 IP

信息,还可以下载城市 IP 数据库来针对不同城市做处理。


./configure: error: libatomic_ops library was not found. 问题 安装 yum install libatomic_ops-devel.x86_64

 5、如果安装出现在下面的错误是缺少编译环境。安装编译源码所需的工具和库

 

以上都执行后再执行 安装脚本

    #!/bin/bash 
     
    user=www          # change to user who run nginx 
    dir_prefix=/data/nginx       # change to your prefered install dir 
    script_path=`readlink -f $0` 
    script_dir=`dirname $script_path` 
    opath=`pwd` 
     
    yum install -y gd-devel pcre-devel libgcrypt-devel libxml2-devel libxslt-devel
     
    tar zxvf $script_dir/zlib-1.2.8.tar.gz -C $script_dir 
    tar zxvf $script_dir/openssl-1.0.1m.tar.gz -C $script_dir 
    tar zxvf $script_dir/nginx-1.8.0.tar.gz -C $script_dir 
     
    cd $script_dir/nginx-1.8.0 
    ./configure --prefix=$dir_prefix --user=$user --group=$user --http-log-path=$dir_prefix/log/access.log --error-log-

path=$dir_prefix/log/error.log --pid-path=$dir_prefix/pid/nginx.pid --lock-path=$dir_prefix/lock/nginx.lock --with-

http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_xslt_module --with-

http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module

--with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-

http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module

--with-pcre --with-libatomic --with-zlib=$script_dir/zlib-1.2.8 --with-openssl=$script_dir/openssl-1.0.1m 
     
    make 
     
    make install 
     
    mkdir -p $dir_prefix/sites-enabled 
    mkdir -p $dir_prefix/lock 
     
    \cp -f $script_dir/etc.initd.nginx-$user /etc/init.d/nginx-$user 
    \cp -f $script_dir/conf.nginx.conf $dir_prefix/conf/nginx.conf 
    \cp -f $script_dir/sites-enabled.$user.conf $dir_prefix/sites-enabled/$user.conf 
     
    chown -R $user: $dir_prefix 
     
    service nginx-$user start 
    chkconfig nginx-$user on 
     
    rm -Rf $script_dir/zlib-1.2.8 
    rm -Rf $script_dir/openssl-1.0.1m 
    rm -Rf $script_dir/nginx-1.8.0 
 cd $opath 


安装redis  http://blog.csdn.net/ludonqin/article/details/47211109

卸载jdk http://linux.it.net.cn/CentOS/server/set/2014/1006/6242.html

安装jdk http://www.cnblogs.com/kenshinobiy/p/4747888.html

安装resin http://blog.csdn.net/liuxiao723846/article/details/50781025

安装mysql http://blog.csdn.net/wendi_0506/article/details/39478369  不需要 -DENABLE_DOWNLOADS=1  参数

安装ImageMagick http://blog.csdn.net/gycsjz/article/details/42707981

yum install libjpeg libjpeg-devel libpng libpng-devel libtiff libtiff-devel

解压安装包后查看执行

./configure

留意 DELEGATES 刚开始的时候并没有 jpeg, yum install 后出现 支持jpeg、png、tiff。

然后

make 

make install

猜你喜欢

转载自hyl198611.iteye.com/blog/2335082