- Download+install Java (preferrably Java6 SDK). Setup
$JAVA_HOME
environmental variable accordingly, so that$JAVA_HOME/bin/java
is the JVM executable. For linux, package managers now offer sun-java-* packages, you'd better AVOID the gcj stuff, for maximum compatibility. - Download+install MySQL. Again, linux distros have packages in default repos. Edit the MySQL configuration file (
/etc/mysql/my.cnf
or whatever), so that, under "[mysqld]
", you COMMENT the "skip-networking
" option and give a good bind address (127.0.0.1 is safest). Part of the file will look like[mysqld]
The example listens only on the local loopback interface, change for use with remote tomcat. In general, test access to your mysql daemon with "
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/English
bind-address = 127.0.0.1
# skip-networkingtelnet localhost 3306
", or such. - Download+install Tomcat-5.5, preferrably the zip package. Linux distros offer tomcat packages. Consider
$CATALINA_HOME
to be the installation path, so that$CATALINA_HOME/bin/startup.sh
starts the server. Tomcat requires special administration: - Download the MySQL JDBC connector, and place the JAR file in
$CATALINA_HOME/common/lib
, for all webapps to see. Keep in mind that the MySQL driver class iscom.mysql.jdbc.Driver
. - See to that the Security Manager lets the driver create a socket to the listening server port, by adding a policy entry to
$CATALINA_HOME/common/conf/catalina.policy
:grant codeBase "jar:file:/path/to/tomcat5.5/common/lib/mysql-connector-java-5.1.5.jar!/-" {
//permission java.net.SocketPermission "localhost:", "connect";
//permission java.net.SocketPermission "127.0.0.1:3306", "connect";
//permission java.net.SocketPermission "127.0.0.1:3306", "resolve";
permission java.security.AllPermission ;
}; - For development, NetBeans 6.1 is good, Eclipse offers some not-so-good plugins, and Vi is always a safe choice.
Stuff I find in the internet,
ideas, comments, references,other issues, that worth saving.
A geek's blog site.
Wednesday, May 14, 2008
My first webapp, Walkthrough pt2: Server configuration
In order to prepare a system for the db-enabled webapp, follow the steps below:
Subscribe to:
Post Comments (Atom)
1 comment:
αχ ναι liebe τι ωραια που τα λες
Post a Comment