`
flyingdutchman
  • 浏览: 353656 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

CentsOS 6.4 安装Maven私人仓库Nexus

阅读更多
       在本章中,我们将来学习如何在linux下安装并配置Maven私人仓库Nexus。

       第一步,下载并解压tar文件:
引用

       # wget http://download.sonatype.com/nexus/oss/nexus-2.5.1-01-bundle.tar.gz
       # chmod +x nexus-2.5.1-01-bundle.tar.gz
       # cp -rf nexus-2.5.1-01 /opt
       # mv nexus-2.5.1-01 nexus

      

     
       第二步,配置:
引用

       # cd  /etc/init.d
       # cp /opt/nexus/bin/jsw/linux-x86-64/nexus nexus
       # vi /etc/init.d/nexus

    
         //编辑/etc/init.d/nexus文件,添加以下变量定义
         NEXUS_HOME=/opt/nexus
         PLATFORM=linux-x86-64
         PLATFORM_DIR="${NEXUS_HOME}/bin/jsw/${PLATFORM}"
         //修改以下变量
         WRAPPER_CMD="${PLATFORM_DIR}/wrapper"
         WRAPPER_CONF="${PLATFORM_DIR}/../conf/wrapper.conf"
         PIDDIR="${NEXUS_HOME}"
         RUN_AS_USER=root  //以root身份启动

      

       配置如下:

       第三步,将nexus配置为启动服务并启动:
引用

       # chkconfig --add nexus
       # chkconfig --add nexus
       # service nexus start

      

       OK,到这里nexus就配置成功了,以admin/admin123账户登录,页面显示如下:


       下面贴一个完整的内核优化设置:
引用
vi /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.ip_local_port_range = 1024 65000
使配置立即生效可使用如下命令:
/sbin/sysctl -p

系统连接数的优化,有如下三种修改方式:
1. 在/etc/rc.local 中增加一行 ulimit -SHn 65535
2. 在/etc/profile 中增加一行 ulimit -SHn 65535
3. 在/etc/security/limits.conf 最后增加:
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535


        下面是一个简单的nginx 配置文件:
       
引用
user www www;
worker_processes 8;
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000
01000000;
error_log /www/log/nginx_error.log crit;
pid /usr/local/nginx/nginx.pid;
worker_rlimit_nofile 204800;
events
{
use epoll;
worker_connections 204800;
}
http
{
include mime.types;
default_type application/octet-stream;
charset utf-8;
server_names_hash_bucket_size 128;
client_header_buffer_size 2k;
large_client_header_buffers 4 4k;
client_max_body_size 8m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
fastcgi_cache_path /usr/local/nginx/fastcgi_cache levels=1:2
keys_zone=TEST:10m
inactive=5m;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 4k;
fastcgi_buffers 8 4k;
fastcgi_busy_buffers_size 8k;
fastcgi_temp_file_write_size 8k;
fastcgi_cache TEST;
fastcgi_cache_valid 200 302 1h;
fastcgi_cache_valid 301 1d;
fastcgi_cache_valid any 1m;
fastcgi_cache_min_uses 1;
fastcgi_cache_use_stale error timeout invalid_header http_500;
open_file_cache max=204800 inactive=20s;
open_file_cache_min_uses 1;
open_file_cache_valid 30s;
tcp_nodelay on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
server
{
listen 8080;
server_name backup.aiju.com;
index index.php index.htm;
root /www/html/;
location /status
{
stub_status on;
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$
{
expires 30d;
}
log_format access '$remote_addr -- $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /www/log/access.log access;
}
}


      
  • 大小: 120.6 KB
  • 大小: 98.9 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics