Using Lucee Server with Command Box problems accessing Server Administration page

2.3k Views Asked by At

I recently downloaded CommandBox to try to set up a Lucee Server. I have a folder called LuceeSever with an Index.cfm page. When I type the command "box server start" it opens a window at this address: http://127.0.0.1:54613 displaying my index.cfm page. Cool.

But I would like to connect a datasource and I would like to do this thorough the server admin panel that everyone else says to use. So when I try to access http://127.0.0.1:54613/lucee/admin/server.cfm I get this screen:

enter image description here

So I created a password.txt file that contains 1 line of plaintext that is the password I wanted to use. So my directory looks like this:

LuceeServer>
    index.cfm
    password.txt

In which index.cfm and password.txt are at the same level. When I click import file the screen reloads and nothing happens.

I assume I have things set up incorrectly. I've never used commandbox before and I dont really know what I'm doing.

3

There are 3 best solutions below

2
On BEST ANSWER

Your password.txt needs to go in the "root Lucee server directory", which isn't the same as your site's web root (which wouldn't be a very secure place to put it). In CommandBox the location is a bit obscure, but you can find it with the following command:

server info property=serverHomeDirectory
1
On

When you run your server with CommandBox, click on its tray icon in the right corner of your desktop, click open and then the server home folder like shown on the image below:

CommandBox Tray Icon Navigation to Server Home

Then navigate to /WEB-INF/lucee-server/context/ and place your password.txt file there. Then go back to lucees server admin page in your browser and click the "import file" button to import the password.txt file.

0
On

You can bypass this entirely by using CFConfig. You can either specify the adminPassword in your .cfconfig.json file

{
  "adminPassword":"myPass"
}

or you can install commandbox-dotenv and set a global .env file that has a cfconfig_adminPassword key.

~/.box.env

# Add environment variables to be loaded into CommandBox when it starts
# Variables are in the form of foo=bar, one per line
cfconfig_adminPassword=myPass

Disclaimer: I am the lead developer of CommandBox and the CFConfig module.