Linux 搭建服务器环境

tar zvxf 文件名 -c 目录名
ps -eaf | grep java //显示java 进程
kill -9 进程号 //杀进程
iptables -L -n //查看开放端口
nc -lp 22 & //开发端口
/etc/rc.d/init.d/iptables stop //关防火墙
chkconfig iptables off //关闭iptables的服务
chkconfig --list //查看当前所有服务
chkconfig --add name //增加一项新的服务
每个被chkconfig管理的服务需要在对应的init.d下的脚本加上两行或者更多行的注释
rpm -i xxx.rpm //安装rpm文件
rpm -ql xxx //检查安装好的文件都在什么地方
ifconfig //查看本机ip地址等信息,类似ipconfig
vncserver //打开vncserver

安装tomcat
1. JDK tomcat
tar zvxf 文件名 -c 目录名
2. 环境变量
JAVA_HOME=/usr/software/jdk/jdk1.7.0_03
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
M2_HOME=/usr/software/maven/apache-maven-3.0.4
CATALINA_HOME=/usr/software/tomcat/apache-tomcat-7.0.26

PATH=$JAVA_HOME/bin:$PATH:M2_HOME/bin
3. 关防火墙
/etc/rc.d/init.d/iptables stop
chkconfig iptables off
4. 添加端口
nc -lp 22 & //开发端口

安装WebSphere

安装好了以后启动WebSphere时出现 An instance of the server may already be running:server1
stopServer时卡在retrieve server information上
有几种情况,一种是端口被占用
还有一种就是当前机器的网络名无法被ping通,检查修改以后可成功

安装jenkins

如果出现JDK版本问题的话要修改/etc/init.d/jenkins里面的内容,里面有for cadidate那段语句,把当前JDK的bin/java的路径给它,删掉其他的路径就可以了

安装nexus

如果是使用root,需要设置环境变量RUN_AS_USER=root

安装SVN
下载源文件https://subversion.apache.org/download/
还需要apache apr apr-util,下载最新的
还需要http://www.sqlite.org/sqlite-amalgamation-3.6.19.tar.gz
1. 解压 svn
2. APR编译 ./configure /usr/local/apr 安装 make && make install
3. APR-UTIL 编译./configure --with-apr /usr/local/apr 安装 make && make install
4. 解压sqllite,建立目录/subversion-1.7.8/sqlite-amalgamation 拷贝sqlit3.c到这个目录下
5. 使用命令./configure --prefix=/mmnt/installedApp/svn --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-apxs=/mmnt/server/httpd-2.2.22/bin/apxs --with-ssl
来安装。apxs是apache安装的路径
6. create出错后
error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

if
libiconv.so.2 is located in /usr/local/lib (edgy does not have it, compile from the source)

add /usr/local/lib to /etc/ld.so.conf and run sudo ldconfig
这样解决就可以了

猜你喜欢

转载自shmilywzc.iteye.com/blog/1428805
今日推荐