Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Why would a browser not respect an /etc/hosts entry for one service?
New Posts  All Forums:Forum Nav:

Why would a browser not respect an /etc/hosts entry for one service?

post #1 of 5
Thread Starter 
I have my server upgraded to Ubuntu 16.04 server direct booting to Kodi. The server is serving DNS, DHCP, LTSP, Mythtv Backend, Apt-caching Proxy, Cups print server, Rsync for backups from 2 laptops in the house, as well as a Transmission server controlled via browser anywhere on lan. I have all my eggs in one basket so to speak.

All but one of my services that I can access through a browser work fine following the /etc/hosts entry on my laptop. In this case "192.168.1.2 myserver". The cups configuration page does not however. For it I need to enter the ip address directly. What would I be looking for to solve this issue? Ideally I would like to have everything set to "myserver" in my browser so I can change it up with just a /etc/hosts modification, not that it will change anytime soon.

*EDIT* Also have to put the 192.168.1.2 in the /etc/cups/client.conf as well.

*EDIT* Laptop is running Ubuntu 16.04 at the moment as well.
Edited by Tadaen Sylvermane - 8/4/16 at 4:59pm
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
post #2 of 5
post CUPS config file...
Black & Green
(12 items)
 
Dev Box
(7 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T ASRock 970 Extreme3 Gigabyte GTX 750 Ti mushkin Blackline PC-12800 DDR3 
Hard DriveCoolingOSMonitor
Samsung 850 EVO Cooler Master Hyper 212 EVO Debian -nosystemd- LG Flatron 
KeyboardPowerMouseAudio
MechanicalEagle Z-77 Corsair CS650M Kinzu V2 Pro Asus Xonar Essence STX 
CPUMotherboardRAMHard Drive
Core2 Duo E7400 Asus P5Q Hyper-X  Sandisk 
OSPower
Fedora 22 Thermaltake 650W 
  hide details  
Reply
Black & Green
(12 items)
 
Dev Box
(7 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T ASRock 970 Extreme3 Gigabyte GTX 750 Ti mushkin Blackline PC-12800 DDR3 
Hard DriveCoolingOSMonitor
Samsung 850 EVO Cooler Master Hyper 212 EVO Debian -nosystemd- LG Flatron 
KeyboardPowerMouseAudio
MechanicalEagle Z-77 Corsair CS650M Kinzu V2 Pro Asus Xonar Essence STX 
CPUMotherboardRAMHard Drive
Core2 Duo E7400 Asus P5Q Hyper-X  Sandisk 
OSPower
Fedora 22 Thermaltake 650W 
  hide details  
Reply
post #3 of 5
Thread Starter 
Only lines I changed from default was the port 631 line, and the 3 Location stanzas, adding the Allow @LOCAL part.
Code:
cat /etc/cups/cupsd.conf 
#
# Configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn
PageLogFormat

# Deactivate CUPS' internal logrotating, as we provide a better one, especially
# LogLevel debug2 gets usable now
MaxLogSize 0

# Only listen for connections from the local machine.
#Listen localhost:631
#Listen /var/run/cups/cups.sock
Port 631

# Show shared printers on the local network.
Browsing Off
BrowseLocalProtocols dnssd

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Web interface setting...
WebInterface Yes

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

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

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow @LOCAL
</Location>

# Restrict access to log files...
<Location /admin/log>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

# Set the authenticated printer/job policies...
<Policy authenticated>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

Edited by Tadaen Sylvermane - 8/4/16 at 5:03pm
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
post #4 of 5
so myserver:631 doesn't work but 192.168.1.2:631 does? try replacing Port 631 with Listen myserver:631 and Allow @LOCAL with Allow all in the Location sections
Black & Green
(12 items)
 
Dev Box
(7 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T ASRock 970 Extreme3 Gigabyte GTX 750 Ti mushkin Blackline PC-12800 DDR3 
Hard DriveCoolingOSMonitor
Samsung 850 EVO Cooler Master Hyper 212 EVO Debian -nosystemd- LG Flatron 
KeyboardPowerMouseAudio
MechanicalEagle Z-77 Corsair CS650M Kinzu V2 Pro Asus Xonar Essence STX 
CPUMotherboardRAMHard Drive
Core2 Duo E7400 Asus P5Q Hyper-X  Sandisk 
OSPower
Fedora 22 Thermaltake 650W 
  hide details  
Reply
Black & Green
(12 items)
 
Dev Box
(7 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T ASRock 970 Extreme3 Gigabyte GTX 750 Ti mushkin Blackline PC-12800 DDR3 
Hard DriveCoolingOSMonitor
Samsung 850 EVO Cooler Master Hyper 212 EVO Debian -nosystemd- LG Flatron 
KeyboardPowerMouseAudio
MechanicalEagle Z-77 Corsair CS650M Kinzu V2 Pro Asus Xonar Essence STX 
CPUMotherboardRAMHard Drive
Core2 Duo E7400 Asus P5Q Hyper-X  Sandisk 
OSPower
Fedora 22 Thermaltake 650W 
  hide details  
Reply
post #5 of 5
Thread Starter 
I found the answer on the Arch forums. In this case it was something I didn't consider and didn't think would matter. My servers hostname was not the same as the entry in /etc/hosts on my laptop. The hostname was failbox, on laptop it was directing 192.168.1.2 to myserver. Changing the servers hostname solved the issue.

Reference

Now if i can figure why the cups server dies immediately after starting I will have it set :/

If curious...

Says it will restart but never does.

Code:
‚óŹ cups.service - CUPS Scheduler
   Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: ena
   Active: inactive (dead) since Fri 2016-08-05 13:34:22 MST; 46s ago
     Docs: man:cupsd(8)
  Process: 9462 ExecStart=/usr/sbin/cupsd -l (code=exited, status=0/SUCCESS)
 Main PID: 9462 (code=exited, status=0/SUCCESS)

Aug 05 13:32:51 myserver systemd[1]: Started CUPS Scheduler.
Code:
I [05/Aug/2016:13:33:22 -0700] Saving subscriptions.conf...
D [05/Aug/2016:13:33:22 -0700] cupsdSetBusyState: newbusy="Not busy", busy="Dirty files"
I [05/Aug/2016:13:33:22 -0700] Expiring subscriptions...
I [05/Aug/2016:13:34:22 -0700] Printer sharing is off and there are no jobs pending, will restart on demand.
I [05/Aug/2016:13:34:22 -0700] Scheduler shutting down normally.
D [05/Aug/2016:13:34:22 -0700] cupsdMarkDirty(----S)
D [05/Aug/2016:13:34:22 -0700] cupsdSetBusyState: newbusy="Dirty files", busy="Not busy"
I [05/Aug/2016:13:34:22 -0700] Saving subscriptions.conf...
D [05/Aug/2016:13:34:22 -0700] cupsdSetBusyState: newbusy="Not busy", busy="Dirty files"
D [05/Aug/2016:13:34:22 -0700] Creating keep-alive file "/var/cache/cups/org.cups.cupsd".
I [05/Aug/2016:13:34:22 -0700] Saving job.cache...
D [05/Aug/2016:13:34:22 -0700] cupsdStopSelect()

Edited by Tadaen Sylvermane - 8/5/16 at 1:38pm
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Why would a browser not respect an /etc/hosts entry for one service?