coldbox on ubuntu 16.04 & 503 Service Unavailable

Hello there.
I need some pointers on how to fix 503 Service Unavailable

I installed Apache2, Java 1.8, Commandbox, Coldbox on Ubuntu 16.04 (DigitalOcean). I created a new conf file that properly redirects to /var/www/

Here’s my conf file

<VirtualHost *:80>

DocumentRoot /var/www/

<Directory “/var/www/”>
Require all granted
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all

<Proxy >
Allow from

RewriteEngine On
DirectoryIndex index.cfm
ProxyPreserveHost On
ProxyPassMatch ^/([cm])(/.
)?$ ajp://localhost:8009/$1$2
RewriteCond %{SERVER_NAME}
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

I enabled rewrite, proxy, proxy_http, proxy_ajp

I don’t get any errors when I run service apache2 restart

I started lucee in my coldbox without any problem (running) → /var/www/

I get the 503 message.

I read on StackOverflow that I need to add

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" 
           connectionTimeout="10000" keepAliveTimeout="10000" />

to tomcat server.xml

but I can’t find tomcat anywhere.

A friend of mine told that it was installed together with lucee when I installed coldbox.

I would really appreciate it if somebody helped me fix the problem.


You can try “find / -name *server.xml” :slight_smile:

Thanks, but it’s not there :frowning:

CommandBox has its own server, which is not Tomcat, so you won’t find Tomcat’s server.xml unless you install it.


If you don’t care about using Tomcat, you can enable AJP for the server you start from CommandBox, and it would work with that Apache config.

Do you know of any tutorials or sites that describe how to do it? I did some research on the net but I haven’t found anything that would make sense to me. I’m rather new to the whole server setup thing.


I'm sure it's covered somewhere in the docs (Ortus is just cool like
that), so you might want to take a look at them, but assuming you're
doing something like:

box server start

You'd just add an argument to it:

box server start runwarArgs="--ajp-port 8009"

(I think that'll work... I didn't test it though.) The default port is
8009, so you could also just do:

box server start runwarArgs="--ajp-enable true"

And _really_, you should just be able to (but you can't, so don't) do:

box server start AJPEnable=true

Which was what I was going to suggest first, but a quick peek at my
local sources says we don't expose AJP enabling/port setting directly,
and we should... if you'd like to create a ticket for the ability to
enable AJP and set the port a tiny bit easier (there's nice
tab-completion if we do that) feel free. I'll try to remember to add
'em next time I'm in there, but no promises without a ticket. :slight_smile:

I'm pretty sure you've only got to set it once too, and it'll be stored
in the config for the server, so thereafter you can just do "server
start" and have that setting picked up.

Hopefully that'll get ye going, and if not, give a holler.


Thank you so much.

server start runwarArgs="–ajp-port 8009"

You’re awesome, den.

Have a great Sunday.

I’ve been thinking about making AJP a first class citizen for a while. I’d love a ticket and/or pull request. All the changes would be in the ServerService.cfc inside CommandBox. Take another setting like SSLEnable and just find every reference to it in the file and add the same basic lines of code for the AJP setting. :slight_smile:



ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

ColdBox Platform: