- mkdir /nac/www
- mkdir /nac/www
- cd /nac/www
- tar zxvf jdk-7u25-linux-i586.gz
- tar zxvf apache-tomcat-7.0.42.tar.gz
- chmod –R 755 /nac
- mv jdk1.7.0_25/ jdk
- mv apache-tomcat-7.0.42 tomcat
4、配置环境变量
- vi /etc/profile
- export JAVA_HOME=/nac/www/jdk
- export PATH=$JAVA_HOME/bin:$JRE_HOME/jre/bin:$PATH
- export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$LCASSPATH
- export CATALINA_HOME=/nac/www/tomcat
- export CLASSPATH=.:$JAVA_HOME/lib:$CATALINA_HOME/lib
- export PATH=$PATH:$CATALINA_HOME/bin
- 刷新配置
- source /etc/profile
5、修改*.sh权限和执行脚本
- cd /apache-tomcat/bin/
- chmod 777 *.sh
- bash catalina.sh start
- bash /apache-tomcat/bin/catalina.sh start
6、修改iptables
- vi /etc/sysconfig/iptables
在里面添加
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT //添加mysql
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT //添加tomcat
7、修改mysql和tomcat开机启动
- Chkconfig mysqld on
- Chkconfig mysqld –list 检查开机启动
- 修改vi /etc/rc.d/rc.local
- /apache-tomcat/bin/catalina.sh start
8、添加mysql的用户名和密码
- Mysql –u root
- GRANT ALL PRIVILEGES ON *.* TO hupu@"%" IDENTIFIED BY 'hupu' WITH GRANT OPTION;
- GRANT ALL PRIVILEGES ON *.* TO hupu@localhost IDENTIFIED BY 'hupu' WITH GRANT OPTION;
- GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'root' WITH GRANT OPTION;
- GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'root' WITH GRANT OPTION;
9、在浏览器输入服务器的ip:8080,如下:“10.10.2.221:8080”,
当看到这里页面的时候,说明一切都ok了,就这样可以运行部署Java项目的服务器就搭建好了!
www.aibang.com/show/700432115-423278073/product/15432865.html
www.aibang.com/show/700432115-423278073/product/15432949.html
www.aibang.com/show/700432115-423278073/product/15433025.html
www.aibang.com/article/700432115-423278073/product/15433121.html
www.aibang.com/show/700432115-423278073/product/15433199.html
www.aibang.com/show/700432115-423278073/product/15433289.html
www.aibang.com/show/700432115-423278073/product/15433377.html
www.aibang.com/show/700432115-423278073/product/15433463.html
www.aibang.com/show/700432115-423278073/product/15433527.html
www.aibang.com/show/700432115-423278073/product/15433611.html
www.aibang.com/show/700432115-423278073/product/15433685.html
www.aibang.com/article/700432115-423278073/product/15433741.html
www.aibang.com/show/700432115-423278073/product/15433911.html
www.aibang.com/show/700432115-423278073/product/15433965.html
www.aibang.com/show/700432115-423278073/product/15434017.html
www.aibang.com/show/700432115-423278073/product/15434105.html
www.aibang.com/show/700432115-423278073/product/15434189.html
www.aibang.com/article/700432115-423278073/product/15434241.html
www.aibang.com/article/700432115-423278073/product/15434701.html
www.aibang.com/show/700432115-423278073/product/15434759.html
www.aibang.com/show/700432115-423278073/product/15434833.html
www.aibang.com/show/700432115-423278073/product/15434903.html
www.aibang.com/show/700432115-423278073/product/15434969.html
www.aibang.com/show/700432115-423278073/product/15435035.html
www.aibang.com/show/700432115-423278073/product/15435079.html
www.aibang.com/show/700432115-423278073/product/15435805.html
www.aibang.com/show/700432115-423278073/product/15435849.html
www.aibang.com/show/700432115-423278073/product/15436053.html
www.aibang.com/show/700432115-423278073/product/15436085.html
www.aibang.com/article/700432115-423278073/product/15436121.html
www.aibang.com/show/700432115-423278073/product/15436191.html
www.aibang.com/show/700432115-423278073/product/15436233.html
www.aibang.com/show/700432115-423278073/product/15436377.html
www.aibang.com/show/700432115-423278073/product/15436437.html
www.aibang.com/article/700432115-423278073/product/15436481.html
www.aibang.com/show/700432115-423278073/product/15436905.html
www.aibang.com/show/700432115-423278073/product/15437189.html
www.aibang.com/show/700432115-423278073/product/15437211.html
www.aibang.com/show/700432115-423278073/product/15437235.html
www.aibang.com/show/700432115-423278073/product/15437267.html