jablonka.czprosek.czf

weathermap

Subversion Repositories:
[/] [docs/] [pages/] [install-cli-editor.html] - Blame information for rev 133

 

Line No. Rev Author Line
11simandl<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 
4<html lang="en" xml:lang="en">
5<head>
6 <link rel="stylesheet" type="text/css" media="screen" href="weathermap.css" />
7 <meta name="generator" content=
8 "HTML Tidy for Mac OS X (vers 12 April 2006), see www.w3.org" />
9 
10 <title>PHP Weathermap
1185simandlv0.97a
121simandl - Installation - Command-Line Tool and Editor</title>
13<style type="text/css" media="print">
14/*<![CDATA[*/
15body { font-size: 12pt; }
16a { color: black; text-decoration: underline; font-weight: normal;}
17/*]]>*/
18</style>
19 
20</head>
21 
22<body>
23 <div id="frame">
24 
25 
2685simandl<div class="navcontainer">
27 <ul id="navlist">
28 <li><a href="main.html">Main Page</a></li>
29 <li><a href="main.html#installation">Installation</a></li>
30 <li><a href="main.html#basics">Basics</a></li>
31 <li><a href="faq.html">FAQ and Tips</a></li>
32 <li><a href="main.html#example">Sample Map</a></li>
33 <li><a href="cli-reference.html">CLI Reference</a></li>
34 <li><a href="config-reference.html">Config Reference</a></li>
35 <li><a href="advanced.html">Advanced Topics</a></li>
36 <li><a href="editor.html">Editor</a></li>
37 <li><a href="cacti-plugin.html">Cacti Plugin</a></li>
38 <li><a href="http://www.network-weathermap.com/">Site</a></li>
39 </ul>
40</div>
41 
42<div id="header">
431simandl <h1>PHP Weathermap
4485simandlv0.97a
45</h1>
46 <h4>Copyright &copy; 2005-2010 Howard Jones, <tt><a
47href="mailto:howie@thingy.com">howie@thingy.com</a></tt>. (<a
48href="http://www.network-weathermap.com/">Website</a>)</h4>
49</div>
501simandl 
51 
52 <h2>Installation</h2>
53 <h3>Command-Line Tool and Editor</h3>
54 
55<h4>Requirements</h4>
56<p>You will need the 'pcre' and 'gd' PHP modules in <em>both your command-line and server-side (mod_php/ISAPI) PHP</em>. The command-line tool runs using the command-line PHP, and the editor uses the server-side one. In some situations it is possible to have two completely different PHP installations serving these two - if you install from a package, then re-install from source, but to a different directory, for example. The editor and the CLI tool should both warn you if the part they need is not present.</p>>
5785simandl<p>The command-line tool uses the Console_Getopt <a href="http://pear.php.net/">PEAR</a> module. This comes as standard with PEAR, so you should be able to just install PEAR to get it. This may be a seperate package/port/RPM on your system, or you may need to install it from pear.php.net</p>
581simandl<p>Before you start using it, you might want to change one PHP setting. Weathermap uses a fair bit of memory by PHP standards, as it builds the image for the map in memory before saving it. As a result, your PHP process <i>may</i> run out of memory. PHP has a 'safety valve' built-in, to stop runaway scripts from killing your server, which defaults to 8MB in most versions (this has changed in 5.2.x). This is controlled by the 'memory_limit =' line in php.ini. You may need to increase this to 32MB or even more if you have problems. These problems will typically show up as the process just dying with no warning or error message, as PHP kills the script.</p>
59 
60<h4>Installation</h4>
61 
62<p>Unpack the zip file into a directory somewhere. If you are intending to use the browser-based editor, then the directory that you unpack the zip file into should be within the 'web space' on the web server that runs your data-collection application (that is, Cacti, MRTG, or similar) - /var/www/html, /usr/local/www/data or whatever it is for you.</p>
63 
64<p>You can then use the pre-install checker to see if your PHP environment has everything it needs. To do this, you need to run a special <tt>check.php</tt> script, twice...</p>
65<p>First, go to http://yourcactiserver/plugins/weathermap/check.php to see if your webserver PHP (mod_php, ISAPI etc) is OK. Then, from a command-prompt run <tt>php check.php</tt> to see if your command-line PHP is OK. If any modules or functions are missing, you will get a warning, and an explanation of what will be affected (not all of the things that are checked are deadly problems).</p>
66 
67<p> You'll need to edit two lines in the <tt>weathermap</tt> file:
68 <ul>
69 <li>If you are on a Unix-based platform (BSD, OS X, Linux etc), the path in the very top line should be the full path to your command-line php executable (usr/bin/php, or /usr/local/bin/php usually).</li>
70 
71 <li>Around line 30 or so, you may need to change the path to your rrdtool executable, if you are intending to use RRD-based datasources for your maps.</li>
72 </ul>
73 </p>
74 
75<h4>Testing</h4>
76 That should be it! You should be able to run
77</p>
78 <div class="shell">
79 <tt>./weathermap</tt><br />
80 or<br />
81 <tt>php weathermap</tt> (on Windows you will need this one)
82 </div><p>from a shell or command prompt, and get a (rather boring) <tt>weathermap.png</tt> file in
83 return. If you don't, you <i>should</i> get some kind of error to help you figure out why.</p>
84 
85<h4>Editor</h4>
86<p>Once you have weathermap itself working, continue onto the editor:</p>
87 
88<p>
89Copy the <tt>editor-config.php-dist</tt> file to <tt>editor-config.php</tt>. If you use Cacti, and want to be able to pick data sources from your Cacti installation by name, edit the file and make sure that the line that sets <tt>$cacti_base</tt> is correct, and that the base URI below that is also correct for your Cacti installation (these two lines are marked CHANGE in the file).
90</p>
91<p>
92Make sure that your webserver can write to the configs directory. To do this, you need to know which user your webserver runs as (maybe 'nobody', 'www' or 'httpd' on most *nixes) and then run:
93 
94<div class="shell">
95<pre>chown www configs
96chmod u+w configs</pre>
97</div>
98 
99In a pinch, you can just <tt>chmod 777 configs</tt>, but this <em>really isn't</em> a recommended solution for a production system.</p>
100<p>On Windows, the same applies - the user that runs the webserver runs as should have permissions to write new files, and change existing files in the configs folder.</p>
101</p>
10285simandl 
103<p>Since version 0.97, you now also need to enable the editor. The reason is so that you can't have the editor enabled without
104 knowing about it. The editor allows access to your config files without authentication, so you should consider using
105 features in your webserver to limit who can access <tt>editor.php</tt>. For example, on an Apache server, something like:
106 <pre>
107 &lt;Directory /var/www/html/weathermap&gt;
108 &lt;Files editor.php&gt;
109 Order Deny,Allow
110 Deny from all
111 Allow from 127.0.0.1
112 &lt;/Files&gt;
113 &lt;/Directory&gt;
114 </pre>
115When you are happy that the world can't edit your maps, then enable the editor. This is done by editing the top of editor.php and changing <code>$ENABLED=false;</code> to <code>$ENABLED=true;</code></p>
116 
117 
1181simandl<p>
119 You should now be able to go to http://yourserver/wherever-you-unpacked-weathermap/editor.php in a browser, and get a welcome page that offers to load or create a config file. That's it. All done. Please see the <a href="editor.html">editor manual page</a> for more about <i>using</i> the editor!
120</p>
121<p>
122 <strong>Important Security Note:</strong> The editor allows <i>anyone</i> who can access editor.php to change the configuration files for your network weathermaps. There is no authentication built-in for editing, even with the Cacti Plugin. This is why the configuration file doesn't exist by default - the editor won't work until you choose to make it work. It's recommended that you either: <ul><li>change the ownership of configuration files so that the editor can't write to them once they are complete, or </li><li>use your webserver's authentication and access control facilities to limit who can access the editor.php URL. On apache, this can be done using the FilesMatch directive and mod_access.</li></ul>
123</p>
124 
125 
126 </div>
127</body>
128</html>

Powered by WebSVN 2.2.1