2015-07-19 96 views
0

我試圖安裝Tomcat和測試工作正常後,在Ubuntu 12.04, 與mod_jk的安裝Tomcat 7的Apache2:的Tomcat 7的Apache2在Ubuntu的mod_jk 12.04

http://139.162.221.XXX:8080/tomcat-demo/helloworld/

我安裝和配置mod_jk的:

sudo apt-get install libapache2-mod-jk 

下面一行的註解<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />文件中 等/ tomcat7/server.xml中

補充一點:

# Define 1 real worker using ajp13 
worker.list=worker1 
# Set properties for worker (ajp13) 
worker.worker1.type=ajp13 
worker.worker1.host=localhost 
worker.worker1.port=8009 

到/etc/apache2/workers.properties

變化JkWorkersFile屬性/etc/apache2/workers.properties文件在/ etc/apache2的/ mods-可用/ jk.conf

編輯文件:/等//000默認的Apache2 /啓用站點,

添加

<VirtualHost *:80> 
....................................... 
....................................... 
JkMount /tomcat-demo/* worker1 
JkMount /tomcat-demo worker1 
</VirtualHost *:80> 

重啓服務器:

sudo /etc/init.d/tomcat7 restart 
sudo /etc/init.d/apache2 restart 

但訪問到http://139.162.221.XXX/tomcat-demo/helloworld/

我得到這個錯誤:

Not Found 

The requested URL /tomcat-demo/helloworld/ was not found on this server. 

Apache/2.4.7 (Ubuntu) Server at 139.162.221.107 Port 80 

和我也有這個錯誤重新啓動Apache:

* Restarting web server apache2                                 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message 

回答

0

不知道如何通配符解析實際上做,我通常有兩個JkMounts:

JkMount /tomcat-demo worker1 
JkMount /tomcat-demo/* worker1 

(這可能是多餘的,但我喜歡這個聲明不是一個你報價,這也將包括/tomcat-demo7和其他路徑更好)

此外,請確保您沒有多個VirtualHost聲明,並且只有某個主機名實際上具有JkMount活動。確保您的workers.properties實際上已被讀取(日誌文件,或引入語法錯誤並確保它已被識別)