background preloader

Linux

Facebook Twitter

Enable securitymanager for Spring and Hibernate - Sevagas. I.

Enable securitymanager for Spring and Hibernate - Sevagas

Tomcat security manager. The basis of Java security is to enable the security manager. The security manager allows you to associate a given code (a webapp, a .class, a jar, etc) to one or more authorizations (ex. write on disk, connect to distant host, read properties, use reflection, etc). The complete list can be found here The problem with the Java security manager is that contrary to the C language, the Java language security is not on the front scene. On a Tomcat application server, the config file that is used by the security manager can be found at $TOMCAT_HOME/conf/catalina.policy. Note: Remember that tomcat must be started with the -security option to activate the security manager. You can read more info related to Tomcat security manager here. II.

The Spring and the Hibernate framework are widely used in modern J2SE and JEE applications. II.2 Allow dependency injection. Giving reflection permissions access to a jar file is not an insignificant act. Magnus K Karlsson: Writing to Syslog with Log4J and Testing It on Ubuntu 9.04 Jaunty. The preferred way to log in Linux is to write to the Syslog.

Magnus K Karlsson: Writing to Syslog with Log4J and Testing It on Ubuntu 9.04 Jaunty

For you that comes from the Windows world, Syslog is the equivalent for the Windows NT Event Log. Before you can ran the example below you need to enable Syslog Facility LOCAL1 on Ubuntu. The Facility can be looked as a filter and if you are running multiple programs on the same server, you might want to consider to let each program write to different Facility LOCAL[0-7]. To enable Facility LOCAL1 on Ubuntu 9.04 you first need to edit /etc/syslog.conf >sudo gedit /etc/syslog.conf & and add the following line local1.* /var/log/local1.log But we are not done yet, since Log4J org.apache.log4j.net.SyslogAppender is using the underlying writer class org.apache.log4j.helpers.SyslogWriter that is using the java.net.DatagramPacket which is writing to the syslog remotely, we need to enable remote access to Syslog. >sudo gedit /etc/default/syslogd & And changing the following: SYSLOGD="-r"

Chapter 10. System Log Management and Monitoring. As useful and ubiquitous as syslog is, it's beginning to show its age.

Chapter 10. System Log Management and Monitoring

Modern Unix and Unix-like systems are considerably more complex than they were when syslog was invented, and they have outgrown both syslog's limited facilities and its primitive network-forwarding functionality. Syslog-ng ("syslog new generation") is an attempt to increase syslog's flexibility by adding better message filtering, better forwarding, and eventually (though not quite yet), message integrity and encryption. In addition, Syslog-ng supports remote logging over both the TCP and UDP protocols. Syslog-ng is the brainchild of and is primarily developed and maintained by Balazs ("Bazsi") Scheidler. Lest you think Syslog-ng is untested or untrusted, it's already been incorporated into Debian GNU/Linux 2.2 "Potato" as a binary package (in the "admin" section). 10.2.1 Compiling and Installing Syslog-ng from Source Code First, you need to obtain the latest Syslog-ng source code.

Finding a File containing a particular text string in Linux server. I have been using Linux for a while on my server and have a large collection of the text file everywhere.

Finding a File containing a particular text string in Linux server

I'm interested in learning about searching a text string. Can you tell me - how do I find a file containing a particular text string on my Linux server? I have to admit that there are tens and thousands of text files on any Linux or Unix based server. Finding and locating those files can be done with the find command. Unfortunately find command cannot look inside a text file for a string. You need to use the grep command. The syntax is: grep "text string to search” directory-path grep [option] "text string to search” directory-path grep -r "text string to search” directory-path grep -r -H "text string to search” directory-path egrep -R "word-1|word-2” directory-path egrep -w -R "word-1|word-2” directory-path Examples Task: Search all subdirectories recursively Task: Only display filenames By default, the grep command prints the matching lines.