Skip to content

Instantly share code, notes, and snippets.

@Kibur
Last active January 14, 2017 12:09
Show Gist options
  • Save Kibur/01dec0f4c50348a6d6c029d4917be5a2 to your computer and use it in GitHub Desktop.
Save Kibur/01dec0f4c50348a6d6c029d4917be5a2 to your computer and use it in GitHub Desktop.
My experience towards CentOS
miniDLNA Server Installation (CentOS 7)
---------------------------------------
Create a temporary directory for the installation files:
mkdir ~/Downloads/minidlna
Download the binary files:
wget https://sourceforge.net/projects/minidlna/files/minidlna/1.1.5/minidlna-1.1.5_static.tar.gz
Extract the files:
tar xvf minidlna-1.1.5_static.tar.gz
Move the configuration file to /etc:
sudo mv etc/minidlna.conf /etc
Move the binary file:
sudo mv usr/sbin/minidlnad /sbin
Remove the temporary directory:
rm -rv minidlna
Create the service settings:
sudo vim /etc/systemd/system/minidlnad.service
'''
[Unit]
Description=Minidlna Daemon
After=syslog.target network.target
[Service]
Type=forking
PIDFile=/run/minidlnad.pid
ExecStart=/sbin/minidlnad -f /etc/minidlna.conf -P /run/minidlnad.pid -R
ExecStop=/bin/kill -s QUIT $MAINPID
[Install]
WantedBy=multi-user.target
'''
Firewall configuration:
sudo firewall-cmd --permanent --add-port=1900/udp
sudo firewall-cmd --permanent --add-port=8200/tcp
sudo firewall-cmd --reload
Activate at boot and start the service:
sudo systemctl enable minidlnad && sudo systemctl start minidlnad
Samba share from external drive (CentOS 7)
----------------------------------------------
Disable automount of usb (udisks2 (udev)) by adding a new rule:
sudo vim /etc/udev/rules.d/85-no-automount.rules
"""
SUBSYSTEM=="usb", ENV{UDISKS_AUTO}="0"
"""
Modify /etc/fstab:
/dev/sdb1 /mnt/shares ext3 defaults 0 0
Just reboot the system.
sudo yum install samba cifs-utils
Firewall configuration:
sudo firewall-cmd --permanent --add-port=137/tcp
sudo firewall-cmd --permanent --add-port=138/tcp
sudo firewall-cmd --permanent --add-port=139/tcp
sudo firewall-cmd --permanent --add-port=445/tcp
sudo firewall-cmd --permanent --add-port=901/tcp
sudo firewall-cmd --reload
Change the selinux security context:
sudo chcon -R -t samba_share_t /mnt/shares/public
sudo semanage fcontext -a -t samba_share_t /mnt/shares/public
sudo systemclt enable nmb && sudo systemctl start nmb
sudo systemctl enable smb && sudo systemctl start smb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment