Menu

[r2]: / docs / install_mac.html  Maximize  Restore  History

Download this file

157 lines (122 with data), 6.1 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
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!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 (Mac)</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 (Mac OS X)</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/Install Apple Developer Tools (1.5 or higher)</h3>
<p>You will need Apple's developer tools to compile mod_python.</p>
<h4>Panther</h4>
<p>Download and install XCode 1.5</p>
<h4>Tiger</h4>
<p>You will need the latest XCode/Developer Tools release (Xcode Tools 2.3).</p>
<h3>Download/Install GCC Update (3.3)</h3>
<p>Check your GCC version by opening Terminal and typing:</p>
<div class="example">
<div class="terminal">
<code>&gt; gcc -v</code>
</div>
</div>
<p>Your output should look like:</p>
<div class="example">
<div class="terminal">
<pre><code>&gt; gcc -v
&gt; Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
&gt; Thread model: posix
&gt; gcc version 3.3 20030304 (Apple Computer, Inc. build 1671)</code></pre></div>
</div>
<p>Make sure the version is <strong>3.3</strong> and the build is <strong>1671</strong> or later. If not, use the GCC updater (should only be needed on Panther): <a href="http://designdrive/Projects/Design_Tech/resources/Switch_Installers/gcc-1640.tar.gz">http://designdrive/Projects/Design_Tech/resources/Switch_Installers/gcc-1640.tar.gz</a></p>
<h3>Install Apache 2 (2.0.52)</h3>
<p>If you do not have Apache 2 already installed on your machine, a package installer can be found on the <a href="http://serverlogistics.com/apache2.php">Server Logistics website</a></p>
<p class="important">After installing Apache 2, both Apache 1.3 and Apache 2 may fail to automatically start on restart. Stop Apache 1.3 if it is currently running -- this may help prevent the issue.</p>
<h4>Install Apache 2 Preference Pane (Control Panel)</h4>
<p>See if there is a PreferencePane directory already</p>
<div class="example">
<div class="terminal">
<code>&gt; ls -la /Library</code>
</div>
</div>
<p>If the directory "PreferencePanes" does not exist, create it</p>
<div class="example">
<div class="terminal">
<code>&gt; mkdir /Library/PreferencePanes</code>
</div>
</div>
<p>Drag Apache2.prefPane from the disk image to the PreferencePanes directory. The next time you start System Preferences the Apache2 preference pane will appear at the bottom.</p>
<h3>Build mod_python (3.2.8)</h3>
<p>You can <a href="http://www.apache.org/dist/httpd/modpython/mod_python-3.2.8.tgz">download the mod_python (3.2.8) source</a> from the Apache Website, or reference <a href="http://www.modpython.org/">modpython.org</a></p>
<p>Decompress the file on your desktop and Terminal type the following:</p>
<div class="example">
<div class="terminal">
<code>&gt; cd ~/Desktop/mod_python-3.2.8/
./configure --with-apxs=/Library/Apache2/bin/apxs</code>
</div>
</div>
<p>(...compile...)</p>
<div class="example">
<div class="terminal">
<code>&gt; make</code>
</div>
</div>
<p>(...compile...)</p>
<div class="example">
<div class="terminal">
<code>&gt; sudo make install</code>
</div>
</div>
<p>You will need administrator priviliges and may be prompted for a password.</p>
<h3>Update Apache 2 Configuration (<code>/Library/Apache2/conf/httpd.conf</code>)</h3>
<p>(Add after LoadModule...)</p>
<div class="example">
<div class="terminal">
<pre><code># mod_python...
LoadModule python_module /Library/Apache2/modules/mod_python.so
</code></pre></div>
</div>
<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>Open the Control Panel (Apple > Control Panel)</li>
<li>Verify the syntax of the <code>http.conf</code> file ( Apache2 > Configuration > Check Syntax )</li>
<li>Start/Restart Apache2</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 serve a .css file with the name requested (global.css in this case), and return a 404 if neither can be found.</p>
</div>
</body>
</html>
MongoDB Logo MongoDB