如何运行Tomcat和Apache的Apache2 Ubuntu上相互平行? [英] How to run Apache Tomcat and Apache2 on Ubuntu Parallel to each other?
问题描述
我遇到了一个问题。我两者都做的PHP开发和JSF开发。但是,我遇到了一个问题。你看,前一阵子我安装的Apache2,这样我可以做的PHP。但一个月后,我不得不安装Apache Tomcat。这时候,问题出现了。我跟所有的指令给上的 tomcat.apache.org
网站Ubuntu Linux系统。它没有安装。和 127.0.0.1
总是指向的Apache2的页面。我试图 127.0.0.1:8080
,但没有返回任何内容。
I have run into a problem. I do both pHp development and JSF development. But i ran into a problem. You see, a while ago I installed Apache2 so that I could do pHp. But then a month later I had to install Apache Tomcat. That's when the problem arose. I followed all the instruction give on the tomcat.apache.org
site for Ubuntu. It did not install. And 127.0.0.1
always pointed to Apache2's page. I tried 127.0.0.1:8080
but that did not return anything.
所以我在这里要问你,如果有反正我可以关掉的Apache2时,我想与Tomcat的工作?并重新打开它,每当我想要的吗?
So I am here to ask you if there is anyway I can turn off Apache2 when i want to work with Tomcat? And turn it back on whenever I want?
推荐答案
两个服务器进行配置,如果你想让他们在同一主机上都可以在不同的端口监听。
The two servers should be configured to listen on different ports if you want them both available on the same host.
- Instructions for changing ports for Apache2 on Ubuntu
- Instructions for changing ports for Apache Tomcat on Ubuntu
现在,如果你已经配置Apache监听80和Tomcat监听端口8080,你应该能够在访问它们HTTP://本地主机:80 (或只是的http://本地主机)和的 HTTP://本地主机:8080分别
Now, if you've configured Apache to listen on 80 and Tomcat to listen on port 8080, you should be able to access them at http://localhost:80 (or just http://localhost) and http://localhost:8080 respectively.
您应该确保两个服务器实际上是好了。 netstat的-npl | grep的:8080
和 netstat的-npl | grep的:80
有助于确定哪些进程正在必将这两个端口。如果端口绑定,但不说的Java
或的Apache2
,你有一些其他进程监听这些港口和那将停止尝试从启动绑定到该端口的服务器。
You should ensure both the servers are actually up as well. netstat -npl | grep :8080
and netstat -npl | grep :80
should help you identify what processes are bound to these two ports. If the ports are bound but don't say java
or apache2
, you've got some other process listening on these ports and that's going to stop the server that tries to bind to that port from starting up.
有关的Apache2,你也可以运行服务的Apache2状态
来查看状态是什么。
For Apache2, you could also run service apache2 status
to see what the status is.
但是,如果要运行绑定到相同的端口(或许80)两个服务器,然后你似乎已经猜到了,你必须阻止对方。
If however, you want to run both servers bound to the same port( perhaps 80) then as you seem to have guessed, you'll have to stop the other.
- 要停止的Apache2,执行命令
服务停止的Apache2
- 停止Tomcat的取决于你如何启动它。你可以简单地运行
$ {CATALINA_HOME} / bin中
即的
目录中Tomcat安装文件夹中。shutdown.sh
脚本斌
注意
您[可能]需要执行的命令,所以根你需要preFIX 须藤
。
You will [probably] need to execute the commands as root so you'll need to prefix sudo
.
这篇关于如何运行Tomcat和Apache的Apache2 Ubuntu上相互平行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!