ColdFusion 10 Dev Edition, Mac, Tomcat

27 views
Skip to first unread message

Marc Funaro

unread,
Dec 18, 2015, 9:34:14 AM12/18/15
to cfu...@googlegroups.com

Hi All,

I recently switched to Mac, and am running El Cap. I have installed ColdFusion 10 developer edition, with internal web server, which is currently Tomcat 7.0.64. I have installed all updates to the ColdFusion server. The CF Administrator on locahost works fine, and i set up port forwarding so that calls in the browser (port 80) are forwarded to the default CF/Tomcat configured port of 8500. This is all working fine.

The way i've worked in windows was pretty straightforward - if i had a website www.example.com, i would set up a local name in HOSTS called www-example-com, and create that host in IIS. This naming convention has been followed for over 30 websites, and has worked well, and i wish to duplicate it with my local CF/Tomcat configuration.

I am editing the file /Applications/ColdFusion10/cfusion/runtime/conf/server.xml, and thought that simply adding another block would do the trick, but instead i get an error when i try to start ColdFusion up. Without my added block, it works fine. I have provided my current server.xml file below, with my added block. The error I see during startup is:

WARNING: Catalina.start using /Applications/ColdFusion10/cfusion/runtime/conf/server.xml

org.xml.sax.SAXParseException: Element type "Valve" must be followed by either attribute specifications, ">" or "/>".

I also understand that editing server.xml directly is not recommended, and in fact it would be nice to have each site's/host's XML file for their Tomcat configuration exist somewhere in their individual directory structure.

My planned directory structure for each site is:

/Sites/www-example-com

 

/Sites/www-example-com/files/private (not web accessible; subdirectories for various private files the site may use, including perhaps tomcat xml config files, etc)

 

/Sites/www-example-com/files/public (virtual directory, mapped to appear directly under web root)

 

/Sites/www-example-com/www (the root web application directory)

But to avoid possible permissions issues, i placed my first web application under the directory that appears in my added host below.

So what do i need to do to get the configuration i'm looking for? Or am i editing the wrong file(s) altogether, considering tomcat is bundled with CF? (I don't think that matters, since it's still using the same server.xml file and i don't think they've screwed up tomcat in any way.)

            <?xml version='1.0' encoding='utf-8'?>

 

            <Server port="8007" shutdown="SHUTDOWN">

 

              <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />

              <Listener className="org.apache.catalina.core.JasperListener" />

              <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />

              <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

 

              <GlobalNamingResources>

                <Resource name="UserDatabase" auth="Container"

                          type="org.apache.catalina.UserDatabase"

                          description="User database that can be updated and saved"

                          factory="org.apache.catalina.users.MemoryUserDatabaseFactory"

                          pathname="conf/tomcat-users.xml" />

              </GlobalNamingResources>

 

              <Service name="Catalina">

 

                <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"

                    maxThreads="150" minSpareThreads="4"/>

 

                <Connector executor="tomcatThreadPool" maxThreads="50"

                           port="8500" protocol="org.apache.coyote.http11.Http11Protocol"

                           connectionTimeout="20000"

                           redirectPort="8445" />

 

                <Connector port="8012" protocol="AJP/1.3" redirectPort="8445" tomcatAuthentication="false" />

 

 

                <Engine name="Catalina" defaultHost="localhost" jvmRoute="cfusion">

 

 

 

                  <Realm className="org.apache.catalina.realm.LockOutRealm">

                    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

                           resourceName="UserDatabase"/>

                  </Realm>

 

                    <Host name="localhost"  appBase="webapps"

                            unpackWARs="true" autoDeploy="false">

 

                        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

                            prefix="localhost_access_log." suffix=".txt"

                            pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>

 

                    </Host>

 

 

                    <!-- START: the block i tried to add -->

                    <Host name="www-example-com" appBase="/Applications/ColdFusion10/cfusion/www-example-com/www"

                            unpackWARs="false" autoDeploy="false">

 

                        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

                            prefix="localhost_access_log." suffix=".txt"

                            pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>

 

                    </Host>

                    <!-- END: the block i tried to add -->

 

 

                </Engine>

              </Service>

            </Server>

 

 

 

 

Marc Funaro

Advantex LLC

607-336-6895

 

 

Pete Freitag

unread,
Dec 18, 2015, 10:55:41 AM12/18/15
to cfu...@googlegroups.com
Hi Marc

I use Apache for this on Mac since tomcat is not so easy to configure virtual hosts. Is there a reason you are not using Apache or did Tomcat just seam like it might be an easier way to go?

As for your error it simply sounds like an XML issue, you can paste the file into a XML validator (just google xml validator for several options) to find this issue. I know for example if you happened to use a CFML comment <!--- cfml commnet ---> instead of an <!-- xml comment --> it could cause it to not start.

Also for specifying your web root, you are on the right track - server.xml would be the place to do it, but I think you want to do it like this:

<Host name="www-example-com" appBase="webapps"

    unpackWARs="false" autoDeploy="false">

    

    <Context path="" docBase="/Applications/ColdFusion10/cfusion/www-example-com/www" />


</Host>


The appBase should be webapps and the docBase should be your web root specified in the child Context tag. The valve tag you had was optional.


--
You received this message because you are subscribed to the Google Groups "Central New York ColdFusion Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfugcny+u...@googlegroups.com.
To post to this group, send email to cfu...@googlegroups.com.
Visit this group at https://groups.google.com/group/cfugcny.
For more options, visit https://groups.google.com/d/optout.

Marc Funaro

unread,
Dec 18, 2015, 11:26:22 AM12/18/15
to cfu...@googlegroups.com

Thanks Pete,

 

I just installed CF10 Dev edition with internal web server, thinking that it would be fast and easy.

 

I tried every combination of what you said below already, including making sure my XML file was valid.  The error message really is a bogus one, it seems, as I literally copied those sections from working areas in the file and simply modified the parameters. No foreign/hidden characters/fancy quotes issues, etc.


I got close when I removed the Valve tag – at least it would accept the file and start up.  But entering http://www-example-com in my browser just led to a 404.  I’d have thought someone would have needed to do this already and had a process I could rip off, but I guess not.  I had also read that on a default Tomcat install, additional xml files might be at play, but who knows.  I really want to make the switch but this has sucked up a LOT of hours.

 

Should I be trying ColdFusion 11 instead, you think? My production environment is still CF10, but if I can dev locally like I want with 11, I’d try it…

Pete Freitag

unread,
Dec 18, 2015, 11:41:56 AM12/18/15
to cfu...@googlegroups.com
Marc, CF10 or CF11 will make no difference here. They use the same version of Tomcat. 

I think going with Apache will be alot easier to work with. Mac comes with Apache already, you just have to start it:

sudo apachectl start

You will want to turn off your port forwarding (80 -> 8500) otherwise it will probably tell you the address is already in use (since apache runs on port 80 by default).

To install the CF connector you go to your /ColdFusion10/cfusion/runtime/bin folder and run wsconfig, this will bring up a window just like on windows. The apache config dir is located at /etc/apache2 and you can find tons of information about configuring apache to suite your needs.


--
Pete Freitag
https://foundeo.com/ - ColdFusion Consulting & Products
http://hackmycf.com - CFML Server Security Scanner

Marc Funaro

unread,
Dec 18, 2015, 1:00:19 PM12/18/15
to cfu...@googlegroups.com

Where does Tomcat figure into the equation, if I use the built-in apache install?  Turning off the port forwarding is easy ‘nough of course.  Should I uninstall CF, get apache running, then re-install CF?

Marc Funaro

unread,
Dec 18, 2015, 1:03:20 PM12/18/15
to cfu...@googlegroups.com

Also, does anyone know if “apptacular” is still a viable plugin for CFBuilder?  I just downloaded CFB3, and I see reference to that plug on the start page, but it doesn’t seem to go anywhere. I could really use a quick scaffolding app right now, as I’m behind  on something and that would give me a jump start…

Pete Freitag

unread,
Dec 18, 2015, 7:22:00 PM12/18/15
to cfu...@googlegroups.com
Hi Marc 

The wsconfig tool takes care of connecting apach and tomcat for you. 

Don't reinstall CF - infact you want to make sure you have installed all hotfixes first so you have the latest wsconfig.


--
Reply all
Reply to author
Forward
0 new messages