您现在的位置: 主页 > 嵌入式操作系统 > Linux > Ubuntu Server 10.04 搭建JSP环境
本文所属标签:
为本文创立个标签吧:

Ubuntu Server 10.04 搭建JSP环境

来源:net 网络用户发布,如有版权联系网管删除 2018-07-11 

1 安装java

sudo apt-get install sun-java6-jdk sun-java6-fonts sun-java6-plugin

可能会先要求装jre,装就是了

sudo update-java-alternatives -s java-6-sun

2 环境变量

sudo vim /etc/environment

加入JAVA_HOME=/usr/lib/jvm/java-6-openjdk/

PATH改为如下

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-openjdk/bin/"

3 安装apache

sudo apt-get install apache2

然后sudo /etc/init.d/apache2 start/stop/restart 可以进行启动之类的

启动后看看浏览器地址栏输入127.0.0.1看结果

其中/etc/init.d/apache2和/usr/sbin/apachectl 作用是相同的, 只是在/etc/init.d会自动执行

而有任何要改动的设定, 加在/etc/apache2/httpd.conf中

4 安装tomcat

sudo apt-get install tomcat6 tomcat6-common tomcat6-docs tomcat6-examples libtomcat6-java

同样/etc/init.d/tomcat6 start/stop/restart 进行启动

5 mod_jk的安装

如此一来,apache跟tomcat应该都可以正常运行了,只是两者互不认识,www.linuxidc.com要把他们连在一起还要个mod_jk.

sudo apt-get install libapache2-mod-jk

/usr/lib/apache2/modules/mod_jk.so就是让负责apache将request交给tomcat处理的module.

然后将/usr/share/doc/libapache2-mod-jk/httpd_example_apache2.con内容直接copy到/etc/apache2/httpd.conf,

6 验证

sudo gedit /etc/apache2/httpd.conf

#gedit 吧,你可以直接粘贴到结尾

Alias /examples "/usr/share/tomcat6-examples/examples"

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny

allow from all

#/tomcat6-examples/examples 来自 sudo apt-get install tomcat6 tomcat6-examples



              查看评论 回复



嵌入式交流网主页 > 嵌入式操作系统 > Linux > Ubuntu Server 10.04 搭建JSP环境
 启动 安装 然后

"Ubuntu Server 10.04 搭建JSP环境"的相关文章

网站地图

围观()