<p>I've been looking into different web statistics programs for my site, and one promising one is <a href="http://www.hping.org/visitors/" rel="nofollow noreferrer">Visitors</a>. Unfortunately, it's a C program and I don't know how to call it from the web server. I've tried using PHP's <a href="http://us.php.net/manual/en/function.shell-exec.php" rel="nofollow noreferrer">shell_exec</a>, but my web host (<a href="https://www.nearlyfreespeech.net/" rel="nofollow noreferrer">NFSN</a>) has PHP's <a href="http://us2.php.net/features.safe-mode" rel="nofollow noreferrer">safe mode</a> on and it's giving me an error message.</p>

<p>Is there a way to execute the program within safe mode? If not, can it work with CGI? If so, how? (I've never used CGI before)</p>

[{'answer_id': 48528, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 1, 'selected': False, 'text': "<p>Visitors looks like a log analyzer and report generator. Its probably best setup as a chron job to create static HTML pages once a day or so.</p>\n\n<p>If you don't have shell access to your hosting account, or some sort of control panel that lets you setup up chron jobs, you'll be out of luck.</p>\n"}, {'answer_id': 48556, 'author': 'Sam McAfee', 'author_id': 577, 'author_profile': 'https://Stackoverflow.com/users/577', 'pm_score': 0, 'selected': False, 'text': '<p>Is there any reason not to just use <a href="http://www.google.com/analytics/" rel="nofollow noreferrer">Google Analytics</a>? It\'s free, and you don\'t have to write it yourself. I use it, and it gives you a lot of information.</p>\n\n<p>Sorry, I know it\'s not a "programming" answer ;)</p>\n'}, {'answer_id': 48561, 'author': 'Grey Panther', 'author_id': 1265, 'author_profile': 'https://Stackoverflow.com/users/1265', 'pm_score': 0, 'selected': False, 'text': "<p>I second the answer of Jonathan: this is a log analyzer, meaning that you must feed it as input the logfile of the webserver and it generates a summarization of it. Given that you are on a shared host, it is improbable that you can access to that file, and even if you would access it, it is probable that it contains then entries for <em>all</em> the websites hosted on the given machine (setting up separate logging for each VirtualHost is certainly possible with Apache, but I don't know if it is a common practice).</p>\n\n<p>One possible workaround would be for you to write out a logfile from your pages. However this is rather difficult and can have a severe performance impact (you have to serialize the writes to the logfile for one, if you don't want to get garbage from time to time). All in all, I would suggest going with an online analytics service, like Google Analytics.</p>\n"}, {'answer_id': 48568, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 0, 'selected': False, 'text': "<blockquote>\n  <p>As fortune would have it I do have access to the log file for my site. I've been able to generate the HTML page on the server manually - I've just been looking for a way to get it to happen automatically. All I need is to execute a shell command and get the output to display as the page.</p>\n</blockquote>\n\n<p>Sounds like a good job for an intern.</p>\n\n<p>=)</p>\n\n<p>Call your host and see if you can work out a deal for doing a shell execute.</p>\n"}, {'answer_id': 48721, 'author': 'Kyle Cronin', 'author_id': 658, 'author_profile': 'https://Stackoverflow.com/users/658', 'pm_score': 1, 'selected': True, 'text': '<p>I managed to solve this problem on my own. I put the following lines in a file named visitors.cgi:</p>\n\n<pre><code>#!/bin/sh\n\nprintf "Content-type: text/html\\n\\n"\nexec visitors -A /home/logs/access_log\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/48526', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/658/']