Jenkisn + Tomcat7 + Ubuntu12.04 server


1. sudo apt-get install tomcat7

In this case, here are the paths you might care about:
/var/lib/tomcat6 – These are the Java-y files for Tomcat. If you were to just extract Tomcat’s tar file and run it as a local user, these are the files you’d mostly be looking at.
/usr/share/tomcat6 – These are the more Linux-y files for Tomcat. Tomcat’s binaries, shell scripts, bootstrap files, etc.

2. Install Jenkins
http://mirrors.jenkins-ci.org/war/latest/
copy the war file to /var/lib/tomcat6/webapps

test:
http://localhost:8080/jenkins

error:
Unable to create the home directory ‘/usr/share/tomcat6/.jenkins’. This is most likely a permission problem.

To change the home directory, use JENKINS_HOME environment variable or set the JENKINS_HOME system property. See Container-specific documentation for more details of how to do this.

原因:
Jenkins depends on an environment variable called JENKINS_HOME being set. Most solutions for this offered by the internet suggest setting the CATALINA_OPTS environment variable, and they all generally assume you are running Tomcat as yourself rather than a system user.

Jenkins actually does something handy when JENKINS_HOME is not set: it sets it for you, as .jenkins. Of course, it assumes this directory exists relative to where it executing, which means it’s looking in /usr/share/tomcat6.
解决方法:
cd /usr/share/tomcat7
sudo mkdir .jenkins
sudo chown tomcat7:nogroup .jenkins
sudo service tomcat7 restart

OK!

bug2: gradle: command not found or lint: command not found
描述:lint 与gradle的环境变量都已经设置过了,并且可以通过job 运行后的环境变量中看到,是已经生效了。
但是,输出$ANDROID_HOME/tools 目录,表示不存在该目录, gradle也一样

原因:tomcat7 用户没有访问tools目录的权限。


解决方法:在android sdk 目录上执行如下命令:

sudo chown -R tomcat7 android-sdk-linux
sudo chown -R tomcat7 gradle目录



优化:
1.速度太慢
使用内存充当硬盘,提高启动速度。

sudo mount -t tmpfs tmpfs /media/virram  -o size=200M 
tmpfs /media/ramdisk tmpfs size=2G,defaults,noatime,mode=1777 0 0

推荐使用:
tmpfs /media/ramdisk tmpfs defaults,noatime,mode=1777 0 0
操作系统会默认使用电脑内存的一半作为虚拟硬盘,如果虚拟内存使用完,操作系统会默认使用交换分区(swap)的区域。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值