U5PVR APM 2편 : 활용하기 (apache2 + php5 + mysql) https://cafe.naver.com/mk802/20380 참조 하여 폴더 변경 합니다 기존 /var/www/html/index.html
변경 /mnt/media_rw/sda5/www/html/index.html 1) 표준 시간대 맞추기 dpkg-reconfigure tzdata 서울 아시아로 설정 합니다
2)웹루트 옮기기
기존 /var/www/html/index.html
변경 /mnt/media_rw/sda5/www/html/index.html mkdir /mnt/media_rw/sda5/www/html 웹경로를 수정합니다 nano /etc/apache2/apache2.conf
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted 를 <Directory /mnt/media_rw/sda5/www/> Options Indexes FollowSymLinks AllowOverride None
Require all granted
로 /mnt/media_rw/sda5/www/ 경로로 수정 합니다
nano /etc/apache2/sites-enabled/000-default.conf
수정은 DocumentRoot /var/www/html 를 DocumentRoot /mnt/media_rw/sda5/www/html
외장디스크 권한설정 adduser www-data aid_media_rw
adduser www-data aid_sdcard_r
service apache2 restart 서비스 재시작 <epg2xml 폴더 경로 변경 설정 하기 > 수정파일 1) tv_grab2_xmltv_xml ============== #!/bin/sh if [ "x$1" = "x" ]; then cat /mnt/media_rw/sda5/www/html/epg2xml/xmltv.xml exit 0 fi case "$1" in --description) echo "tv_grab2_xmltv_xml" ;; --version) echo "1.0" ;; --capabilities) echo "baseline" ;; esac ---------- 2) tv_grab2_2xmltv_xml
================
#!/bin/sh if [ "x$1" = "x" ]; then cat /mnt/media_rw/sda5/www/html/epg2xml/xmltv2.xml exit 0 fi case "$1" in --description) echo "tv_grab2_2xmltv_xml" ;; --version) echo "1.0" ;; --capabilities) echo "baseline" ;; esac ------- 3) xmltv_xml_mnt.sh
==================
#!/bin/sh #cp /var/www/html/epg2xml/xmltv_xml_mnt.sh /usr/bin/ #crontab -e #crontab -l #bash /usr/bin/xmltv_xml_mnt.sh date rm -f /mnt/media_rw/sda5/www/html/epg2xml/xmltv.xml php /mnt/media_rw/sda5/www/html/epg2xml/epg2xml.php -l 7 -o /mnt/media_rw/sda5/www/html/epg2xml/xmltv.xml chmod 777 /mnt/media_rw/sda5/www/html/epg2xml/xmltv.xml #rm -f /var/www/html/epg2xml/xmltv.xml #php /var/www/html/epg2xml/epg2xml.php -l 7 -o /var/www/html/epg2xml/xmltv.xml #chmod 777 /var/www/html/epg2xml/xmltv.xml
----------------
4) xmltv2_xml_mnt.sh ==========================
#!/bin/sh #cp /var/www/html/epg2xml/xmltv2_xml_mnt.sh /usr/bin/ #crontab -e #crontab -l #bash /usr/bin/xmltv2_xml_mnt.sh date rm -f /mnt/media_rw/sda5/www/html/epg2xml/xmltv2.xml php /mnt/media_rw/sda5/www/html/epg2xml/epg2xml.php -l 2 -o /mnt/media_rw/sda5/www/html/epg2xml/xmltv2.xml chmod 777 /mnt/media_rw/sda5/www/html/epg2xml/xmltv2.xml #rm -f /var/www/html/epg2xml/xmltv2.xml #php /var/www/html/epg2xml/epg2xml.php -l 2 -o /var/www/html/epg2xml/xmltv2.xml #chmod 777 /var/www/html/epg2xml/xmltv2.xml =======================
</usr/bin 폴더에 복사 권한수정>
1) tv_grab2_xmltv_xml
cp /mnt/media_rw/sda5/www/html/epg2xml/tv_grab2_xmltv_xml /usr/bin
chmod a+x /usr/bin/tv_grab2_xmltv_xml
2) tv_grab2_2xmltv_xml cp /mnt/media_rw/sda5/www/html/epg2xml/tv_grab2_2xmltv_xml /usr/bin
chmod a+x /usr/bin/tv_grab2_2xmltv_xml
3) xmltv_xml_mnt.sh cp /mnt/media_rw/sda5/www/html/epg2xml/xmltv_xml_mnt.sh /usr/bin chmod a+x /usr/bin/xmltv_xml_mnt.sh
4) xmltv2_xml_mnt.sh
cp /mnt/media_rw/sda5/www/html/epg2xml/xmltv2_xml_mnt.sh /usr/bin chmod a+x /usr/bin/xmltv2_xml_mnt.sh
<자동스케줄 링 만들기> crontab -e 09 */9 * * * /usr/bin/xmltv_xml_mnt.sh >> /mnt/media_rw/sda5/www/html/epg2xml/xmltv_xml_mnt.sh.log 2>&1
04 */4 * * * /usr/bin/xmltv2_xml_mnt.sh >> /mnt/media_rw/sda5/www/html/epg2xml/xmltv2_xml_mnt.sh.log 2>&1
<자동스케줄 링 실행> bash /usr/bin/xmltv_xml_mnt.sh bash /usr/bin/xmltv2_xml_mnt.sh
<cron을 재시작 > /etc/init.d/cron restart tvheadend 재시작 service tvheadend restart <웹루트 확인> http://192.168.0.33/ 파일수정 확인
|