-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathquickstart.html
More file actions
199 lines (199 loc) · 13 KB
/
quickstart.html
File metadata and controls
199 lines (199 loc) · 13 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="swiperproxy" http-equiv="default-style">
<meta content="self" http-equiv="Content-Security-Policy">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="author" content="Patrick Godschalk">
<meta name="description" content="A lightning-fast, open source web proxy that is easy for you to run and customize.">
<meta name="keywords" content="swiperproxy, swiper, proxy, web, python, http, https">
<meta name="creator" content="Patrick Godschalk">
<meta name="googlebot" content="index, follow">
<meta name="publisher" content="SwiperProxy">
<meta name="robots" content="index, follow">
<meta name="slurp" content="index, follow">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quick-start | SwiperProxy</title>
<link type="text/plain" href="humans.txt" rel="author">
<link type="image/icon" href="favicon.ico" rel="icon" sizes="152x152">
<link type="text/css" href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link id="swiperproxy" type="text/css" href="css/swiperproxy.min.css" rel="stylesheet">
<script src="lib/angular/angular.min.js" type="text/javascript"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html" hreflang="en" rel="index" title="SwiperProxy" type="text/html">SwiperProxy</a>
<button class="navbar-toggle collapsed" data-target="#navbar-main" data-toggle="collapse" type="button" aria-controls="navbar-main" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar" aria-hidden="true"></span>
<span class="icon-bar" aria-hidden="true"></span>
<span class="icon-bar" aria-hidden="true"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbar-main">
<ul class="nav navbar-nav">
<li>
<a type="text/html" href="download.html" hreflang="en"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Download</a>
</li>
<li class="active">
<a type="text/html" href="quickstart.html" hreflang="en"><span class="glyphicon glyphicon-file" aria-hidden="true"></span> Quick-start</a>
</li>
<li class="dropdown">
<a class="dropdown-toggle" id="documentation" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-book"></span> Documentation <span class="caret" aria-hidden="true"></span></a>
<ul class="dropdown-menu" aria-labelledby="documentation">
<li>
<a type="text/html" href="documentation/sysadmin.html" hreflang="en"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> For system administrators</a>
</li>
<li>
<a type="text/html" href="documentation/developer.html" hreflang="en"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> For developers</a>
</li>
</ul>
</li>
<li>
<a type="text/html" href="https://github.com/SwiperProxy/swiperproxy" hreflang="en" rel="external" target="_blank"><span class="fa fa-github" aria-hidden="true"></span> Version control</a>
</li>
<li>
<a type="text/html" href="https://github.com/SwiperProxy/swiperproxy/issues" hreflang="en" rel="external" target="_blank"><span class="glyphicon glyphicon-align-left" aria-hidden="true"></span> Issue Tracker</a>
</li>
<li>
<a type="text/html" href="donate.html" hreflang="en" rel="author"><span class="glyphicon glyphicon-heart" aria-hidden="true"></span> Donate</a>
</li>
<li>
<a type="text/html" href="contact.html" hreflang="en" rel="author"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<main class="container">
<article>
<h1>Quick-start guide <small>to get up and running within minutes</small></h1>
<p>SwiperProxy has few dependencies and can be installed in practically all major distributions.</p>
<hr>
<section>
<h2>Dependencies</h2>
<ul>
<li>Python, 2.7 or higher</li>
<li>Python IPY, 0.75 or higher</li>
<li>streamhtmlparser, 0.1 or higher</li>
</ul>
</section>
<hr>
<section>
<h2>Installing</h2>
<aside class="alert alert-info" role="alert">
<p><span class="glyphicon glyphicon-comment" aria-hidden-"true"></span> This makes some assumptions about your preferences towards retrieval method, wget vs curl, etc. You may want to look at the <a type="text/html" href="documentation/sysadmin.html" hreflang="en">detailed documentation</a>.</p>
</aside>
<section>
<h3>Select your distribution:</h3>
<div id="ng-app" ng-app>
<ul>
<li><a href="#" ng-click="debian=!debian" ng-model="debian">Debian 7 Wheezy, Debian 8 Jessie</a></li>
<li><a href="#" ng-click="centos=!centos" ng-model="centos">CentOS/RHEL 7</a></li>
</ul>
<div ng-show="debian">
<hr>
<section>
<h3>Debian 7 Wheezy, Debian 8 Jessie</h3>
<p>Install the dependencies available from the stable repository:<br>
<kbd>$ apt-get install build-essential cython python python-dev python-ipy</kbd></p>
<p>Download and extract SwiperProxy:<br>
<kbd>$ mkdir /opt/SwiperProxy</kbd><br>
<kbd>$ wget https://github.com/SwiperProxy/swiperproxy/archive/v1.1.tar.gz \</kbd><br>
<kbd>-O /usr/local/src/swiperproxy-v1.1.tar.gz</kbd><br>
<kbd>$ tar -zxvf swiperproxy-v1.1.tar.gz</kbd><br>
<kbd>$ mv swiperproxy-v1.1 /opt/SwiperProxy/swiperproxy</kbd></p>
<p>Compile streamhtmlparser and the wrapper:<br>
<kbd>$ cd /opt/SwiperProxy/swiperproxy/include/streamhtmlparser</kbd><br>
<kbd>$ ./configure</kbd><br>
<kbd>$ make</kbd><br>
<kbd>$ make install</kbd><br>
<kbd>$ cd src/py-streamhtmlparser</kbd><br>
<kbd>$ make</kbd><br>
<kbd>$ make install</kbd></p>
<p>Copy the Python packages to a location where Debian will recognize them:<br>
<kbd>$ cp /usr/local/lib/python2.7/dist-packages/* /usr/lib/python2.7/dist-packages</kbd><br>
<kbd>$ ldconfig -v</kbd></p>
<p>Create the runtime environment and add an unprivileged user:<br>
<kbd>$ mkdir /var/log/swiperproxy</kbd><br>
<kbd>$ addgroup --system swiperproxy</kbd><br>
<kbd>$ adduser --system swiperproxy --ingroup=swiperproxy --home=/opt/SwiperProxy/swiperproxy</kbd><br>
<kbd>$ chown swiperproxy:swiperproxy /var/log/swiperproxy</kbd><br>
<kbd>$ chown -R swiperproxy:swiperproxy /opt/SwiperProxy/swiperproxy</kbd></p>
</section>
</div>
<div ng-show="centos">
<hr>
<section>
<h3>CentOS/RHEL 7</h3>
<p>Install the dependencies available from the repository:<br>
<kbd>$ yum install Cython python-devel python-IPy wget</kbd></p>
<p>Install tools required to compile libraries:<br>
<kbd>$ yum groupinstall 'Development Tools'</kbd></p>
<p>Download and extract SwiperProxy:<br>
<kbd>$ mkdir /opt/SwiperProxy</kbd><br>
<kbd>$ wget https://github.com/SwiperProxy/swiperproxy/archive/v1.1.tar.gz \</kbd><br>
<kbd>-O /usr/local/src/swiperproxy-v1.1.tar.gz</kbd><br>
<kbd>$ tar -zxvf swiperproxy-v1.1.tar.gz</kbd><br>
<kbd>$ mv swiperproxy-v1.1 /opt/SwiperProxy/swiperproxy</kbd></p>
<p>Compile streamhtmlparser and the wrapper:<br>
<kbd>$ cd /opt/SwiperProxy/swiperproxy/include/streamhtmlparser</kbd><br>
<kbd>$ ./configure</kbd><br>
<kbd>$ make</kbd><br>
<kbd>$ make install</kbd><br>
<kbd>$ cd src/py-streamhtmlparser</kbd><br>
<kbd>$ make</kbd><br>
<kbd>$ make install</kbd></p>
<p>Copy the shared libraries to a location where the distribution will recognize them:<br>
<kbd>$ cp /usr/local/lib/* /usr/lib</kbd><br>
<kbd>$ ldconfig -v</kbd></p>
<p>Create the runtime environment and add an unprivileged user:<br>
<kbd>$ mkdir /var/log/swiperproxy</kbd><br>
<kbd>$ groupadd -r swiperproxy</kbd><br>
<kbd>$ useradd -d /opt/Swiperproxy/swiperproxy -g swiperproxy -M -r swiperproxy</kbd><br>
<kbd>$ chown swiperproxy:swiperproxy /var/log/swiperproxy</kbd><br>
<kbd>$ chown -R swiperproxy:swiperproxy /opt/SwiperProxy/swiperproxy</kbd></p>
</section>
</div>
</div>
</section>
</section>
<hr>
<section>
<h2>Configuring</h2>
<p>All configuration is done in the <strong>proxy.conf</strong> configuration file. A default configuration file detailing each configuration option is supplied.</p>
<p>The most important settings are:</p>
<ul>
<li><var>http_listen_port</var>, <var>https_listen_port</var>: The <abbr title="Hypertext Transfer Protocol">HTTP</abbr> and <abbr title="HTTP Secure">HTTPS</abbr> ports the proxy will listen on. You can configure the listen ports to be 80 and 443 and let users access the proxy directly by using <a type="text/html" href="documentation/sys-libcap.html" hreflang="en">libcap</a>. You can also place a <a type="text/html" href="documentation/sys-apachereverseproxy.html" hreflang="en">reverse proxy</a> in-front of SwiperProxy. In that case, the listen ports should be different.</li>
<li><var>http_port</var>, <var>https_port</var>: These are the ports the proxy is reachable on from the outside. They may be different from the listen addresses, for example in case of a <a type="text/html" href="documentation/sys-apachereverseproxy.html" hreflang="en">reverse proxy</a>.</li>
<li><var>https_certificate</var>: A Base64-encoded <abbr title="Distinguished Encoding Rules">DER</abbr> file that contains the SwiperProxy x.509 certificate, if necessary an intermediate <abbr title="Certificate Authority">CA</abbr> certificate and the private key.</li>
<li><var>hostname</var>: The hostname SwiperProxy is reachable on.</li>
<li><var>block_robots</var>: If you want to ensure that web spiders/crawlers do not try to crawl the entire internet through your proxy, you can set this setting to yes.</li>
<li><code>[rewrites]:</code>: Under this section, you can add custom rewrites for specific hostnames. The syntax is <code>hostname=newhostname</code>. For instances, if you want to ensure that http://www.example.org/ does not pass through the proxy, you could create the following rewrite: <code>www.example.org=www.example.org</code>. You can also rewrite a specific hostname to pass through a different proxy: <code>www.example.org=proxy2.example.com/www.example.org</code>.</li>
</ul>
<p>As a final configuration step, you will need to edit the <strong>index.html</strong> file found in the <strong>html</strong> directory. Change the example hostname found in that file to your selected hostname. Of course you can also apply custom styling, change the logo, etc.</p>
<p>You may want to optionally add a wildcard <abbr title="Domain Name System">DNS</abbr>-record to your proxy, e.g. <code>IN A *.proxy.example.org</code>. This allows people to also browse to, for example, http://example.org.proxy.yourdomain.tld which will be rewritten to http://proxy.yourdomain.tld/example.org. This works, even when forcing <abbr title="HTTP Secure">HTTPS</abbr>, though will likely always throw a certificate warning.</p>
</section>
<hr>
<section>
<h2>Running SwiperProxy</h2>
<p><kbd>$ sudo -u swiperproxy python Proxy.py -c proxy.conf</kbd> or <a type="text/html" href="documentation/sys-daemon.html" hreflang="en">run as a daemon</a>.</p>
</section>
</article>
</main>
<footer class="container">
<hr>
<p>
<a type="text/html" href="https://creativecommons.org/licenses/by/4.0/" hreflang="en" rel="external license" target="_blank"><img src="img/80x15.png" alt="CC-BY 4.0"></a> <small>The SwiperProxy website and SwiperProxy documentation is licensed under a <a type="text/html" href="https://creativecommons.org/licenses/by/4.0/" hreflang="en" rel="external license" target="_blank">Creative Commons Attribution 4.0 International License</a>.</small>
<br>
<img src="img/freesoftware.png" alt="Free Software"> <img src="img/opensource.png" alt="Open Source"> <a type="text/html" href="https://github.com/SwiperProxy/swiperproxy/blob/develop/doc/COPYING.md" hreflang="en" rel="external license" target="_blank"><img src="img/mitlicense.png" alt="MIT License"></a> <small>SwiperProxy is free and open source software available under the <a type="text/html" href="https://github.com/SwiperProxy/swiperproxy/blob/develop/doc/COPYING.md" hreflang="en" rel="external license" target="_blank"><abbr title="Massachusetts Institute of Technology">MIT</abbr> license</a>.</small>
</p>
</footer>
<script src="lib/jquery/jquery.min.js" type="text/javascript"></script>
<script src="lib/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</body>
</html>