Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.
| Beide kanten vorige revisie Vorige revisie Volgende revisie | Vorige revisie | ||
|
installatie_handleidingen:minidlna [2015/09/26 14:35] abel [systemd start en stop scripts] |
installatie_handleidingen:minidlna [2016/03/30 09:33] (huidige) abel |
||
|---|---|---|---|
| Regel 1: | Regel 1: | ||
| + | <note warning> NIET AF </ | ||
| ====== MiniDLNA op CentOS 7 ====== | ====== MiniDLNA op CentOS 7 ====== | ||
| Regel 4: | Regel 5: | ||
| ===== Tools ===== | ===== Tools ===== | ||
| - | Installeer de tools die tijdens de install nodig hebt. Na de install is het zinnig om ze weer te verwijderen. | + | Installeer de tools die tijdens de install nodig zijn. Na de install is het zinnig om ze weer te verwijderen. |
| '' | '' | ||
| Regel 55: | Regel 56: | ||
| - | |||
| - | |||
| - | hmm, betere: | ||
| - | |||
| - | http:// | ||
| - | |||
| - | |||
| - | ====== UMS Headless DLNA server on CentOS 7 ====== | ||
| - | |||
| - | |||
| - | Universal Media Server is oorspronkelijk een fork van PS3 Media Server. Een eenvoudige transcoding | ||
| - | |||
| - | ===== Pre-requisites ===== | ||
| - | |||
| - | ==== repositories ==== | ||
| - | |||
| - | de nodige rpm's bevinden zich in de EPEL en de NUX repository. verbind daarmee door: | ||
| - | |||
| - | '' | ||
| - | yum install http:// | ||
| - | |||
| - | Installeer programa' | ||
| - | |||
| - | '' | ||
| - | |||
| - | Installeer Java. | ||
| - | |||
| - | '' | ||
| - | |||
| - | |||
| - | ===== Installeer UMS ===== | ||
| - | |||
| - | Download a tarball of the latest version from UMS’ website to your home directory. | ||
| - | |||
| - | '' | ||
| - | |||
| - | Extract the tarball, and move it to /opt. Create a symlink from / | ||
| - | $ tar zxf UMS-4.2.2-Java7.tgz | ||
| - | $ sudo mv ums-4.2.2 /opt | ||
| - | $ sudo ln -s / | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | |||
| - | $ tar zxf UMS-4.2.2-Java7.tgz | ||
| - | $ sudo mv ums-4.2.2 /opt | ||
| - | $ sudo ln -s / | ||
| - | Copy the config files to /etc/ums. This makes more sense than keeping them with the UMS files. | ||
| - | $ sudo mkdir /etc/ums | ||
| - | $ sudo cp UMS.conf WEB.conf /etc/ums | ||
| - | 1 | ||
| - | 2 | ||
| - | |||
| - | $ sudo mkdir /etc/ums | ||
| - | $ sudo cp UMS.conf WEB.conf /etc/ums | ||
| - | Create a user, ums, to run the UMS application under. This user will need permissions to read the media files, as well as write permissions to the folder for the config files and the application files. Don’t set a password, use /opt/ums for the home directory, and use / | ||
| - | $ sudo useradd -d /opt/ums -s / | ||
| - | $ sudo chown -R ums:ums / | ||
| - | $ sudo chown -R ums:ums /etc/ums | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | |||
| - | $ sudo useradd -d /opt/ums -s / | ||
| - | $ sudo chown -R ums:ums / | ||
| - | $ sudo chown -R ums:ums /etc/ums | ||
| - | Now, open up / | ||
| - | |||
| - | Systemd configuration | ||
| - | |||
| - | Systemd is the init system in CentOS 7 and the more recent versions of Fedora. It will be utilized to start UMS on startup, as well as provide easy logging of events. | ||
| - | |||
| - | Create the file / | ||
| - | [Unit] | ||
| - | Description=Universal Media Server | ||
| - | |||
| - | [Service] | ||
| - | Type=simple | ||
| - | Environment=" | ||
| - | User=ums | ||
| - | Group=ums | ||
| - | ExecStart=/ | ||
| - | |||
| - | [Install] | ||
| - | WantedBy=multi-user.target | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | 4 | ||
| - | 5 | ||
| - | 6 | ||
| - | 7 | ||
| - | 8 | ||
| - | 9 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | |||
| - | [Unit] | ||
| - | Description=Universal Media Server | ||
| - | |||
| - | [Service] | ||
| - | Type=simple | ||
| - | Environment=" | ||
| - | User=ums | ||
| - | Group=ums | ||
| - | ExecStart=/ | ||
| - | |||
| - | [Install] | ||
| - | WantedBy=multi-user.target | ||
| - | Next, instruct systemctl reload its configuration, | ||
| - | $ sudo systemctl daemon-reload | ||
| - | $ sudo systemctl enable ums | ||
| - | $ sudo systemctl start ums | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | |||
| - | $ sudo systemctl daemon-reload | ||
| - | $ sudo systemctl enable ums | ||
| - | $ sudo systemctl start ums | ||
| - | Provided everything started fine, there should be no output from systemctl after starting it. You can utilize systemctl to verify everything started correctly: | ||
| - | $ sudo systemctl status ums | ||
| - | ums.service - Universal Media Server | ||
| - | | ||
| - | | ||
| - | Main PID: 12912 (java) | ||
| - | | ||
| - | | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | 4 | ||
| - | 5 | ||
| - | 6 | ||
| - | 7 | ||
| - | |||
| - | $ sudo systemctl status ums | ||
| - | ums.service - Universal Media Server | ||
| - | | ||
| - | | ||
| - | Main PID: 12912 (java) | ||
| - | | ||
| - | | ||
| - | Systemd captures all the output from UMS and stores it in its logs. You can access all that information with journalctl. This is extremely useful if there are problems. To view all messages from UMS, you could use the command: sudo journalctl _SYSTEMD_UNIT=ums.service | ||
| - | |||
| - | Open the firewall | ||
| - | |||
| - | Unless you’ve already mucked with the defaults, the CentOS firewall should be up and running, and likely only allowing port 22/tcp in. You will need to open some holes in the firewall. | ||
| - | |||
| - | Let’s first look at the ports that UMS uses: | ||
| - | $ sudo netstat -pln | grep java | ||
| - | tcp 0 0 0.0.0.0: | ||
| - | tcp 0 0 10.0.0.204: | ||
| - | udp 0 0 0.0.0.0: | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | 4 | ||
| - | |||
| - | $ sudo netstat -pln | grep java | ||
| - | tcp 0 0 0.0.0.0: | ||
| - | tcp 0 0 10.0.0.204: | ||
| - | udp 0 0 0.0.0.0: | ||
| - | |||
| - | Unless you’ve changed anything, by default, those are 5001/tcp, 9001/tcp and 1900/udp. Port 9001/tcp is optional. Enable it if you want to browse your media via a web browser. Let’s utilize the firewall-cmd utility to poke the holes: | ||
| - | |||
| - | Determine the active zone for your network interface. In the command below, the zone in use is internal. Yours will likely be the default, which is public. Notate it, and use it for the next commands: | ||
| - | $ sudo firewall-cmd --get-active-zones | ||
| - | internal | ||
| - | interfaces: eth0 | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | |||
| - | $ sudo firewall-cmd --get-active-zones | ||
| - | internal | ||
| - | interfaces: eth0 | ||
| - | Open the ports on the zone, and reload the firewall: | ||
| - | $ sudo firewall-cmd --add-port=5001/ | ||
| - | success | ||
| - | $ sudo firewall-cmd --add-port=9001/ | ||
| - | success | ||
| - | $ sudo firewall-cmd --add-port=1900/ | ||
| - | success | ||
| - | $ sudo firewall-cmd --reload | ||
| - | success | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | 4 | ||
| - | 5 | ||
| - | 6 | ||
| - | 7 | ||
| - | 8 | ||
| - | |||
| - | $ sudo firewall-cmd --add-port=5001/ | ||
| - | success | ||
| - | $ sudo firewall-cmd --add-port=9001/ | ||
| - | success | ||
| - | $ sudo firewall-cmd --add-port=1900/ | ||
| - | success | ||
| - | $ sudo firewall-cmd --reload | ||
| - | success | ||
| - | Verify the ports are open: | ||
| - | $ sudo firewall-cmd --list-ports --zone=< | ||
| - | 5001/tcp 9001/tcp 1900/udp | ||
| - | 1 | ||
| - | 2 | ||
| - | |||
| - | $ sudo firewall-cmd --list-ports --zone=< | ||
| - | 5001/tcp 9001/tcp 1900/udp | ||
| - | |||
| - | Congrats! You’re done! Launch your DLNA client (or PS3 as it were) and make sure things are working. Utilize journalctl to gather diagnostic information if things aren’t working right. | ||
| - | |||
| - | Update: I’ve made some changes in the systemctl setup and noted that port 9001 is optional. These were at the advice of Vallimar on the UMS forums. Thanks! | ||