intellij에서 톰캣 연동

maven 프로젝트에서 plugin 추가

<build>
   <plugins>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.3</version>
         <configuration>
            <source>1.7</source>
            <target>1.7</target>
         </configuration>
      </plugin>
      <plugin>
         <groupId>org.apache.tomcat.maven</groupId>
         <artifactId>tomcat7-maven-plugin</artifactId>
         <version>2.2</version>
         <configuration>
            <path>myProject</path>
         </configuration>
      </plugin>
   </plugins>
</build>

 

빌드 설정에서 command line에서

tomcat7:run

추가 및

http://localhost:8080/myProject/

접속

tomcat manager

/etc/tomcat7/tomcat-users.xml에서

<tomcat-users>
 <role rolename="manager-gui"/>
 <role rolename="manager-script"/>
 <user username="myManagerId" password="secretP^wd" roles="manager-gui,manager-script"/>
</tomcat-users>

추가

 

로컬 ip만 허용

/etc/tomcat7/Catalina/localhost/manager.xml
/etc/tomcat7/Catalina/localhost/host-manager.xml

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.0\.0\.1" denyStatus="404"/>

추가

 

-참고-

Caused by: java.io.FileNotFoundException: http://localhost:8080/manager/text/list

이 에러가 나오는 경우 tomcat7-admin 설치

post app 만들기

node_modules 추가하기
npm install --save-dev style-loader css-loader
npm install --save jquery react-addons-update react-router react-timeago redux react-redux redux-thunk

npm start

 

router v4 적용
npm install --save react-router-dom
https://blueshw.github.io/2017/06/22/static-routing-vs-dynamic-routing/

구글로그인 적용
https://developers.google.com/identity/sign-in/web/reference
https://developers.google.com/identity/sign-in/web/build-button

 

 

tomcat subdomain root path 분리

  1. /etc/tomcat7/server.xml에 호스트 추가
    <Host name="dev.xargus.center"  appBase="webapps"
    
                unpackWARs="true" autoDeploy="true">
    
     </Host>
  2. /etc/tomcat7/Catalina/dev.xargus.center폴더에 ROOT.xml 추가
    <?xml version="1.0" encoding="UTF-8"?>
    
    <Context
    
      docBase="/home/xargus/dev/webapps"
    
      privileged="true">
    
    </Context>
  3. 같은 폴더에 host-manager.xml추가
    <?xml version="1.0" encoding="UTF-8"?>
    
    <Context path="/host-manager" 
    
     docBase="/home/xargus/dev/webapps/host-manager" 
    
     antiResourceLocking="false" privileged="true" />
  4. 같은 폴더에 manager.xml 추가
    <?xml version="1.0" encoding="UTF-8"?>
    
    <Context path="/manager" 
    
     docBase="/home/xargus/dev/webapps/manager" 
    
     antiResourceLocking="false" privileged="true">
    
     <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.0\.0\.1" />
    
    </Context>
  5. /home/xargus/dev/webapps에 작업

 

-참고-

기존 webapps path :  /var/lib/tomcat7/webapps