일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- tm-ac1900
- 커널 5.13.8
- ebs 녹음
- iomega
- webmin
- 바디스윙
- BCM94352Z
- 나인봇 미니 충전
- macvlan
- h6000ii
- Nas
- 모하비
- 골프 스윙
- nginx
- SAMBA
- parallel to usb
- Stretch
- EBS
- wrt54g
- proftpd
- webdav
- debian9
- AC68U
- traefik2
- omv
- openmediavault
- 마클미러
- uboot
- pihole
- omv5
- Today
- Total
해피 투게더
iomega ez debian9 webmin 으로 samba, ftp, webdav 그리고 EBS녹음 설정 본문
하드를 교체하였거나 데비안 설치후에 처음 설정 할 경우
fdisk -l //check hdd 하드 확인
fdisk /dev/sda
d // delete partition 기존 파티션 삭제
n // new partition 새 파티션
p // primary 로
1 // 1 partition 하나의 파티션
enter // default size 기본 크기
enter // default size 기본 크기
w // write on disk 디스크에 쓰기
mkfs.ext4 /dev/sda1 // ext4 로 포맷
mkdir /mnt/nas
mount /dev/sda1 /mnt/nas
chown nobody.users /mnt/nas // change owner 소유자 변경
chmod g+w /mnt/nas // write permission on group 그룹에 쓰기 권한
swap setting 설정
dd if=/dev/zero of=/swapfile bs=1M count=512
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
nano /etc/fstab 추가
/swapfile none swap defaults 0 0
webmin install 설치 시작
nano /etc/apt/sources.list 에서 추가
deb http://download.webmin.com/download/repository sarge contrib
cd /root
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
apt-get update
apt-get install apt-transport-https
apt-get install webmin
networking - network configuration 에서 hostname, hostaddresses 설정
nano /etc/hostname
debian
nano /etc/hosts
127.0.0.1 debian
system - users and groups - add user 에서 사용자 추가
server - samba windows file sharing - install 삼바설치
server - proftpd server ftp - install ftp 설치
nginx install 설치
apt-get install -y nginx php-fpm php-cgi libhtml-parser-perl
webmin - webmin configuration - webmin modules - install from url 아래 링크로 모듈 설치
https://www.justindhoffman.com/sites/justindhoffman.com/files/nginx-0.10.wbm_.gz
webdav 사용자 추가하고 nginx 가 사용할 디렉토리 생성
#printf "id:$(openssl passwd -crypt password)\n" >> /mnt/.htpasswd
#mkdir /var/www/html/dav
#chown www-data:www-data /var/www/html/dav
그리고 다시 webmin 접속하면 servers 에서 webdav, proftpd, samba 설정 할수 있다.
webdav 설정 시작
server - nginx webserver - default 설정(빨간색 부분이 내가 추가한 부분 적절하게 수정)
nano /etc/nginx/sites-available/default 로 ssh 접속해서 직접 설정도 가능
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /webdav { # 접속하고 싶은 뒷부분 주소
charset utf-8; #한글 인코딩
autoindex on;
alias /mnt/nas/public/EBS; # 공유하고 싶은 위치
auth_basic "Restricted Access";
auth_basic_user_file /mnt/.htpasswd; # 비번 저장 위치
client_body_temp_path /var/www/html/dav/tmp; # 임시파일 저장 위치
dav_methods PUT DELETE MKCOL COPY MOVE; # 기본모듈 옵션
dav_ext_methods PROPFIND OPTIONS; # 확장모듈 옵션
create_full_put_path on;
dav_access user:rw group:rw all:r; # 권한에 대한 내용
}
# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
proftpd 설정
server - proftpd server - edit config files 설정(빨간색 부분이 내가 추가한 부분 적절하게 수정)
nano /etc/proftpd/proftpd.conf 로 ssh 접속해서 직접 설정도 가능
DefaultChdir /mnt/nas
DefaultRoot /mnt/nas
#VALID LOGINS
<Limit LOGIN>
AllowUser dad
AllowUser kids
DenyALL
</Limit>
<Directory /mnt/nas/private>
<Limit ALL>
AllowUser OR dad
DenyAll
</Limit>
<Limit READ DIRS>
AllowUser OR dad
DenyAll
</Limit>
</Directory>
<Directory /mnt/nas/public>
<Limit ALL>
AllowUser OR kids,dad
DenyAll
</Limit>
<Limit READ DIRS>
AllowUser OR kids,dad
DenyAll
</Limit>
</Directory>
samba 설정 시작
server - samba windows file sharing - edit config files 설정(빨간색 부분이 내가 추가한 부분 적절하게 수정)
nano /etc/samba/smb.conf 로 ssh 접속해서 직접 설정도 가능
[admin]
create mask = 0666
directory mask = 0777
writeable = yes
valid users = dad
path = /mnt/nas/private
[kids]
create mask = 0666
writeable = yes
valid users = kids,dad
path = /mnt/nas/public
directory mask = 0777
hdparm install 설치
하드 절전 위해 hdparm 설치
apt-get install hdparm
nano /etc/hdparm.conf 에 추가
/dev/sda {
spindown_time = 120
}
EBS 녹음 하려면 관련 앱 설치
apt-get install rtmpdump ffmpeg ntp cron
crontab -e 실행해서 아래 추가
0 5 * * 1-6 /mnt/nas/public/EBS/ebs_record.sh Pocket-CH 10 /mnt/nas/public/EBS/1Pocket-CH
30 5 * * 4-6 /mnt/nas/public/EBS/ebs_record.sh Basic-CH 20 /mnt/nas/public/EBS/2Basic-CH
20 6 * * 1-6 /mnt/nas/public/EBS/ebs_record.sh Easywriting 20 /mnt/nas/public/EBS/3Easywriting
40 7 * * 1-6 /mnt/nas/public/EBS/ebs_record.sh English 20 /mnt/nas/public/EBS/4English
nano /mnt/nas/public/EBS/ebs_record.sh
#!/bin/bash
RADIO_ADDR="rtmp://ebsandroid.ebs.co.kr:1935/fmradiofamilypc/familypc1m"
RADIO_NAME="ebs_radio"
PROGRAM_NAME=$1
RECORD_MINS=$(($2 * 60))
DEST_DIR=$3
REC_DATE=`date +%Y%m%d-%H%M`
TEMP_FLV=/mnt/nas/public/EBS/`date +%Y%m%d-%H%M`
M4A_FILE_NAME=$PROGRAM_NAME"_"$REC_DATE.m4a
rtmpdump -r $RADIO_ADDR -B $RECORD_MINS -o $TEMP_FLV
ffmpeg -i $TEMP_FLV -vn -acodec copy $M4A_FILE_NAME > /dev/null 2>&1
rm $TEMP_FLV
mkdir -p $DEST_DIR
mv $M4A_FILE_NAME $DEST_DIR
테스트해보기
/mnt/nas/public/EBS/ebs_record.sh test 1 /mnt/nas/public/EBS
하면 /mnt/nas/public/EBS 아래에 test 로 시작하는 m4a 파일이 생성된다.
led 픽스
nano /etc/rc.local 에 아래 저장
echo 1 > /sys/devices/platform/gpio-leds/leds/ix2:blue:hdd/brightness
echo 0 > /sys/devices/platform/gpio-leds/leds/ix2\:red\:hdd1/brightness
echo 0 > /sys/devices/platform/gpio-leds/leds/ix2:red:hdd2/brightness
echo 1 > /sys/devices/platform/gpio-leds/leds/ix2:red:sys/brightness
echo 0 > /sys/devices/platform/gpio-leds/leds/ix2:white:sys/brightness
echo "disk-activity" > /sys/devices/platform/gpio-leds/leds/ix2:blue:hdd/trigger