Page 1 of 1

Error web

Posted: Sun Jan 28, 2018 10:41 am
by jopara
2274/5000
Hello, first of all to thank for VestaCP. I discovered it by chance and I'm quite happy with it. I have it installed on all my VPS.

I've only had one problem with some websites that happened to relate to see if anyone can tell me what to do to fix it.

You see, two of my websites use a script to launch the title and artist on those websites that are radio stations.

These websites use this code in a .php file
<?php
//get artist/title info
$artist = $_GET['artist'];
$title = $_GET['title'];

//create a temp file to store values for AJAX script
$r = fopen("temp_title.txt", "w");
fwrite($r, $artist." - ".$title);
fclose($r);
?>


This code is inserted in the index where it calls the cacion and artist
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<b>Here you'll see track title:</b>

<!-- begin update track title code -->
<div id="track_name"></div>

<script type="text/javascript">
function UpdateTitle()
{
var xmlhttp;
//get "track name" block
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var s = xmlhttp.responseText;
document.getElementById('track_name').innerHTML = s;
}
}
//use random number in request to prevent caching
var rand_no = Math.random();
rand_no = rand_no * 100;
//read the "temp_title.txt" file
xmlhttp.open("POST", "/temp_title.txt?"+rand_no, true);
xmlhttp.send();
}
//
setInterval("UpdateTitle()", 1000);
UpdateTitle();
</script>
<!-- end update track title code -->

</body>
</html>

This code is inserted in the index where it calls the cacion and artist and all this is done through the radio broadcast program that writes a .txt file that is also uploaded to the server. The latter is with 777 permissions for reading and writing.

All this worked correctly in cPanel, but when migrating the webs to vesta, they stopped working.

Any ideas?

Thanks and pedon for the novel.

Re: Error web

Posted: Sun Jan 28, 2018 12:33 pm
by ScIT
did you checked the log? what error appears?

Re: Error web

Posted: Sun Feb 04, 2018 9:36 am
by jopara
2018/02/04 10:17:09 [error] 27069#27069: *292656 connect() failed (111: Connection refused) while connecting to upstream, client: 79.145.33.255, server: almuhost.com, request: "POST /temp_title.txt?33.34451206496094 HTTP/1.1", upstream: "https://185.129.251.100:8443/temp_title ... 1206496094", host: "almuhost.com", referrer: "https://almuhost.com/track_title/showtitle.htm"

Re: Error web

Posted: Sun Feb 04, 2018 5:21 pm
by mehargags
May be the system is not able to generate that temp file.
goto you /home/<vestauser>/conf/web/<domain>.apache.conf and put /tmp at last in front of basedir value.

If the error stops after that, you may have to give a proper relative path in your file generation script to generate the temp_title.txt

Re: Error web

Posted: Sun Feb 04, 2018 6:46 pm
by jopara
Forgive my clumsiness, but I do not understand anything.
The .txt file is correctly overwritten each time the software sends the data to you. The only thing that does not happen is that the name that is in the .txt, is shown on the web page.
Forgive the comparison, but in Cpanel he did it without problem.

Re: Error web

Posted: Mon Feb 05, 2018 9:03 pm
by mehargags
Try adding /tmp to your basedir as I told you and post results