문제

개인 Linux 시스템과 Windows에 Tomcat+Solr을 설치하고 구성했습니다. 나는 그들을 잘 작동시킬 수 있었다. 저는 Java와 파일 구조가 어떻게 작동하는지 매우 처음입니다. (즉, 전쟁 파일을 어디에 두어야하는지 알고 웹 -INF가 무엇인지 알고 있습니다) 이제 Solr을 설치하고 고객 공유 호스팅 계획에 구성 할 준비가되었으므로 지시 사항은 이전과 다릅니다. 나는 이것을 엉망으로 만들고 싶지 않으며 분명히 웹 서버가 매일 재부팅 할 수 없으며 수동으로 할 수 있다고 생각하지 않습니다.

다음은 호스팅 제공 업체에 Tomcat Servlet을 설치하기위한 지침입니다.http://www.apluskb.com/scripts/where_do_i_put_my_answer1186.html

보시다시피 HTML/Web-Inf 디렉토리 아래에 Solr을 설치해야하지만 그 말을 읽어야합니다. 매우 혼란 스럽습니다.

"모든 서블릿은 다음에 업로드해야합니다 /html/web-inf/클래스 예배 규칙서. 포장되지 않은 사용자 정의 클래스 및 리소스는 /html/web-inf/클래스 디렉토리, 클래스 및 리소스가 포장 된 상태 항아리 파일을 업로드해야합니다 /html/web-inf/lib."

어 ... 그래서 뭐야? /클래스? 또는 /lib? 나는 그들이 그것을 잘 설명한다고 생각하지 않으며이 진술에 약간 혼란스러워합니다. 또한 정확히 무엇을 설치합니까? 정상적인 Solr 설치를 사용하면 Solr이 다른 곳에 놓여지고 전쟁 파일은 Tomcat에 복사되고 나머지 Solr은 일종의 XML 구성 파일을 사용하여 참조됩니다.

또한, 나는 Java와 Servlets를 처음 접했기 때문에 누군가가 Tomcat 파일 구조를 나에게 설명 할 수 있습니까 (자세히는 당신에게 +1을 얻을 것입니다).

미리 감사드립니다!

도움이 되었습니까?

해결책

Web application structure is defined by J2EE spec, it's not limited (or specific) to Tomcat per se. Here is a detailed tutorial covering its layout. Briefly, however, it's as follows:

  1. There a base (root, home, whatever you want to call it) folder which serves as root of web application, everything else goes under it.
  2. All public stuff (html, images, CSS, javascript, JSP, what have you) goes under that folder (directly or via subfolders).
  3. There's one special folder, also located directly under root, called WEB-INF. It contains non-public stuff, like application descriptor (web.xml), classes (which go into WEB-INF/classes folder), libraries (WEB-INF/lib) and possibly configuration files.
  4. Application can be deployed either using expanded structure above or as WAR (web archive) which is basically an archive containing everything above starting at root folder level (but not including root).

The distinction between classes and lib folders is simple: all packaged libraries (JAR files) need to go into lib; all unpackaged classes (and resource files that need to be in classpath) have to go into classes preserving their directory structure (e.g. com.mypackage.Blah class should go into classes/com/mypackage/)

In your case, it looks like you can only have one web application deployed and it has to be deployed to /html folder. If you're deploying a war file, you need to extract it to that directory (e.g. from within that /html folder run jar xvf solr.war or whatever it's called).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top