ubuntu apache2 mod 載入法及Dspace 的 tomcat6 8080 port轉向及更動預設版型注意事項
ubuntu apache2 mod 載入法
ubuntu的apache2載入模組的方式與之前有所不同,
拆開成很多細小的部分,雖然比較麻煩,
不過我覺得這樣反而可以比較好管理。
參考:http://www.debuntu.org/2006/06/15/66-how-to-enable-apache-modules-under-debian-based-system
有兩個方法,一種手動下連結的方式,一種是跑內建小程式來達成:
ubuntu的apache2載入模組的方式與之前有所不同,
拆開成很多細小的部分,雖然比較麻煩,
不過我覺得這樣反而可以比較好管理。
參考:http://www.debuntu.org/2006/06/15/66-how-to-enable-apache-modules-under-debian-based-system
有兩個方法,一種手動下連結的方式,一種是跑內建小程式來達成:
- $cd /etc/apache2/mods-enabled
$ sudo ln -s ../mods-available/mime_magic.conf mime_magic.conf
$sudo ln -s ../mods-available/mime_magic.load mime_magic.load - $sudo a2enmod
Which module would you like to enable?
Your choices are: actions asis auth_anon auth_dbm auth_digest auth_ldap cache cern_meta cgid cgi dav_fs dav deflate disk_cache expires ext_filter file_cache headers imap include info ldap mem_cache mime_magic php5 proxy_connect proxy_ftp proxy_http proxy rewrite speling ssl suexec unique_id userdir usertrack vhost_alias
Module name? mime_magic
Module mime_magic installed; run /etc/init.d/apache2 force-reload to enable.
完成後記得要 sudo /etc/init.d./apache2 restart
----------------------------------------------------------------------------------------------
Dspace 的 tomcat6 8080 port轉向及更動預設版型注意事項
另外如果是 Dspcae 要用這方式轉向,基本上 dspcae.cfg不用動,但是將紅色那一行關掉,主要是不在dspace這邊控制載入時的根目錄,而是在tomcat那邊控制:
ProxyPass / http://xxx.xxx.xxx:8080/
※後來發現tomcat的server.xml 可以直接改預設的port,那樣似乎會比較簡單,就不需管apache在那邊轉來轉去。(add at 20111121)
最後在 /etc/tomcat6/server.xml 中,如果當初是跟著官方手冊做,應該是長這樣:
及
及
如此一來預設的dspace版式就會是xmlui。
----------------------------------------------------------------------------------------------
Dspace 的 tomcat6 8080 port轉向及更動預設版型注意事項
另外如果是 Dspcae 要用這方式轉向,基本上 dspcae.cfg不用動,但是將紅色那一行關掉,主要是不在dspace這邊控制載入時的根目錄,而是在tomcat那邊控制:
# DSpace base host URL. Include port number etc. dspace.baseUrl = http://xxx.xxx.xxx:8080 # DSpace base URL. Include port number etc., but NOT trailing slash # Change to xmlui if you wish to use the xmlui as the default, or remove # "/jspui" and set webapp of your choice as the "ROOT" webapp in # the servlet engine. #dspace.url = ${dspace.baseUrl}/xmlui
apache的也是一樣對應好:
ProxyPass / http://xxx.xxx.xxx:8080/
ProxyPassReverse / http://xxx.xxx.xxx:8080/這樣一進到80 port的apache就會是由tomcat提供服務。
※後來發現tomcat的server.xml 可以直接改預設的port,那樣似乎會比較簡單,就不需管apache在那邊轉來轉去。(add at 20111121)
1 2 3 4 5 6 7 8 9 10 11 | <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="UTF-8" redirectPort="8443" /> |
最後在 /etc/tomcat6/server.xml 中,如果當初是跟著官方手冊做,應該是長這樣:
1 2 3 4 5 6 | <!-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. --> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> |
1 2 3 4 5 6 7 | <!-- Define a new context path for all DSpace web apps --> <Context path="/xmlui" docBase="/dspace/webapps/xmlui" allowLinking="true"/> <Context path="/sword" docBase="/dspace/webapps/sword" allowLinking="true"/> <Context path="/oai" docBase="/dspace/webapps/oai" allowLinking="true"/> <Context path="/jspui" docBase="/dspace/webapps/jspui" allowLinking="true"/> <Context path="/lni" docBase="/dspace/webapps/lni" allowLinking="true"/> <Context path="/solr" docBase="/dspace/webapps/solr" allowLinking="true"/> |
這時就把修改appbase,另外就是「xmlui」的位置改成對應到「 」
1 2 3 4 5 6 | <!-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. --> <Host name="localhost" appBase="/dspace/webapps/" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> |
1 2 3 4 5 6 7 | <!-- Define a new context path for all DSpace web apps --> <Context path="" docBase="xmlui" allowLinking="true"/> <Context path="/sword" docBase="sword" allowLinking="true"/> <Context path="/oai" docBase="oai" allowLinking="true"/> <Context path="/jspui" docBase="jspui" allowLinking="true"/> <Context path="/lni" docBase="lni" allowLinking="true"/> <Context path="/solr" docBase="solr" allowLinking="true"/> |
如此一來預設的dspace版式就會是xmlui。
留言
張貼留言