# CUPS localhost mainpage is missing



## semi-ambivalent (Jan 16, 2017)

all,

After a recent port upgrade from CUPS 2.1.x to 2.2.1 if I go to localhost:631 I'm told the page is not found, but localhost:631/admin.php gets me to an icon-less but perfectly usable admin page. Some searching turns up that the mainpage is somewhere else than the sub-pages (like admin.php). I have a copy of the main page's index.html but don't know where it goes. Does anyone know what CUPS file I can root through to find where CUPS expects to find this main page?

thanks!
s-a


----------



## Abriel (Jan 16, 2017)

Try /usr/local/share/doc/cups


----------



## semi-ambivalent (Jan 16, 2017)

That was it. There's:

```
/usr/local/doc/cups/
```
and:

```
/usr/local/cups/doc/
```

Someday I'll do housekeeping...

Thanks,
s-a


----------



## semi-ambivalent (Jan 16, 2017)

That was it. There's:

```
/usr/local/share/doc/cups/
```
and:

```
/usr/local/share/cups/doc/
```

Someday I'll do housekeeping...

Thanks,
s-a


----------



## PacketMan (Nov 18, 2017)

So I just did a fresh install, and going to http://a.b.c.d:631/ (according to https://www.freebsd.org/doc/en_US.ISO8859-1/articles/cups/printing-cups-configuring-printers.html) does not work - page not found.  I did not have CUPS installed before, this is a 1st time install. There are no instructions that I need to configure anything else except adding in this code which I did:

/etc/devfs.rules

```
[system=10]
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
```
Don't have any USB printers, so left out the line for that.

and to /etc/rc.conf

```
cupsd_enable="YES"
devfs_system_ruleset="system"
```

I tried adding a /index.html, /admin/index.html etc but no joy.

Looking in /usr/local/share/doc/cups or 
/usr/local/etc/cups I don't see in any files where I can set the admin web page url.

Edit:  According to /usr/ports/UPDATING I see in note 20160311 that "The package also installs a devd(8) configuration file now that gives cups access to USB printers.  Unless you have any special needs you can remove any devd(8), devfs.conf(5) or devfs.rules(5) configuration related to cups that you may have added in the past."  So I remove my /etc/devfs.rules but that made no difference.


----------



## PacketMan (Nov 21, 2017)

Guys, I have not been able to get to the CUPS web page. I assume CUPS is running fine waiting for me to configure it and that this is just a web page access issue, or maybe not. Are these pages (https://www.freebsd.org/doc/en_US.ISO8859-1/articles/cups/printing-cups-configuring-server.html) correct, or is it missing some updates? There are lots of references to CUPS page not working, but the issues vary and its all Linux discussion.  I did a stock install, followed the above chapter 3 page. I created a /etc/devfs.rules as per the instructions, but also removed them as per note 20160311 in /usr/ports/UPDATING.

Top and this shows that its running:

```
# ps aux | grep cups
root  891   0.0  0.1 77372 6460  -  Is    8:38PM  0:00.01 /usr/local/sbin/cupsd -C /usr/local/etc/cups/cupsd.conf -s /usr/local/etc/cups/cups-files.conf
```

But http://a.b.c.d:631 simply does not work.  I am trying to access this from another device on the same subnet. CUPS is running on a headless server, and I am SSHing into that machine to configure, start, etc.

In /usr/local/etc/cups/cupsd.conf I even tried adding an "allow all" rule in here, but that made no difference:

```
# Restrict access to the server...
<Location />
  Order allow,deny
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
</Location>
```

Any chance the URL access changed a bit and I just need a "duhhhh" moment?

EDIT in case you ask:  10.4-RELEASE and
# pkg info | grep cups
cups-2.2.6                     Common UNIX Printing System


----------



## PacketMan (Nov 22, 2017)

I got it working.  The handbook does not say to add this line to /usr/local/etc/cups/cupsd.conf:

`# Only listen for connections from the local machine.
Listen server-nic-ip-address:631`

I tried that earlier, but must have typod.  I then got "forbiddened" so I then did this for now:

```
# Restrict access to the server...
<Location />
  Order allow,deny
 Allow all
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,denya
Allow all
</Location>
```

In case a CUPS newbie has the same issue.  Someone should probably update the handbook CUPS page.


----------

