apache
Deploying grails app to Jetty
by gregs on Mar.20, 2010, under *nix, apache, debian, grails, jetty
Short and sweet, step by step guide for creating a grails war and deploying it to your Jetty server (includes apache2 proxy steps)
- grails war (your app), in this case epic.war
- Copy to server
CODE:
-
scp epic.war user@server:/location
-
- On Debian the location for jetty webapps is: /var/lib/jetty/webapps
- Copy from upload location to the above folder (I used sudo)
- Change permissions:
CODE:
-
sudo chown jetty:adm epic-0-0.1.war
-
- created a *.xml context file in /etc/jetty/contexts, with something like this [note case is important!!]:
CODE:
-
<?xml version="1.0" encoding="ISO-8859-1"?>
-
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
-
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
-
<Set name="contextPath">/epic</Set>
-
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/epic-0-0.1.war</Set>
-
</Configure>
-
- restart jetty :
CODE:
-
sudo /etc/init.d/jetty restart
(try stop/start as well)
-
- test with :
CODE:
-
lynx http://localhost:8080/epic/
-
- Nice but I'd like http://localhost/epic/ so enable mod_proxy in apache if you haven't already :
CODE:
-
a2enmod proxy
-
- edit /etc/apache2/mods-enabled/proxy.load and if not present add at end:
CODE:
-
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
-
- edit your virtualhost conf file I am using 000-default and add:
CODE:
-
ProxyRequests Off
-
<Proxy *>
-
Order deny,allow
-
Allow from all
-
</Proxy>
-
ProxyPass /epic http://localhost:8080/epic
-
ProxyPassReverse /epic http://localhost:8080/epic
-
ProxyPreserveHost On
-
- restart apache :
CODE:
-
sudo /etc/init.d/apache2 restart
-
- now you can
CODE:
-
lynx http://localhost/epic/
-
Update: I had omitted the ProxyPreserveHost On from the Apache configuration, which resulted in css, images and external javascripts not loading. It also caused an issue with accessing controllers.
Sources:
Apache/SSL configuration (on debian)
by gregs on Mar.16, 2010, under *nix, apache, debian, ssl
More for posterity, this was the last step that was eluding me. I had found numerous resources to get me started on the path to setting up Apache and SSL, but when it came to having a working config and server, when I went to browse my Debian test server, I would get this message:
-
(Error code: ssl_error_rx_record_too_long)
When you google for the solution I found a number of dead ends, but in the comments for one of them there was a helpful pointer.
When you do an 'ls -la' on sites-enabled (inside /etc/apache2), you will see a symbolic link to the sites-available folder and typically just for the default site (000-default -> default). However in sites-available there's also a default-ssl config file. Creating a symbolic link to this file and reloading apache fixed my problem and now I have apache serving up http over SSL .
Upgrading to Lenny
by gregs on Mar.09, 2010, under *nix, MySQL, apache, debian, linode
It's been while since I attended to my VPS, I decided to spend some time last night upgrading my distribution from Etch to Lenny. This is normally a moment where your heart sinks as quite a few things do tend to go belly up, but I am happy to report that I only came across some minor issues and these were resolved in minutes as opposed to hours.
- MySQL : failed to start, complaining about:
CODE:
-
/etc/init.d/mysql: ERROR: Using expire_logs_days without log_bin crashes
-
the server. See README.Debian.gz
Commenting out the expire_logs_days in the my.cnf file allowed me to restart MySQL.
-
- After the upgrade of Apache, my virtual hosts weren't working. A quick search via Google pointed me to this post - a quick edit of all of my host files and it was all working again.
- the php-mysql connector somehow hadn't been upgraded/installed so a quick
CODE:
-
apt-get install php5-mysql
fixed that problem.
-
- OpenBD : the only thing that remains broken was my tomcat5.5 Open BD install. Tomcat was working fine but Open BD refused to start up complaining about :
CODE:
-
javax.servlet.ServletException: Open BlueDragon Engine Failed to initialise tags: java.awt.Color
Since I am not really using it, it's not that important, but at some stage I'd like to get it working again. If you have any suggestions, please leave a comment.
-
SVN : authentication with a windows domain
by gregs on Mar.08, 2010, under apache, svn
Finally got round to implementing this for work. As a starting point I followed the instructions found here.
The config looked fine, but after restarting the service, I still wasn't getting prompted for a log in. After re-jigging the order to what you see below and restarting the apache service (we are using 2.0.59), it all worked. Maybe this will help someone else along the way.
-
<Location /svn>
-
DAV svn
-
# any "/svn/foo" URL will map to a repository /usr/local/svn/foo
-
SVNParentPath {drive letter}:/path/to/SVN/epositories/
-
-
AuthName "SVN"
-
AuthType SSPI
-
SSPIAuth On
-
SSPIAuthoritative On
-
SSPIOfferBasic On
-
SSPIOmitDomain on
-
SSPIDomain <domain controller>
-
SSPIBasicPreferred On
-
Require valid-user
-
</Location>
Setting Cold Fusion up on Apache
by gregs on Oct.18, 2000, under ColdFusion, apache, web server
This post relates to configuring Cold Fusion 4.5 to run on Apache v1.3.12
This document is briefly going explain out how to configure your Apache web server to execute Cold Fusion pages. First off install the Cold Fusion application server (available from Allaire) normally. When the moment arrives to specify the location of your CF documentation and example files, select a directory of your preference (or if you have IIS running alongside Apache, simply accept the default path <drive letter>:INETPUB\wwwroot). After continue with the normal installation procedure.
Once this is done, shutdown your Apache web server (available from http://www.apache.org/). Next you will need to copy the following file ApacheModuleColdFusion.dll from the <drive letter>:CFUSION\bin directory to the modules sub-directory in your Apache installation (usually <drive letter>:Program Files\Apache Group\Apache\modules).
The next step requires you to edit your httpd.conf. Locate the section displayed below:
-
# Note: The order in which modules are loaded is important. Don't change
-
# the order below without expert advice.
-
#
-
#LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
-
#LoadModule cern_meta_module modules/ApacheModuleCERNMeta.dll
-
#LoadModule digest_module modules/ApacheModuleDigest.dll
-
#LoadModule expires_module modules/ApacheModuleExpires.dll
-
#LoadModule headers_module modules/ApacheModuleHeaders.dll
-
#LoadModule proxy_module modules/ApacheModuleProxy.dll
-
#LoadModule rewrite_module modules/ApacheModuleRewrite.dll
-
#LoadModule speling_module modules/ApacheModuleSpeling.dll
-
#LoadModule status_module modules/ApacheModuleStatus.dll
-
#LoadModule usertrack_module
-
#LoadModule modules/ApacheModuleUserTrack.dll
Once you have done so enter the following lines at the end of the above section so that the section should now look like this:
-
# Note: The order in which modules are loaded is important. Don't change
-
# the order below without expert advice.
-
#
-
#LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
-
#LoadModule cern_meta_module modules/ApacheModuleCERNMeta.dll
-
#LoadModule digest_module modules/ApacheModuleDigest.dll
-
#LoadModule expires_module modules/ApacheModuleExpires.dll
-
#LoadModule headers_module modules/ApacheModuleHeaders.dll
-
#LoadModule proxy_module modules/ApacheModuleProxy.dll
-
#LoadModule rewrite_module modules/ApacheModuleRewrite.dll
-
#LoadModule speling_module modules/ApacheModuleSpeling.dll
-
#LoadModule status_module modules/ApacheModuleStatus.dll
-
#LoadModule usertrack_module
-
#LoadModule modules/ApacheModuleUserTrack.dll
-
#Cold Fusion settings
-
LoadModule coldfusion_module modules/ApacheModuleColdFusion.dll
You are now nearly ready to test your Cold Fusion installation. All that remains to be done is to tell your Apache web server the location of your cfdocs/ directory. To do this edit your srm.conf file so that your file looks something like this:
-
#
-
# This is the default file for the ResourceConfig directive in httpd.conf.
-
# It is processed after httpd.conf but before access.conf.
-
#
-
# To avoid confusion, it is recommended that you put all of your
-
# Apache server directives into the httpd.conf file and leave this
-
# one essentially empty.
-
#
-
-
#Cold Fusion settings
-
Alias /cfdocs/ "<drive letter>:/<your installation directory>/cfdocs/"
At this point you should also be aware of the fact that the Apache web server is case sensitive. So there is a distinct difference between entering cfdocs and CFDOCS when specifying your alias name. You are now ready to restart your Apache web server (please note that if you are using the single user version for development purposes your Apache server has to work on port 8080, else Cold Fusion won't allow the execution of .cfm pages). Once the server is restarted you are ready to test your installation. Simply point your browser to http://<your domain or ip address>/cfdocs/index.htm. If the CF welcome page is served you have properly configured the cfdocs/ directory. Now just go to the Test installation page and test CF. For problems with CF please refer to your CF documentation. For the CF documentation on configuring Apache to serve CF pages check out the documentation that comes with the CF installation (if installed usually located at http://<server name>/cfdocs/ Administering_ColdFusion_Server/01_Installing_and_Configuring_ColdFusion/admin012.htm#1023844)