Tomcat8 Произошла ошибка 'mkdir: не удалось создать каталог ``: Нет такого файла или каталога' - PullRequest
0 голосов
/ 10 февраля 2020

Я пытаюсь создать WebServer с Tomcat8 + Apache.

Я сделал Tomcat01 от Tomcat8, но tomcat01 не работает.

Tomcat8 работает нормально, и я просто редактирую некоторые опции для tomcat01, который только что скопирован из tomcat8.

/ etc / default / tomcat01

# You may pass JVM startup parameters to Java here. If unset, the default
# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
#
# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
# response time). If you use that option and you run Tomcat on a machine with
# exactly one CPU chip that contains one or two cores, you should also add
# the "-XX:+CMSIncrementalMode" option.
JAVA_OPTS="-Dlog.nameattach=01 -Djava.awt.headless=true -Xmx512m -XX:+UseConcMarkSweepGC -Djava.security.egd=file:/dev/./urandom"

/ var / lib / tomcat01 / conf / server. xml

<Server port="8001" shutdown="SHUTDOWN">

        <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> 
        <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
        <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
        <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

        <Service name="Catalina">

<!-- for web socket
        <Connector port="8101" protocol="org.apache.coyote.http11.Http11NioProtocol"
                URIEncoding="UTF-8" maxConnections="10000" acceptCount="300"
                connectionTimeout="-1"
                 redirectPort="443" />
 -->

                <Connector port="8011" protocol="AJP/1.3" redirectPort="443"
                        URIEncoding="UTF-8"
                        maxThreads="1024"
                        maxPostSize="-1"
                />

                <Engine name="Catalina" defaultHost="localhost">
                        <Host name="localhost"  appBase="/jnc/webapps"
                                unpackWARs="true" autoDeploy="false"
                                xmlValidation="false" xmlNamespaceAware="false">
                        </Host>
                </Engine>

        </Service>

</Server>

Я ничего не изменил, но выше.

Что я сделал:

# cp /etc/default/tomcat8 /etc/default/tomcat01
# vi /etc/default/tomcat01
-> JAVA_OPTS="-Dlog.nameattach=01 -Djava.awt.headless=true -Xmx512m -XX:+UseConcMarkSweepGC -Djava.security.egd=file:/dev/./urandom"
# cp /etc/init.d/tomcat8 /etc/init.d/tomcat01
# systemctl daemon-reload
# cp -a /var/lib/tomcat8 /var/lib/tomcat01
# cp -a /usr/share/tomcat8 /usr/share/tomcat01
# rm /var/lib/tomcat01/conf
# mkdir /var/lib/tomcat01/conf
# cp -a /etc/tomcat8/* /var/lib/tomcat01/conf/
# rm /var/lib/tomcat01/work
# mkdir /var/lib/tomcat01/work
# vi /var/lib/tomcat01/conf/server.xml 
-> uphead, server.xml
# /etc/init.d/tomcat01 restart 
-> and error occured.

И ошибка, когда я /etc/init.d/tomcat01 restart Ошибка (systemctl status tomcat01.service) :

# systemctl status tomcat01.service
● tomcat01.service - LSB: Start Tomcat 01.
   Loaded: loaded (/etc/init.d/tomcat01; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-02-10 15:33:48 KST; 1min 17s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 55861 ExecStart=/etc/init.d/tomcat01 start (code=exited, status=1/FAILURE)

Feb 10 15:33:48 systemd[1]: Starting LSB: Start Tomcat 01....
Feb 10 15:33:48 tomcat01[55861]:  * Starting Tomcat 01 servlet engine tomcat01
Feb 10 15:33:48 tomcat01[55861]: mkdir: cannot create directory ‘’: No such file or directory
Feb 10 15:33:48 tomcat01[55861]:  * could not create JVM temporary directory
Feb 10 15:33:48 systemd[1]: tomcat01.service: Control process exited, code=exited status=1
Feb 10 15:33:48 systemd[1]: Failed to start LSB: Start Tomcat 01..
Feb 10 15:33:48 systemd[1]: tomcat01.service: Unit entered failed state.
Feb 10 15:33:48 systemd[1]: tomcat01.service: Failed with result 'exit-code'.

Когда я journalctl -xe:

Feb 10 16:25:42 systemd[1]: Stopped LSB: Start Tomcat..
-- Subject: Unit tomcat8.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tomcat8.service has finished shutting down.
Feb 10 16:26:28 kernel: [UFW BLOCK] IN=ens33 OUT= MAC=01:00:~:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=28 TOS=0x00 PREC=0xC0 TTL=1 ID=57389 PROTO=2
Feb 10 16:26:29 kernel: [UFW BLOCK] IN=ens33 OUT= MAC=01:00:~:08:00 SRC=192.168.0.138 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=18689 PROTO=2
Feb 10 16:26:30 kernel: [UFW BLOCK] IN=ens33 OUT= MAC=01:00:~:08:00 SRC=192.168.0.131 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=22838 PROTO=2
Feb 10 16:28:28 kernel: [UFW BLOCK] IN=ens33 OUT= MAC=01:00:~:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=28 TOS=0x00 PREC=0xC0 TTL=1 ID=57390 PROTO=2
Feb 10 16:28:29 kernel: [UFW BLOCK] IN=ens33 OUT= MAC=01:00:~:08:00 SRC=192.168.0.104 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=16876 PROTO=2
Feb 10 16:28:30 systemd[1]: Stopped LSB: Apache2 web server.
-- Subject: Unit apache2.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has finished shutting down.
Feb 10 16:28:30 systemd[1]: Stopped LSB: Start Tomcat 01..
-- Subject: Unit tomcat01.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tomcat01.service has finished shutting down.
Feb 10 16:28:30 systemd[1]: Starting LSB: Start Tomcat 01....
-- Subject: Unit tomcat01.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tomcat01.service has begun starting up.
Feb 10 16:28:30 tomcat01[1853]:  * Starting Tomcat 01 servlet engine tomcat01
Feb 10 16:28:30 tomcat01[1853]: mkdir: cannot create directory ‘’: No such file or directory
Feb 10 16:28:30 tomcat01[1853]:  * could not create JVM temporary directory
Feb 10 16:28:30 systemd[1]: tomcat01.service: Control process exited, code=exited status=1
Feb 10 16:28:30 systemd[1]: Failed to start LSB: Start Tomcat 01..
-- Subject: Unit tomcat01.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tomcat01.service has failed.
--
-- The result is failed.
Feb 10 16:28:30 systemd[1]: tomcat01.service: Unit entered failed state.
Feb 10 16:28:30 systemd[1]: tomcat01.service: Failed with result 'exit-code'.
Feb 10 16:28:30 systemd[1]: Starting LSB: Apache2 web server...
-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun starting up.
Feb 10 16:28:30 apache2[1893]:  * Starting Apache httpd web server apache2
Feb 10 16:28:30 apache2[1893]: AH00557: apache2: apr_sockaddr_info_get() failed for 
Feb 10 16:28:30 apache2[1893]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Feb 10 16:28:31 apache2[1893]:  *
Feb 10 16:28:31 systemd[1]: Started LSB: Apache2 web server.
-- Subject: Unit apache2.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has finished starting up.
--
-- The start-up result is done.
Feb 10 16:28:31 kernel: [UFW BLOCK] IN=ens33 OUT= MAC=01:00:~:08:00 SRC=192.168.0.131 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=22839 PROTO=2

Спасибо за помощь.

...