Menu

[r3]: / docs / install_windows.html  Maximize  Restore  History

Download this file

83 lines (69 with data), 3.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Installing Switch (Windows)</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link type="text/css" rel="stylesheet" title="Default Stylesheet" href="global.css" />
</head>
<body id="constants" class="documentation">
<div id="header">
</div>
<div id="localNav">
<h2>Switch</h2>
<ul id="extensionsNav">
<li><a href="install_mac.html">Installation (Mac)</a></li>
<li><a href="install_windows.html">Installation (Windows)</a></li>
<li><a href="variables.html">Variables</a></li>
<li><a href="constants.html">Constants</a></li>
<li><a href="includes.html">Includes</a></li>
<li><a href="comments.html">Comments</a></li>
<li><a href="ignore.html">Ignore</a>
<li><a href="auto_prepending.html">Automatic Selector Prepending</a></li>
<li><a href="inheritance.html">Inheritance</a></li>
<li><a href="copy.html">Property Duplication</a></li>
<li><a href="property_lookup.html">Property Look-ups</a></li>
</ul>
</div>
<div id="mainContent">
<h2>Installing Switch (Windows)</h2>
<h3>Download Switch Source</h3>
<p>All files needed to run Switch from Apache and the command-line are located in the Switch directory.</p>
<h3>Download and install Python 2.4</h3>
<p>Switch is written in Python, which is better than Ruby by a lot. Python is available at <a href="http://www.python.org">http://www.python.org</a></p>
<h4></h4>
<p>Make sure Python is installed to your PATH.</p>
<ol>
<li>Right click "My Computer", choose "properties".</li>
<li>Click the "Advanced tab.</li>
<li>Click the "Environment variables" button.</li>
<li>In the bottom window, under System Variables, choose "Path"</li>
<li>Make sure your path to Python is included, as well as the path to Python/scripts</li>
</ol>
<h3>Download and install Apache 2</h3>
<p>Yep. Pretty straightforward on windows. Just download the installer and run.</p>
<p>You can get Apache 2 for windows here: <a href="http://httpd.apache.org/">http://httpd.apache.org/</a></p>
<h3>Install mod_python</h3>
<p>mod_python is an Apache module. It's part of the Apache project itself, and enables Python to handle web requests.</p>
<p>You can get it at: <a href="http://www.modpython.org/">http://www.modpython.org/</a></p>
<h3>Update Apache 2 Configuration (<code>/Library/Apache2/conf/httpd.conf</code>)</h3>
<p>(Add after VirtualHosts...)</p>
<div class="example">
<div class="terminal">
<pre><code>&lt;Directory '/path/to/css/dir'&gt;
AddHandler mod_python .css
PythonPath "['/path/to/switch/dir'] + sys.path"
PythonHandler switch
PythonDebug On
&lt;/Directory&gt;</code></pre></div>
</div>
<h3>Start/Restart Apache2</h3>
<ul>
<li>In the system tray, click the Apache Monitor. Click "stop", then "start"</li>
</ul>
<h2>Finished!</h2>
<p>Switch should now be installed and running properly.</p>
<p>Now your webserver will now rewite a request for http://mysite.com/<strong>css/</strong>global.css to http://mysite.com/<strong>switch/</strong>global.css and hand this request to Switch, which will look for a file named <strong>global.sss</strong> in that directory (switch/global.sss), parse it, and return the output.</p>
<p>If no .sss file is found, Switch will attempt to find an "sss" subdirectory and look for the global.sss file there. Otherwise, Switch will look for the originally requested CSS file and serve it as requested (global.css in this case), and return a 404 if neither can be found.</p>
</div>
</body>
</html>
MongoDB Logo MongoDB