# Problems setting up samba/cups...

## Stormmind

I've been following this howto (that got into the official guide-section as well):

https://forums.gentoo.org/viewtopic.php?t=110931&start=150&postdays=0&postorder=asc&highlight=&sid=dff5aa8c89549d3a8f258b9bfb5668ca

But I've hit problems after configuring samba+cups and restarting it all -  I can't connect to localhost:631. Actually samba doesn't seem to be very happy either, since I can't connect to it as well. 

log.nmbd gives

```

[2004/11/18 20:49:34, 0] nmbd/nmbd_serverlistdb.c:write_browse_list(341)

  write_browse_list: Can't open file /usr/local/samba/var/lock/browse.dat.. Error was No such file or directory

```

log.smbd gives

```

[2004/11/18 20:48:40, 0] printing/print_cups.c:cups_printer_fn(119)

  Unable to connect to CUPS server localhost - Connection refused

[2004/11/18 20:48:40, 0] lib/messages.c:message_init(106)

  ERROR: Failed to initialise messages database

```

while the cups error_log gives

```

D [18/Nov/2004:20:19:37 +0100] LoadDevices: Added device "socket"...

I [18/Nov/2004:20:19:37 +0100] LoadPPDs: Read "/etc/cups/ppds.dat", 14 PPDs...

I [18/Nov/2004:20:19:37 +0100] LoadPPDs: No new or changed PPDs...

D [18/Nov/2004:20:19:37 +0100] LoadAllJobs: Scanning /var/spool/cups...

I [18/Nov/2004:20:19:37 +0100] Full reload complete.

D [18/Nov/2004:20:19:37 +0100] StartListening: NumListeners=0

```

my $HOSTNAME is the same as ServerName in cupsd.conf and it is also in the /etc/hosts. It does smell like networking problem, but I don't know how to check that. Any ideas? Here's my configs:

cupsd.conf

```

ServerName katja

ServerAdmin ...

AccessLog /var/log/cups/access_log

ErrorLog /var/log/cups/error_log

LogLevel debug

MaxClients 100

BrowseAddress @IF(eth1)

<Location />

  Order Deny,Allow

  Deny From All

  Allow From 192.168.2.*

</Location>

<Location /admin>

  AuthType Basic

  AuthClass System

  Order Deny,Allow

  Deny From All

  Allow From 192.168.2.*

</Location>

```

ifconfig

```

eth1    inet addr:192.168.2.104  Bcast:192.168.2.255  Mask:255.255.255.0

```

/etc/hosts

```

127.0.0.1       localhost

192.168.2.104   katja

```

smb.conf

```

[global]

  workgroup         = Home

  server string     = Samba Server %v

  load printers     = yes

  browseable        = yes

  printing          = cups

  printcap name     = cups

  encrypt passwords = yes

  lock directory    = /usr/local/samba/var/lock

  interfaces        = lo eth1

  bind interfaces only = yes

  security          = user 

  log file          = /var/log/samba/log.%m

  max log size      = 50

  socket options    = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

  hosts allow       = 127.0.0.1 192.168.2.*

[print$]

  comment = Printer Drivers

  # this path holds the driver structure

  path = /etc/samba/printer

  guest ok = no

  browseable = yes

  read only = yes

  # add a username to the write list

  # if you don't want root to be the only

  # printer admin

  write list = root

[Epson740] # the name is arbitrary, but should be consistent throughout

  # Samba and CUPS!

  comment = Epson Stylus Color 740

  printable = yes

  path = /var/spool/samba

  public = yes

  guest ok = yes

  printer admin = printer,root

[printers]      # here all printers will be shown; this becomes the Printers

  # share/section under Network Neighborhood

  comment = All Printers

  path = /var/spool/samba

  browseable = no

  public = yes

  guest ok = yes

  writable = no

  printable = yes

  printer admin = printer,root 

[Goodies]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /Files

```

I've setup root and printer users with samba, in case that tells you something. But I don't get any chance to enter any of those since all connections are rejected, be it to samba or to cups. Any help would very much appreciated!

----------

## emil|act

Hi!

I have had i lot of truoble with cups/samba myself. Until I found this thread.

https://forums.gentoo.org/viewtopic.php?t=110931

Just replace the ppd with one maching your printer!

Good luck!

----------

## Stormmind

Thanks, but as I allready said, that is the thread that I've been reading too.

----------

## theklone

Try this.

smb.conf 

```
..

lock directory    = /usr/local/samba/var/lock # DELETE ME

..
```

cupsd.conf

```
<Location /> 

  Allow From 127.0.0.1 # ADD ME

</Location> 

<Location /admin> 

  Allow From 127.0.0.1  # ADD ME

</Location> 
```

----------

## Stormmind

Thanks for your help! Deleting lock directory solved the two samba-problems. Unfortunately samba still can't connect to cups and I can't access localhost:631. Any more ideas? =)

// Storm

----------

