# RHEL

# Print Server



# Installing CUPS server

To install the server the cupsd package and dependencies need to be downloaded.

```bash
dnf install cups -y
```

After installation only a couple of items need to be changed under

```bash
/etc/cups/cupsd.conf
```

Find Listen 127.0.0.1:631 and replace with

```
Listen *:631
```

Confirm the following is enabled

```bash
Browsing On
BrowseLocalProtocols dnssd
```

Edit these two sections as follows

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

# Restrict access to the admin pages...
<Location /admin>
 AuthType Default
 Require valid-user
 Order allow,deny
 Allow @LOCAL
</Location>
```

This line can be added near the top if a 400 bad request is happening due to DNS problems or the gold image that is being used.

```bash
ServerAlias *
```

Save. Now add the firewall rules

```bash
firewall-cmd --add-port=631/tcp --permanent
firewall-cmd --reload
```

Restart cups

```bash
systemctl restart cups
```

# CUPS ClientNew Page

Under the cups client we need to prevent the discovery of networked printers in order to only use the new print server. Bonjour may also need to be disabled on the printer itself. It doesn't always stop the printer from adding. However, this is the first measure. Edit the file.

```bash
/etc/cups/cups-browsed.conf
```

Find

```bash
BrowseRemoteProtocols dnssd cups
```

Replace with

```bash
BrowseRemoteProtocols none
BrowseProtocols none
```

Edit the file.

```bash
/etc/cups/cupsd.conf
```

Find

```bash
Browsing On
BrowseLocalProtocols dnssd
```

Replace with

```bash
Browsing No
BrowseLocalProtocols none
```

Restart CUPS service.

```bash
systemctl restart cups
```