一个适用于 CN 网络的 VPN 解决方案

部署图

说明

  • VPN Clients 是位于 CN 网络的 VPN 客户端。
  • ns.example.net 和 vpn.example.net 可以是同一台机器,应位于防火墙(即 the Great Firewall,下同)内。
  • radius.example.net 和 pgsql.example.net 位置无所谓,但是最好和 vpn.example.net 很近或者位于同一台机器,以便获得更短的延时。
  • ss-server.example.net 应位于防火墙外。

安装

ss-server.example.net
安装 shadowsocks-libev 服务器端
pgsql.example.net
在 FreeBSD 上安装 PostgreSQL
radius.example.net
在 FreeBSD 上安装 FreeRADIUS
ns.example.net
使用 dnsmasq 和 shadowsocks-libev 构建一个干净的域名服务器
vpn.example.net
strongSwan 的安装和配置
Advertisements

#cisco-ipsec, #dnsmasq, #freebsd, #freeradius, #gfw, #gfwlist, #gfwlist2dnsmasq-awk, #ikev2, #ipsec, #iptables, #letsencrypt, #postgresql, #shadowsocks-libev, #ss-redir, #ss-server, #ss-tunnel, #strongswan, #ubuntu, #vpn

在 FreeBSD 上安装 FreeRADIUS

本文目标

在 FreeBSD 上安装 FreeRADIUS 并使用 PostgreSQL 作为后端存储,并做一些常用的修改以便给 strongSwan 使用。

本文测试环境

  • FreeBSD 11.0-RELEASE-p8
  • FreeRADIUS 2.2.9

安装

$ cd /usr/ports/net/freeradius2 && make config

将 PGSQL(PostgreSQL database support)打勾。

$ make install clean

修改配置文件

/usr/local/etc/raddb/clients.conf

在最后添加,以便允许 strongSwan 访问该 FreeRADIUS:

# strongswan
client vpn.example.net {
        ipaddr = 1.2.3.4
        secret = mySecret
}

/usr/local/etc/raddb/dictionary

在最后添加:

ATTRIBUTE       Max-Monthly-Traffic     3003    integer
ATTRIBUTE       Monthly-Traffic-Limit   3004    integer

/usr/local/etc/raddb/eap.conf

修改 eap 节点下来的 default_eap_type,从 md5 修改为 mschapv2:

default_eap_type = mschapv2

/usr/local/etc/raddb/radiusd.conf

把 $INCLUDE sql.conf 前的注释去掉:

        #  Include another file that has the SQL-related configuration.
        #  This is another file only because it tends to be big.
        #
        $INCLUDE sql.conf

把 $INCLUDE sql/postgresql/counter.conf 前的注释去掉:

        #
        #  This module is an SQL enabled version of the counter module.
        #
        #  Rather than maintaining seperate (GDBM) databases of
        #  accounting info for each counter, this module uses the data
        #  stored in the raddacct table by the sql modules. This
        #  module NEVER does any database INSERTs or UPDATEs.  It is
        #  totally dependent on the SQL module to process Accounting
        #  packets.
        #
        $INCLUDE sql/postgresql/counter.conf

/usr/local/etc/raddb/sites-available/default

启用基于 SQL 数据库的授权和审计,即将节点 authorize、accounting、session、post-auth 中的 sql 前的注释去掉,并注释掉 session 节点中的 radutmp:

authorize {
...
        #
        #  Look in an SQL database.  The schema of the database
        #  is meant to mirror the "users" file.
        #
        #  See "Authorization Queries" in sql.conf
        sql
...
}
...
accounting {
...
        #
        #  Log traffic to an SQL database.
        #
        #  See "Accounting queries" in sql.conf
        sql
...
}
...
#  Session database, used for checking Simultaneous-Use. Either the radutmp
#  or rlm_sql module can handle this.
#  The rlm_sql module is *much* faster
session {
#       radutmp

        #
        #  See "Simultaneous Use Checking Queries" in sql.conf
        sql
}
...
post-auth {
...
        #
        #  After authenticating the user, do another SQL query.
        #
        #  See "Authentication Logging Queries" in sql.conf
        sql
...
        Post-Auth-Type REJECT {
                # log failed authentications in SQL, too.
                sql

...
        }
...
}

在节点 authorize 中最后增加:

authorize {
...
        monthlytrafficcounter
}

/usr/local/etc/raddb/sql/postgresql/counter.conf

在最后添加:

sqlcounter monthlytrafficcounter {
        counter-name = Monthly-Traffic
        check-name = Max-Monthly-Traffic
        reply-name = Monthly-Traffic-Limit
        sqlmod-inst = sql
        key = User-Name
        reset = monthly
        # 1048576 bytes = 1MiB
        query = "SELECT SUM(acctinputoctets + acctoutputoctets)/1048576 \
                FROM radacct \
                WHERE UserName='%{%k}' AND \
                AcctStartTime::ABSTIME::INT4 + AcctSessionTime > '%b'"
}

/usr/local/etc/raddb/sql/postgresql/dialup.conf

讲这两行前的注释去掉,以便启用并发会话个数检查:

# Uncomment simul_count_query to enable simultaneous use checking
simul_count_query = "SELECT COUNT(*) FROM ${acct_table1} WHERE UserName='%{SQL-User-Name}' AND AcctStopTime IS NULL"
simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName, NASIPAddress, NASPortId, FramedIPAddress, CallingStationId, FramedProtocol FROM ${acct_table1} WHERE UserName='%{SQL-User-Name}' AND AcctSt
opTime IS NULL"

/usr/local/etc/raddb/sql.conf

将数据库从 mysql 修改为 postgresql,并配置数据库服务器登录信息:

sql {
        #
        #  Set the database to one of:
        #
        #       mysql, mssql, oracle, postgresql
        #
        database = "postgresql"
...
        # Connection info:
        server = "pgsql.example.net"
...
        login = "radius"
        password = "yourPassword"

        # Database table configuration for everything except Oracle
        radius_db = "radius"
...
        # Set to 'yes' to read radius clients from the database ('nas' table)
        # Clients will ONLY be read on server startup.  For performance
        # and security reasons, finding clients via SQL queries CANNOT
        # be done "live" while the server is running.
        # 
        readclients = yes
...
}

数据库的初始化

上面用到了 PostgreSQL 数据库服务器 pgsql.example.net 上的 radius 数据库,我们需要相应地初始化该数据库。
关于 PostgreSQL 数据库服务器的安装可以参考:在 FreeBSD 上安装 PostgreSQL

下面的命令示意了数据库用户 radius 和数据库 radius 的创建,以及表结构的初始化。
表结构相关的 SQL 语句可以在 FreeRADIUS 的配置文件目录中找到,位于 /usr/local/etc/raddb/sql/postgresql/schema.sql。

$ su - postgres
$ createuser -D -l -P -R -S radius
$ createdb -O radius radius
$ exit
$ psql -U radius -d radius < /usr/local/etc/raddb/sql/postgresql/schema.sql

设置为开机时自动启动

$ /usr/local/etc/rc.d/radiusd rcvar | sed s/NO/YES/ >> /etc/rc.conf

如果需要手动启动、重启或者查看运行状态可以分别使用如下命令:

$ /usr/local/etc/rc.d/radiusd start
$ /usr/local/etc/rc.d/radiusd restart
$ /usr/local/etc/rc.d/radiusd status

诊断

日志文件位于: /var/log/radius.log

#freebsd, #freeradius, #postgresql

在 FreeBSD 上安装 PostgreSQL

本文测试环境

  • FreeBSD 11.0-RELEASE-p8
  • postgresql96-server-9.6.2

安装

$ pkg install postgresql96-server-9.6.2

设置为开机时自动启动

$ /usr/local/etc/rc.d/postgresql rcvar | sed s/NO/YES/ >> /etc/rc.conf

初始化数据库

$ /usr/local/etc/rc.d/postgresql initdb

手动启动 PostgreSQL

$ /usr/local/etc/rc.d/postgresql start

Jail

如果你将 PostgreSQL 安装在 jail 内,可能会遇到如下错误:

running bootstrap script ... FATAL:  could not create shared memory segment: Function not implemented
DETAIL:  Failed system call was shmget(key=1, size=48, 03600).
child process exited with exit code 1

那么需要设置允许 sysvipc。

如果你使用的是 ezjail,那么可以修改 /usr/local/etc/ezjail/pgsql2_oxerr_net(假设 jailname 为 pgsql.example.net):

$ vi /usr/local/etc/ezjail/pgsql_example_net

修改如下参数增加“allow.sysvipc=1”:

export jail_pgsql_example_net_parameters="allow.sysvipc=1"

常用命令

列出所有可用数据库:

$ psql -U postgres -l

创建用户和数据库:

$ su - postgres
$ createuser -D -l -P -R -S example
$ createdb -O example example

以用户 example 登录数据库 example:

$ psql -U example -d example
example=> \?
example=> \d
example=> \q

允许用户从其它机器访问数据库:

$ vi /var/db/postgres/data96/pg_hba.conf

在最后添加类似如下代码,比如这里是允许用户 example 可以从 IP 为 192.168.0.100 的机器使用密码访问数据库 example:

host example example 192.168.0.100/32 password

#ezjail, #freebsd, #jail, #postgresql

在 FreeBSD 上安装 mpd5 设置基于 PPTP 的 VPN 服务器

参见这篇博客:mpd5 on FreeBSD 10.0(英文)。在 PhotonVPS(链接含 Referral ID)的 VPS 上,测试成功,操作系统版本为 FreeBSD 9.3-RELEASE-p43。

另外补充一下,需要在文件 /etc/rc.conf 中增加如下配置,以便开机时自动启动:

gateway_enable="YES"
pf_enable="YES"
mpd_enable="YES"

其中
gateway_enable="YES"sysctl net.inet.ip.forwarding=1
pf_enable="YES" 对应 /etc/rc.d/pf restart
mpd_enable="YES" 对应 /usr/local/etc/rc.d/mpd5 start

关于使用操作系统用户密码登录 VPN 的设置可以参考在 FreeBSD 上用 mpd5 构建 PPTP VPN(如果这个链接不能访问,可以访问转载在 FreeBSD 上用 mpd5 构建 PPTP VPN)。

#freebsd, #mpd5, #nat, #pf, #pptp, #vpn

#photonvps

在 MacBook Air 1,1 上安装 FreeBSD

安装前准备

硬件
  1. 一只 Super Drive;
  2. 一张刻录了 FreeBSD-7.4-RELEASE-i386-disc1.iso 的 CD 或者 FreeBSD-7.4-RELEASE-i386-dvd1.iso.gz 的 DVD(啰嗦一句,是刻录 iso 内容,不是把 iso 这个单独文件刻录上去 :-)。)(测试发现只能安装 FreeBSD 7 系列的 32 位。64 位或者8 系列和 9-CURRENT 都会 kernel panic 根本没法 boot。);
  3. 一只 USB 接口的闪存盘;
  4. (可选)1 只 USB 接口的键盘。
文件
  1. 从随机光盘中找到 BroadcomXPInstaller.exe 并使用 unrar 解压缩,得到 bcmwl5.inf 和 bcmwl5.sys。放到闪存盘根目录(最好是根目录,或者一个小写字母的目录里,因为接下来我们没法输入大写字母和特殊字符)。
  2. 准备好一个名为 loader.conf 内容如下的文件放入闪存盘:
    bcmwl5_sys_load="YES"
  3. 准备好一个名为 rc.conf 内容如下的文件放入闪存盘:
    keymap="us.pc-ctrl"
    ifconfig_ndis0="WPA DHCP"
  4. 准备好一个名为 wpa_supplicant.conf 内容如下的文件放入闪存盘:
    network={
    	ssid="YOUR NET SSID"
    	proto=WPA RSN
    	key_mgmt=WPA-PSK
    	pairwise=CCMP
    	group=CCMP
    	psk="YOUR PASSWORD"
    }

    注意修改其中的ssid和psk。

网络环境

通过 DHCP 获取 IP 地址的无线网络环境。设置固定 IP 地址应该也可以,就是要修改上述准备的配置文件,我没有测试。

使用 CD 启动安装

将 Super Drive 插在那个唯一的 USB 接口,并将 FreeBSD CD/DVD 插入。
开机安装 option 直到出现启动磁盘选择,选择从光驱里的“Windows”(没错,它就是显示为 Windows)启动。

安装过程有 2 个注意点:

键盘映射(Keymap)选择

要选择 “USA CapsLock->Ctrl US standard (Caps as L-Control)”。
接下来打字的时候,如果敲出来不是正常的字母,那就按一下 caps lock 键。

(可选)当操作系统安装好了,不再需要 CD 的时候,也就是那个唯一的 USB 接口不被占用的时候,你可以插上一个 USB 接口的键盘,那样的键盘会有正常的键入效果。

要安装源码

当选择 Distributions 的时候要选择一个带有 kernel sources 的。比如选择 Developer、Kern-Developer。因为接下来 ndisgen 的时候需要。

插上闪存盘并挂载

启动安装好的 FreeBSD 用 root 登入。把闪存盘插在那个唯一的 USB 接口并挂载到 /mnt:

# mount -t msdosfs /dev/da0 /mnt

使用 NDIS 驱动无线网卡

把文件 bcmwl5.inf 和 bcmwl5.sys 复制到 /root/ (不要试图直接在优盘上搞,因为闪存盘的文件系统可能不支持符号链接,接下来会失败的)。

# cp /mnt/bcmwl5.inf /mnt/bcmwl5.sys /root

  1. ndisgen /root/bcmwl5.inf /root/bcmwl5.sys

根据向导完成,如果中途显示失败了,那么就再来一次。还没有遇到过第二次也失败的情况。

(可选)然后就可以直接 kldload 了

# kldload /root/bcmwl5_sys.ko (键盘打不出下划线?按 tab 补全试试吧。下同。)

不过最好是配置成 boot 的时候就加载

把文件 bcmwl5_sys.ko 复制到 /boot/modules/:

# cp /root/bcmwl5_sys.ko /boot/modules/

然后再把优盘里的 loader.conf 文件复制到 /boot/loader.conf :

# cp /mnt/loader.conf /boot/

配置 /etc/rc.conf,即用我们准备好的 rc.conf 文件替换 /etc/rc.conf

# cp /mnt/rc.conf /etc/

配置无线网络

# cp /mnt/wpa_supplicant.conf /etc/

重启生效

重启 netif:

# /etc/rc.d/netif restart

或者干脆点直接重启计算机:

# shutdown -r now

这样就能连入 DHCP 的无线网络了。

参考资料

  1. Wireless Networking
  2. Using Windows® NDIS Drivers

#freebsd, #keymap, #macbook-air, #ndis

在 FreeBSD 上安装 Redmine

安装 Redmine

  1. cd /usr/ports/www/redmine && make install clean

设置 rc.conf

  1. /usr/local/etc/rc.d/redmine rcvar | sed s/NO/YES/ >> /etc/rc.conf

创建 PostgreSQL 数据库角色“redmine”和数据库“redmine”

  1. psql -U pgsql postgres

psql (9.0.4, server 9.0.3)
Type “help” for help.
postgres=# CREATE ROLE redmine LOGIN PASSWORD ‘redmine’;
CREATE ROLE
postgres=# CREATE DATABASE redmine OWNER = redmine;
CREATE DATABASE

设置数据库连接信息

  1. vi /usr/local/www/redmine/config/database.yml
production:
  adapter: postgresql
  database: redmine
  host: localhost
  username: redmine
  password: "redmine"

初始化数据库

# cd /usr/local/www/redmine/
# rake generate_session_store
# rake db:migrate RAILS_ENV=”production”
# rake redmine:load_default_data RAILS_ENV=”production”
Select language: bg, bs, ca, cs, da, de, el, en, en-GB, es, eu, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] zh
====================================
Default configuration data loaded.
# chown -R www:www files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets

启动 Redmine

# /usr/local/etc/rc.d/redmine start

设定 Apache HTTP Server 作为 Balancer(可选)

# vi /usr/local/etc/apache22/Includes/redmine.conf

<VirtualHost *:80>
	ServerName redmine.example.org
	DocumentRoot /usr/local/www/redmine/public

	<Directory /usr/local/www/redmine/public>
		Order allow,deny
		allow from all
	</Directory>

	<Proxy balancer://redmine>
		BalancerMember http://127.0.0.1:3000
	</Proxy>

	ProxyRequests Off
	ProxyPass /favicon.ico !
	ProxyPass /404.html !
	ProxyPass /500.html !
	ProxyPass /help !
	ProxyPass /images !
	ProxyPass /javascripts !
	ProxyPass /stylesheets !
	ProxyPass /themes !
	ProxyPass / balancer://redmine/
	ProxyPassReverse / balancer://redmine/
</VirtualHost>

重启动 Apache HTTP Server(可选)

  1. apachectl restart

参考

#apache-http-server, #freebsd, #load-balancing, #postgresql, #redmine

在 FreeBSD 上安装 Nexus

安装 JDK

cd /usr/ports/java/diablo-jdk16/ && make install clean

不能用 openjdk 呀,我测试了 openjdk-7.0.122_1,启动 nexus 会失败的:

log4j:WARN No appenders could be found for logger (org.sonatype.appcontext.AppContext).
log4j:WARN Please initialize the log4j system properly.
2011-04-13 06:48:49 INFO  [Thread-1       ] - org.sonatype.security.configuration.source.FileSecurityConfigurationSource - Loading Security configuration from /var/nexus/conf/security-configuration.xml
2011-04-13 06:48:49 INFO  [Thread-1       ] - org.sonatype.nexus.timeline.DefaultNexusTimeline - Initializing Nexus Timeline...
2011-04-13 06:48:50 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - 
-------------------------------------------------

Initializing Nexus (OSS), Version 1.9.0.2

-------------------------------------------------
2011-04-13 06:48:50 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Activating locally installed plugins...
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins:nexus-plugin-console-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins:nexus-indexer-lucene-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins:nexus-rrb-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins:nexus-core-documentation-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins.ldap:nexus-ldap-realm-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.plexus.components.ehcache.DefaultEhCacheWrapper - Creating and configuring EHCache manager with classpath:/ehcache.xml, using disk store 'none'
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Loading Nexus Configuration...
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.source.StaticConfigurationSource - Configuration loaded succesfully.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.source.FileConfigurationSource - Loading Nexus configuration from /var/nexus/conf/nexus.xml
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.source.FileConfigurationSource - Configuration loaded succesfully.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.validator.DefaultApplicationConfigurationValidator - Nexus configuration validated succesfully.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Applying Nexus Configuration...
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.security.configuration.source.FileSecurityConfigurationSource - Loading Security configuration from /var/nexus/conf/security-configuration.xml
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.apache.shiro.cache.ehcache.EhCacheManager - Cache with name 'org.sonatype.security.realms.XmlAuthenticatingRealm.authorizationCache' does not yet exist.  Creating now.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.apache.shiro.cache.ehcache.EhCacheManager - Added EhCache named [org.sonatype.security.realms.XmlAuthenticatingRealm.authorizationCache]
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.apache.shiro.cache.ehcache.EhCacheManager - Cache with name 'org.sonatype.security.realms.XmlAuthorizingRealm.authorizationCache.1' does not yet exist.  Creating now.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.apache.shiro.cache.ehcache.EhCacheManager - Added EhCache named [org.sonatype.security.realms.XmlAuthorizingRealm.authorizationCache.1]
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.proxy.registry.DefaultRepositoryTypeRegistry - Registered default repository types.
2011-04-13 06:48:52 WARN  [Thread-1       ] - org.codehaus.plexus.PlexusContainer - Error starting: class org.sonatype.nexus.DefaultNexus
org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException: Could not start Nexus!
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:652)
	at org.codehaus.plexus.PlexusLifecycleManager.start(PlexusLifecycleManager.java:283)
	at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:234)
	at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:134)
	at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:79)
	at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:253)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:984)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:233)
	at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:48)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4521)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:732)
Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
class               : org.sonatype.nexus.configuration.model.CRepository
required-type       : org.codehaus.plexus.util.xml.Xpp3Dom
path                : /org.sonatype.nexus.configuration.model.CRepository/externalConfiguration
line number         : 23
-------------------------------
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:246)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:218)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:162)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.copyObject(AbstractRevertableConfiguration.java:103)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.getConfiguration(AbstractRevertableConfiguration.java:46)
	at org.sonatype.nexus.configuration.model.CRepositoryCoreConfiguration.getConfiguration(CRepositoryCoreConfiguration.java:57)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:42)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:34)
	at org.sonatype.nexus.configuration.AbstractConfigurable.configure(AbstractConfigurable.java:171)
	at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepositoryFromModel(DefaultApplicationRuntimeConfigurationBuilder.java:51)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:515)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:481)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:463)
	at org.sonatype.nexus.DefaultNexus.startService(DefaultNexus.java:686)
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:648)
	... 35 more
Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:308)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:161)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	... 62 more
2011-04-13 06:48:52 ERROR [Thread-1       ] - org.sonatype.guice.bean.reflect.NamedClass - Error injecting: org.sonatype.nexus.DefaultNexus
com.google.inject.ProvisionException: Guice provision errors:

1) Error starting: class org.sonatype.nexus.DefaultNexus
  while locating org.sonatype.nexus.DefaultNexus

1 error
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:958)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:984)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:233)
	at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:48)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4521)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:732)
Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException: Could not start Nexus!
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:652)
	at org.codehaus.plexus.PlexusLifecycleManager.start(PlexusLifecycleManager.java:283)
	at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:234)
	at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:134)
	at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:79)
	at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:253)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	... 25 more
Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
class               : org.sonatype.nexus.configuration.model.CRepository
required-type       : org.codehaus.plexus.util.xml.Xpp3Dom
path                : /org.sonatype.nexus.configuration.model.CRepository/externalConfiguration
line number         : 23
-------------------------------
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:246)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:218)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:162)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.copyObject(AbstractRevertableConfiguration.java:103)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.getConfiguration(AbstractRevertableConfiguration.java:46)
	at org.sonatype.nexus.configuration.model.CRepositoryCoreConfiguration.getConfiguration(CRepositoryCoreConfiguration.java:57)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:42)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:34)
	at org.sonatype.nexus.configuration.AbstractConfigurable.configure(AbstractConfigurable.java:171)
	at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepositoryFromModel(DefaultApplicationRuntimeConfigurationBuilder.java:51)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:515)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:481)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:463)
	at org.sonatype.nexus.DefaultNexus.startService(DefaultNexus.java:686)
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:648)
	... 35 more
Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:308)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:161)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	... 62 more
2011-04-13 06:48:52 ERROR [Thread-1       ] - org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/nexus] - Exception sending context initialized event to listener instance of class org.sonatype.nexus.web.NexusBooterListener
java.lang.IllegalStateException: Could not initialize Nexus.
	at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:58)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4521)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:732)
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting: org.sonatype.nexus.DefaultNexus
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.sonatype.nexus.Nexus

1 error
      role: org.sonatype.nexus.Nexus
  roleHint: 
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:251)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:233)
	at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:48)
	... 8 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting: org.sonatype.nexus.DefaultNexus
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.sonatype.nexus.Nexus

1 error
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:958)
	at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
	... 11 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:

1) Error starting: class org.sonatype.nexus.DefaultNexus
  while locating org.sonatype.nexus.DefaultNexus

1 error
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:958)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:984)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	... 14 more
Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException: Could not start Nexus!
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:652)
	at org.codehaus.plexus.PlexusLifecycleManager.start(PlexusLifecycleManager.java:283)
	at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:234)
	at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:134)
	at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:79)
	at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:253)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	... 25 more
Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
class               : org.sonatype.nexus.configuration.model.CRepository
required-type       : org.codehaus.plexus.util.xml.Xpp3Dom
path                : /org.sonatype.nexus.configuration.model.CRepository/externalConfiguration
line number         : 23
-------------------------------
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:246)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:218)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:162)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.copyObject(AbstractRevertableConfiguration.java:103)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.getConfiguration(AbstractRevertableConfiguration.java:46)
	at org.sonatype.nexus.configuration.model.CRepositoryCoreConfiguration.getConfiguration(CRepositoryCoreConfiguration.java:57)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:42)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:34)
	at org.sonatype.nexus.configuration.AbstractConfigurable.configure(AbstractConfigurable.java:171)
	at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepositoryFromModel(DefaultApplicationRuntimeConfigurationBuilder.java:51)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:515)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:481)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:463)
	at org.sonatype.nexus.DefaultNexus.startService(DefaultNexus.java:686)
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:648)
	... 35 more
Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:308)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:161)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	... 62 more
2011-04-13 06:48:52 ERROR [main           ] - org.apache.catalina.core.StandardContext - Error listenerStart
2011-04-13 06:48:52 ERROR [main           ] - org.apache.catalina.core.StandardContext - Context [/nexus] startup failed due to previous errors
2011-04-13 06:48:53 INFO  [Thread-2       ] - org.sonatype.nexus.index.DefaultIndexerManager - Shutting down Nexus IndexerManager
2011-04-13 06:48:53 INFO  [Thread-2       ] - org.sonatype.plexus.components.ehcache.DefaultEhCacheWrapper - Shutting down EHCache manager.
2011-04-13 06:48:53 INFO  [Thread-2       ] - org.sonatype.nexus.DefaultNexus - Stopped Nexus (version 1.9.0.2 OSS)
2011-04-13 06:48:56,061 INFO  NutchBean - creating new bean
2011-04-13 06:48:56,733 INFO  SearchBean - opening merged index in /usr/home/sutra/search/nutch-1.0/crawl/index
2011-04-13 06:48:57,256 INFO  PluginRepository - Plugins: looking in: /usr/local/apache-tomcat-7.0/webapps/nutch/WEB-INF/classes/plugins
2011-04-13 06:48:57,670 INFO  PluginRepository - Plugin Auto-activation mode: [true]
2011-04-13 06:48:57,670 INFO  PluginRepository - Registered Plugins:
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Pdf Parse Plug-in (parse-pdf)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Http / Https Protocol Plug-in (protocol-httpclient)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Jakarta POI - Java API To Access Microsoft Format Files (lib-jakarta-poi)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	HTTP Framework (lib-http)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	MSWord Parse Plug-in (parse-msword)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Regex URL Filter (urlfilter-regex)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	XML Libraries (lib-xml)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	MSExcel Parse Plug-in (parse-msexcel)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	OPIC Scoring Plug-in (scoring-opic)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Zip Parse Plug-in (parse-zip)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	URL Query Filter (query-url)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Parse MS Documents Framework (lib-parsems)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Regex URL Filter Framework (lib-regex-filter)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	the nutch core extension points (nutch-extensionpoints)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	MSPowerPoint Parse Plug-in (parse-mspowerpoint)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Basic Query Filter (query-basic)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Basic URL Normalizer (urlnormalizer-basic)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	RSS Parse Plug-in (parse-rss)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Html Parse Plug-in (parse-html)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Basic Indexing Filter (index-basic)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Basic Summarizer Plug-in (summary-basic)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Site Query Filter (query-site)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Text Parse Plug-in (parse-text)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Pass-through URL Normalizer (urlnormalizer-pass)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Regex URL Normalizer (urlnormalizer-regex)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	CyberNeko HTML Parser (lib-nekohtml)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	OpenOffice/OpenDocument Parse Plug-in (parse-oo)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	JavaScript Parser (parse-js)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	SWF Parse Plug-in (parse-swf)
2011-04-13 06:48:57,671 INFO  PluginRepository - Registered Extension-Points:
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Summarizer (org.apache.nutch.searcher.Summarizer)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Protocol (org.apache.nutch.protocol.Protocol)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Analysis (org.apache.nutch.analysis.NutchAnalyzer)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Field Filter (org.apache.nutch.indexer.field.FieldFilter)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	HTML Parse Filter (org.apache.nutch.parse.HtmlParseFilter)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Query Filter (org.apache.nutch.searcher.QueryFilter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Search Results Response Writer (org.apache.nutch.searcher.response.ResponseWriter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch URL Normalizer (org.apache.nutch.net.URLNormalizer)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch URL Filter (org.apache.nutch.net.URLFilter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Online Search Results Clustering Plugin (org.apache.nutch.clustering.OnlineClusterer)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Indexing Filter (org.apache.nutch.indexer.IndexingFilter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Content Parser (org.apache.nutch.parse.Parser)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Scoring (org.apache.nutch.scoring.ScoringFilter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Ontology Model Loader (org.apache.nutch.ontology.Ontology)
2011-04-13 06:48:57,697 INFO  Configuration - found resource common-terms.utf8 at file:/usr/local/apache-tomcat-7.0/webapps/nutch/WEB-INF/classes/common-terms.utf8
2011-04-13 06:48:57,758 INFO  SummarizerFactory - Using the first summarizer extension found: Basic Summarizer

安装 Tomcat

cd /usr/ports/www/tomcat7/ && make install clean

下载 Nexus

fetch http://nexus.sonatype.org/downloads/nexus-webapp-1.9.0.2.war
mv nexus-webapp-1.9.0.2.war /usr/local/apache-tomcat-7.0/webapps/nexus.war

安装配置 Apache

安装 Apache 作为 Tomcat 的前端,虽然这不是必须的,但我们常常需要 Apache 来运行其它的应用,并共享一个 80 端口,比如 TracSubversion等。

cd /usr/ports/www/apache22/ && make install clean

注意勾选 PROXY_AJP 。
配置文件 httpd.conf 或者其 include 的文件中添加

ProxyPass /nexus ajp://localhost:8009/nexus
ProxyPassReverse /nexus ajp://localhost:8009/nexus
<Location /nexus>
    SetEnv no-gzip
</Location>

注意这里一定要加上 no-gzip 否则,用浏览器查看就会看到又如压缩文件被记事本打开了的乱码样的网页。这是因为 Nexus 默认会把 HTTP Resposne 压缩,然后如果 apache 也配置了压缩的话,apache 又会把 response 给压缩一遍,而到浏览器那端只会解压缩一次。所以告诉 apache 不要压缩。

启动 Tomcat 和 Apache

首先让 tomcat 和 apache 设置为开机自动启动吧:

/usr/local/etc/rc.d/tomcat7 rcvar | sed s/NO/YES/ >> /etc/rc.conf
/usr/local/etc/rc.d/apache22 rcvar | sed s/NO/YES/ >> /etc/rc.conf

还要配置下 tomcat 启动参数,让 nexus 把配置数据之类的都放到 /var/nexus 目录里去,在 /etc/rc.conf 里添加下面一行:

tomcat7_java_opts="-Dplexus.nexus-work=/var/nexus"

并且给它创建好 /var/nexus 这个目录:

mkdir /var/nexus && chown www:www /var/nexus

然后启动它们:

/usr/local/etc/rc.d/tomcat7 start
apachectl start

使用方法

浏览器访问

http://localhost/nexus

Maven使用

修改 ~/.m2/settings.xml,添加一个mirror:

<mirror>
    <id>mynexus</id>
    <name>mynexus</name>
    <url>http://localhost/content/groups/public</url>
    <mirrorOf>central</mirrorOf>
</mirror>

#apache-http-server, #freebsd, #maven, #nexus, #tomcat