Archive for the 'web' Category

Oct 01 2009

Configure Glassfish with Apache on Debian

Published by Forager under web

I can’t believe how much time I spent on this simple task … couldn’t find a straight answer anywhere. Hope this posting may help some other souls looking for the same thing -

Goal -
Setup a production environment that includes -
Debian (5.0.3) OS (Lenny)
Java SE 5 (1.5x)
MySQL 5.0.50+ (already installed)
Apache2 as Web server, SSL enabled
Sun Glassfish application server connecting through
mod_proxy, AJP

The problem
Getting Glassfish to talk to Apache2

Steps:
1. To get rid off Apache2 startup warnings “apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName”
edit /etc/apache2/httpd.conf add:
ServerName localhost
restart:
/etc/init.d/apache2 restart

1. Components needed
apt-get install apache2
apt-get install mysql-server
apt-get install openjdk-6-jdk
apt-get install libapache2-mod-proxy-html

2. To install and enable SSL (for dev/test only. Not for production site where a real certificate is needed!)
a2ensite default-ssl
a2enmod ssl

For production, read the document that comes with apache2 -
/usr/share/doc/apache2.2-common/README.Debian

3. Enable proxy ajp
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_html
a2enmod proxy_ajp
a2enmod proxy_balancer

4. Install Glassfish
Add user -
useradd -d /home/glassfish -g apptest glassfish

java -jar -mx1024M glassfish-installer-v2.1-b60e-linux.jar
mv glassfish /usr/local/.
chown -R glassfish /usr/local/glassfish
chgrp -R apptest /usr/local/glassfish
login as “glassfish”
java -jar -mx1024M glassfish-installer-v2.1-b60e-linux.jar
mv glassfish /usr/local/.
chmod 755 /usr/local/glassfish/lib/ant/bin/ant
cd /usr/local/glassfish
/opt/glassfish/lib/ant/bin/ant -f setup.xml
Add glassfish to /etc/init.d (see bottom)
Add to auto restart -
update-rc.d glassfish defaults

5. Config ajp for Apache
vi /etc/apache2/mods-enabled/proxy.conf
Change “Deny from All” to “Allow from All”
Change to -
#ProxyVia On

<Location /minnow>
Order allow,deny
Allow from all
ProxyPass ajp://localhost:8009/minnow
ProxyPassReverse ajp://localhost:8009/minnow
</Location>

6. Config ajp for Glassfish
cp commons-logging-1.1.1.jar commons-modeler-2.0.1.jar tomcat-ajp.jar /usr/local/glassfish/lib
(Find the jar files somewhere)
cd /usr/local/glassfish
bin/asadmin start-domain domain1

7. Config. application
From GUI – always go to http://server:4848
Go to left bar, Configuration/System Properties (see Manual alternative below)
Go to left bar
Applicaton Server/JVM Settings/JVM Options
Add new option -
-Dcom.sun.enterprise.web.connector.enableJK=8009

Manual -
vi /usr/local/glassfish/domains/domain1/config/domain.xml
search for where it says -
</management-rules>
</config>
<!– config model with name “server-config” ends –>
</config>

Insert
<system-property name=”wicket.configuration” value=”deployment”/>
(and more)
between management-rules and config

** NOTE **
For dev – REMOVE ALL IP-related entries and then restart!

————-/etc/init.d/glassfish——————————————
#! /bin/sh
### BEGIN INIT INFO
# Provides:          glassfish
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop glassfish application server
### END INIT INFO

GLASSFISHPATH=/usr/local/glassfish/bin

case “$1″ in
start)
echo “starting glassfish from $GLASSFISHPATH”
su – glassfish $GLASSFISHPATH/asadmin start-domain domain1
;;
restart)
$0 stop
$0 start
;;
stop)
echo “stopping glassfish from $GLASSFISHPATH”
su – glassfish $GLASSFISHPATH/asadmin stop-domain domain1
;;
*)
echo $”usage: $0 {start|stop|restart}”
exit 3
;;
esac

No responses yet

Jul 20 2009

This Blog’s RSS Feed Is Being Hijacked

Published by Administrator under web

When I use RSS aggregator to read my own blog, there is always some spam messages around. It started about a couple of month ago. If I set the feed option to display whole text, then the spam message has a link to a “imaginaria.com.ar” site (Argentinian?) If I set the feed option to display only the summary, then the spam appears on the first message that doesn’t have an “excerpt” field.

Update: actually, only Google Reader and My Yahoo! … Client programs don’t seem to have this problem, or when I just type in http://wuyibing.com/feed directly on my browser.

It is driving me crazy now. WordPress is nice. But like all nice things, it is so only when it is working.

Latest: solution found – (see also http://wordpress.org/support/topic/282365?replies=3)

Read the newer postings in http://groups.google.com/group/google-reader-troubleshoot/browse_thread/thread/39a7eef288c65dd0.

Search for comments from the users “Today I read … something” and “John Wennerberg”.

In short, here is what you need to do:
1. Find a database client and use it to connect to your WP database directly. If you do not know how to do this, ask your ISP for help.
2. Search in the wp_options table and delete rows whose “optiona_name” field looks like: rss_[a long hex number] (some with _ts suffix)
3. Search in the wp_users table, if you find a suspicious user (e.g. url is www.com or email you don’t recognize), delete it

Also, I would not search or try a plugin unless I know for sure it is safe. It looks like plugin is a backdoor for unauthorized content to sneak into the system.

I would also disallow anyone to register with the site.

Many thanks to the contributors on the Google Group thread.

One response so far

Apr 13 2009

Video Test

Published by Forager under to be refined, web

Here are some video tests:

First it is just the raw downloadable video.

Next is a embedded one–right mouse click to play:

No responses yet

Next »