/var/www/
find out that in the directory there is only a page “index.html” with the redirect code a little deeper - on ./UI/ (where the inside of the native web interface is located). You don’t even need to invent anything:/var/www/
(I got the full path /var/www/_h5ai
);chmod -R 755 /var/www/_h5ai/; chmod -R 777 /var/www/_h5ai/cache/
chmod -R 755 /var/www/_h5ai/; chmod -R 777 /var/www/_h5ai/cache/
/var/www
we create the “shared” directory and in it we create a symlink to the Public
directory (by going to it we run ln -s /shares/Public/
) and other directories to which you need to open access;/etc/apache2/sites-enabled/000-wdnas
by adding the /etc/apache2/sites-enabled/000-wdnas
to it in front of the # block application folders from being served
: # h5ai <Directory /var/www/shared/> DirectoryIndex index.html index.php /_h5ai/server/php/index.php </Directory>
/etc/init.d/apache2 restart
;htt://%IP_ADDR%/shared/
;/var/www/
, which displays the information we are interested in (you will have to add hddtemp - sudo apt-get install hddtemp): <?php error_reporting(0); ?><!DOCTYPE html> <html lang="ru-RU"> <title>System Info</title> <style type="text/css"> html, body {margin:40px;padding:0;text-align:center;font-family:Tahoma,Verdana,Arial;font-size:40px;color:#333} </style> <head> </head> <body> <div id="data"> FreeMemory: <strong><?php echo exec("sudo awk '/MemFree/ {printf( \"%.2f\n\", $2 / 1024 )}' /proc/meminfo"); ?></strong>Mb <small>of <?php echo exec("sudo awk '/MemTotal/ {printf( \"%.2f\n\", $2 / 1024 )}' /proc/meminfo"); ?>Mb</small> <br /> CPU Usage: <strong><?php echo exec("cat /proc/loadavg | awk '{print $1}'"); ?></strong>% for last minute <br /> HDD Temperature: <strong><?php echo exec("sudo hddtemp -n /dev/sda"); ?></strong> ÂşC </div> </body> </html>
, JavaScript ( "" ) N , :
index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="ru-RU"> <title>Follow The White Rabbit</title> <style type="text/css"> html,body{text-align:center;font-family:Tahoma,Verdana,Arial;color:#666} #sysinfo{position:fixed;top:10px;width:300px;height:auto;margin-left:-150px;left:50%; font-size:11px;color:#666;-moz-opacity:0;-khtml-opacity:0;opacity:0; -webkit-transition:all 150ms ease-out;-moz-transition:all 150ms ease-out; transition:all 150ms ease-out} .trans{-moz-opacity:0.2!important;-khtml-opacity:0.2!important;opacity:0.2!important} #sysinfo:hover{-moz-opacity:1!important;-khtml-opacity:1!important;opacity:1!important} .center{position:absolute;width:530px;height:25px;top:50%;left:50%;margin-left:-265px;margin-top:30px;color:#ccc} .center a{padding:80px 20px 0;color:#222;text-decoration:none} .center a.web{ background:url(http://cdn1.iconfinder.com/data/icons/windows-8-metro-style/64/services.png) no-repeat top center;} .center a.torrent{ background:url(http://cdn1.iconfinder.com/data/icons/windows-8-metro-style/64/utorrent.png) no-repeat top center;} .center a.filez{ background:url(http://cdn1.iconfinder.com/data/icons/jolly-icons-free/64/folder_64.png) no-repeat top center;} </style> <link rel="icon" type="image/png" href="http://www.freefavicon.com/freefavicons/openclipart/loading-wheel-modern-icon-152-191739.png" /> <head> </head> <body> <div id="sysinfo"></div> <div class="center"> <a href="/UI" class="web">WD Web Interface</a> | <script type="text/javascript"> var d=document, wl=window.location, port_num = '9091', client_url = 'transmission/web/', link_label = 'Torrent Client'; d.write('<a href="'+wl.protocol+'//'+wl.hostname+':'+port_num+'/'+client_url+'" class="torrent">'+link_label+'</a>'); </script> | <a href="/shared/Public/" class="filez">Files Storage</a> </div> <iframe id="loader" name="loader" src="/sysinfo.php" style="display:none;"></iframe> <script type="text/javascript"> var readyStateCheckInterval=setInterval(function(){if(document.readyState==='complete'){ function update_data(){ var d = document, f = d.getElementById('loader'), s = d.getElementById('sysinfo'); f.src = f.src; if(!s.className.match(/(?:^|\s)MyClass(?!\S)/)) s.className+=' trans'; try { s.innerHTML = window.frames['loader'].document.getElementById('data').innerHTML; }catch(e){ s.innerHTML = '<span style="color:#e00;font-weight:bold;">Get data error</span>'; } } update_data(); setInterval(function(){ update_data(); }, 4000); clearInterval(readyStateCheckInterval); }},50); </script> </body> </html>
, JavaScript ( "" ) N , :
index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="ru-RU"> <title>Follow The White Rabbit</title> <style type="text/css"> html,body{text-align:center;font-family:Tahoma,Verdana,Arial;color:#666} #sysinfo{position:fixed;top:10px;width:300px;height:auto;margin-left:-150px;left:50%; font-size:11px;color:#666;-moz-opacity:0;-khtml-opacity:0;opacity:0; -webkit-transition:all 150ms ease-out;-moz-transition:all 150ms ease-out; transition:all 150ms ease-out} .trans{-moz-opacity:0.2!important;-khtml-opacity:0.2!important;opacity:0.2!important} #sysinfo:hover{-moz-opacity:1!important;-khtml-opacity:1!important;opacity:1!important} .center{position:absolute;width:530px;height:25px;top:50%;left:50%;margin-left:-265px;margin-top:30px;color:#ccc} .center a{padding:80px 20px 0;color:#222;text-decoration:none} .center a.web{ background:url(http://cdn1.iconfinder.com/data/icons/windows-8-metro-style/64/services.png) no-repeat top center;} .center a.torrent{ background:url(http://cdn1.iconfinder.com/data/icons/windows-8-metro-style/64/utorrent.png) no-repeat top center;} .center a.filez{ background:url(http://cdn1.iconfinder.com/data/icons/jolly-icons-free/64/folder_64.png) no-repeat top center;} </style> <link rel="icon" type="image/png" href="http://www.freefavicon.com/freefavicons/openclipart/loading-wheel-modern-icon-152-191739.png" /> <head> </head> <body> <div id="sysinfo"></div> <div class="center"> <a href="/UI" class="web">WD Web Interface</a> | <script type="text/javascript"> var d=document, wl=window.location, port_num = '9091', client_url = 'transmission/web/', link_label = 'Torrent Client'; d.write('<a href="'+wl.protocol+'//'+wl.hostname+':'+port_num+'/'+client_url+'" class="torrent">'+link_label+'</a>'); </script> | <a href="/shared/Public/" class="filez">Files Storage</a> </div> <iframe id="loader" name="loader" src="/sysinfo.php" style="display:none;"></iframe> <script type="text/javascript"> var readyStateCheckInterval=setInterval(function(){if(document.readyState==='complete'){ function update_data(){ var d = document, f = d.getElementById('loader'), s = d.getElementById('sysinfo'); f.src = f.src; if(!s.className.match(/(?:^|\s)MyClass(?!\S)/)) s.className+=' trans'; try { s.innerHTML = window.frames['loader'].document.getElementById('data').innerHTML; }catch(e){ s.innerHTML = '<span style="color:#e00;font-weight:bold;">Get data error</span>'; } } update_data(); setInterval(function(){ update_data(); }, 4000); clearInterval(readyStateCheckInterval); }},50); </script> </body> </html>
, JavaScript ( "" ) N , :
index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="ru-RU"> <title>Follow The White Rabbit</title> <style type="text/css"> html,body{text-align:center;font-family:Tahoma,Verdana,Arial;color:#666} #sysinfo{position:fixed;top:10px;width:300px;height:auto;margin-left:-150px;left:50%; font-size:11px;color:#666;-moz-opacity:0;-khtml-opacity:0;opacity:0; -webkit-transition:all 150ms ease-out;-moz-transition:all 150ms ease-out; transition:all 150ms ease-out} .trans{-moz-opacity:0.2!important;-khtml-opacity:0.2!important;opacity:0.2!important} #sysinfo:hover{-moz-opacity:1!important;-khtml-opacity:1!important;opacity:1!important} .center{position:absolute;width:530px;height:25px;top:50%;left:50%;margin-left:-265px;margin-top:30px;color:#ccc} .center a{padding:80px 20px 0;color:#222;text-decoration:none} .center a.web{ background:url(http://cdn1.iconfinder.com/data/icons/windows-8-metro-style/64/services.png) no-repeat top center;} .center a.torrent{ background:url(http://cdn1.iconfinder.com/data/icons/windows-8-metro-style/64/utorrent.png) no-repeat top center;} .center a.filez{ background:url(http://cdn1.iconfinder.com/data/icons/jolly-icons-free/64/folder_64.png) no-repeat top center;} </style> <link rel="icon" type="image/png" href="http://www.freefavicon.com/freefavicons/openclipart/loading-wheel-modern-icon-152-191739.png" /> <head> </head> <body> <div id="sysinfo"></div> <div class="center"> <a href="/UI" class="web">WD Web Interface</a> | <script type="text/javascript"> var d=document, wl=window.location, port_num = '9091', client_url = 'transmission/web/', link_label = 'Torrent Client'; d.write('<a href="'+wl.protocol+'//'+wl.hostname+':'+port_num+'/'+client_url+'" class="torrent">'+link_label+'</a>'); </script> | <a href="/shared/Public/" class="filez">Files Storage</a> </div> <iframe id="loader" name="loader" src="/sysinfo.php" style="display:none;"></iframe> <script type="text/javascript"> var readyStateCheckInterval=setInterval(function(){if(document.readyState==='complete'){ function update_data(){ var d = document, f = d.getElementById('loader'), s = d.getElementById('sysinfo'); f.src = f.src; if(!s.className.match(/(?:^|\s)MyClass(?!\S)/)) s.className+=' trans'; try { s.innerHTML = window.frames['loader'].document.getElementById('data').innerHTML; }catch(e){ s.innerHTML = '<span style="color:#e00;font-weight:bold;">Get data error</span>'; } } update_data(); setInterval(function(){ update_data(); }, 4000); clearInterval(readyStateCheckInterval); }},50); </script> </body> </html>
Source: https://habr.com/ru/post/229113/
All Articles