Home  >  Q&A  >  body text

java - pom.xml文件中如何配置tomcat,使我这个服务只能被一个固定ip访问

PHP中文网PHP中文网2741 days ago543

reply all(3)I'll reply

  • 迷茫

    迷茫2017-04-18 10:03:53

    This thing should be restricted directly from the server. Why do it need to be done in tomcat

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:03:53

    The fixed IP is the IP of your machine

    reply
    0
  • 阿神

    阿神2017-04-18 10:03:53

    Your idea is wrong. The configuration in your pom is the configured maven plug-in.
    Do you want to execute it on your server maven tomcat:run? Maven should not be installed on your server, right?

    What you need to adjust is the server.xml file of the tomcat you are running on the server,

    In <Engine>里面新添加一个<host>, like this:

    <Host name="xxx.com" appBase="/var/www/demo"
           unpackWARs="true" autoDeploy="true"
           xmlValidation="false" xmlNamespaceAware="false"></Host>
    

    reply
    0
  • Cancelreply