How to list files being used by the application
$ lsof -p <pid number>
$ pid=1337$ awk '!/\[/&&$6{_[$6]++}END{for(i in _)print i}' /proc/$pid/maps
Blog about middleware/ weblogic/ websphere hidden gems, problems and solutions, security issues and hacks
$ lsof -p <pid number>
$ pid=1337$ awk '!/\[/&&$6{_[$6]++}END{for(i in _)print i}' /proc/$pid/maps
${WLS_HOME}/common/bin
./config.sh
${WLS_BIN}/common/bin/config.sh
${WLS_HOME}/common/bin
./config.sh -mode=console
${WLS_BIN}/common/bin/config.sh -mode=console
$CATALINA_HOME/conf/server.xml<Server port="8005" shutdown="SHUTDOWN">
<Server port="8005" shutdown="SHUTDOWN">
<Server port="8008" shutdown="SECRETCOMMAND">
[me@me ~]$ telnet 192.168.1.3 8005
Trying 192.168.1.3...
Connected to 192.168.1.3.
Escape character is '^]'.
SHUTDOWN
Connection closed by foreign host.
|
WARNING: StandardServer.await: Invalid command 'SHUTDOWN' received
|
<Server port="8005" shutdown="SHUTDOWN">To
<Server port="8001" shutdown="SHUTDOWN">From now on only SHUTDOWN command issued on port 8001 (if not used by other application) will shutdown the instance. Port 8005 will not be used by this instance.
[me@me ~]$ telnet 192.168.1.3 8005
Trying 192.168.1.3...
telnet: connect to address 192.168.1.3: Connection refused
|
<Server port="8005" shutdown="SHUTDOWN">To
<Server port="-1" shutdown="SHUTDOWN">This will disable SHUTDOWN service/ command for good :)
[me@me ~]$ telnet 192.168.1.3 8005
Trying 192.168.1.3...
telnet: connect to address 192.168.1.3: Connection refused
|
When using Liferay on Tomcat + Apache/nginx you might experience a small Denial Of Service from time to time. In the most cases the issue is in Tomcat's configuration, well to be more precise - in lack of the configuration ;)
When defining an AJP connector on port 8009:
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" address="10.0.1.2" URIEncoding="UTF-8">
People often miss one important setting -connectiontimeout
andkeepAlivetimeout
.
connectiontimeout
- is the number of milliseconds Connector will wait, after accepting a connection, for the request URI to be presented. If no value is defined, then the value becomes: -1 (i.e. infinite).
KeepAliveTimeout
- is the number of milliseconds Connector will wait for another AJP request before closing the connection. The default value is to use the value that has been set for the connectiontimeout attribute.
Lack of this configuration might cause the DOS (Denial Of Service) of the application itself. Once you have fixed this problem be defining the settings mentioned above you might want to monitor number of connections to your application/Liferay and see if there is a high number of connections maintained or not.
That is why I have created small, not really intelligent, very slow, but working script to make your life easier :)
ENJOY! :)
https://github.com/wheelq/AJP.Stats
# ./apachectl startNo errors thrown, no process running. Even config test runs fine:
#ps -ef | grep httpd
#
$./apachectl configtestSyntax OK
#tail error_log
[Sun Feb 09 17:31:40 2014] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "test0"