2016-10-16 1 views
0

제공된 스크립트 adminstart.sh와 startsite.sh에서 Broadleaf 데모 애플리케이션을 시작할 수있었습니다. 데이터베이스를 MySQl로 변경할 수도있었습니다. 그러나 Tomcat 인스턴스에서 실행할 수있는 전쟁을 만드는 방법을 이해할 수 없습니다.내 자신의 Tomcat 서버에 broadleaf 데모를 배포하는 방법은 무엇입니까?

나는 broadleaf가 일반적인 접근 방식과 다르게 작업을 수행함을 알았습니다. 일반적으로 컨텍스트 값을 파일 응용 프로그램 컨텍스트에 넣습니다. xml은 web.xml에서 참조됩니다. Tomcat context.xml을 수정할 필요가 없습니다.

<!-- Initialize spring mvc --> 
<servlet> 
    <servlet-name>admin</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <init-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value> 
      classpath:/applicationContext-servlet-open-admin.xml 
      classpath:/applicationContext-servlet-admin.xml 
      classpath:/applicationContext-servlet-cms-contentClient.xml 
      classpath:/applicationContext-servlet-cms-contentCreator.xml 
      classpath:/bl-menu-admin-applicationContext-servlet.xml 
      classpath*:/blc-config/admin/bl-*-admin-applicationContext-servlet.xml 
      /WEB-INF/applicationContext-servlet-admin.xml 
     </param-value> 
    </init-param> 
    <load-on-startup>1</load-on-startup> 
</servlet> 

결과 톰캣 인스턴스 콘텍스트가 포함된다 :이 예는 여러 문맥

<context-param> 
    <param-name>webAppRootKey</param-name> 
    <param-value>blAdmin.root</param-value> 
</context-param> 

<context-param> 
    <param-name>patchConfigLocation</param-name> 
    <param-value> 
     classpath:/bl-open-admin-contentClient-applicationContext.xml 
     classpath:/bl-open-admin-contentCreator-applicationContext.xml 
     classpath:/bl-admin-applicationContext.xml 
     classpath:/bl-cms-contentClient-applicationContext.xml 
     classpath:/bl-cms-contentCreator-applicationContext.xml 
     classpath*:/blc-config/admin/bl-*-applicationContext.xml 
     classpath:/applicationContext.xml 
     classpath:/applicationContext-email.xml 
     /WEB-INF/applicationContext-datasource.xml 
     /WEB-INF/applicationContext-admin-security.xml 
     /WEB-INF/applicationContext-admin-filter.xml 
     /WEB-INF/applicationContext-admin.xml 
    </param-value> 
</context-param> 

<context-param> 
    <param-name>shutdownHookMethod</param-name> 
    <param-value>forceFlush</param-value> 
</context-param> 

파라미터 플러스 web.xml의 부가가있는 광엽 구성에

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>classpath:spring/application-context.xml</param-value> 
</context-param 

인 데이터베이스 풀 구성을 제공하는 conf 디렉토리의 .xml :

신청서에 광대역을 사용하는 가장 좋은 방법은 무엇입니까?

답변

0

구성

  • 모두 lib 폴더/tomcat7하는
  • 열기 web.xml 파일을 MySQL의 JDBC 드라이버를 넣고,
  • DemoSite
  • 에서 사이트 관리자 모듈은 모두 web.xml을에 다음 코드를 추가합니다
<resource-ref> 
    <description>WEB</description> 
    <res-ref-name>jdbc/web</res-ref-name> 
    <res-type>javax.sql.DataSource</res-type> 
    <res-auth>Container</res-auth> 
</resource-ref> 

<resource-ref> 
    <description>STORAGE</description> 
    <res-ref-name>jdbc/storage</res-ref-name> 
    <res-type>javax.sql.DataSource</res-type> 
    <res-auth>Container</res-auth> 
</resource-ref> 

<resource-ref> 
    <description>SECURE</description> 
    <res-ref-name>jdbc/secure</res-ref-name> 
    <res-type>javax.sql.DataSource</res-type> 
    <res-auth>Container</res-auth> 
</resource-ref> 
창문
  • 열기 프롬프트 cmd 만든
 
keytool -genkey -alias tomcat -keyalg RSA -storepass password 
  • 열기 Tomcat7/conf의/server.xml에에게
  • 전환 명령하여 JDK_directory/bin으로 리눅스
  • 이동을위한 쉘 및 SSL에 대한 키 스토어를 생성하거나 SSL 스위칭을 사용하려면 다음 코드를 추가합니다 단지 기본 커넥터 포트 아래
<Connector 
    protocol="org.apache.coyote.http11.Http11NioProtocol" 
    port="8443" maxThreads="200" 
    scheme="https" secure="true" 
    SSLEnabled="true" 
    keystorePass="password" 
    clientAuth="false" 
    sslProtocol="TLS" 
    /> 
    에서 바람둥이
  • 에 대한 데이터베이스 또는
  • 구성 JNDI에 대한 값을
<user username="tomcat" password="password" roles="manager-gui"/> 
  • 채우기 database.properties을 다음
  • 열기 Tomcat7/conf/tomcat-users.xml 파일에
  • 추가하여 admin 또는 site 폴더에 target/tomcat-server-config/context.xml 파일이 있습니다.
  • 복사 tomcat7/conf의에이 파일/
  • 를 열고이 파일과 데이터베이스 라이프 사이클의 목표를 설치 당신의 IDE 시작 Maven 프로젝트에
username="${database.user}" : Replace with your database username (eg. broadleaf) 
password="${database.password}" : Replace with your database password 
driverClassName="${database.driver}" : Replace with your database classname (eg. org.postgresql.Driver) 
url="${database.url}" : Replace with your database URL with database path, port and name. (eg. jdbc:postgresql://localhost:5432/broadleaf) 
  • 값으로 (다음과 같은 속성을 대체 전체 프로젝트 또는 각 모듈의)
  • 이것은 각 모듈에 대한 전쟁을 만듭니다.
  • 시작 (시작 startup.bat/startup.s ~/tomcat7/빈에서 H /)
  • 앱 관리자로 이동하고
  • 배포 관리자 및 사이트 전쟁을 바람둥이-users.xml 파일에
  • 컨텍스트 경로를 추가 바람둥이 사용자 이름과 키를 입력 (예 : URL 매핑입니다./관리자 및/데모 현장)
  • XML 구성 URL이 타겟의 context.xml (예. ~/대상/바람둥이 - 서버의 conf/context.xml에)에 대한 전체 경로입니다
  • WAR 디렉토리에 전체 경로입니다 대상 디렉토리에 전쟁이

  • 업데이트 생성에서 development.properties에 에게 blPU.hibernate.hbm2ddl.auto을 변경하는 것을 잊지 마세요 -

  • (독립 바람둥이 테이블을 작성하는 문제가 그 postreSQL 내의 expirience입니다)
+0

Zildyan,이 단계를 시도하고 성공 했습니까? ul? –

+1

Ofcourse - 하루 종일 보냈습니다. 어쩌면 기억에서 대답을 썼기 때문에 나는 무엇인가 놓쳤다. 당신은 여기에서 좋은 시작을 가지고 있습니다. 좀 더 검색하십시오. 내가 만든다면, 당신도 그것을 할 수 있습니다;) – Zildyan

관련 문제