-
Notifications
You must be signed in to change notification settings - Fork 0
/
mythtv.conf.apache
209 lines (161 loc) · 7.88 KB
/
mythtv.conf.apache
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
200
201
202
203
204
205
206
207
208
209
#
# Apache config for mythtv.org
#
<VirtualHost *:80>
ServerName www.mythtv.org
ServerAlias new.mythtv.org
#ServerAlias mythtv.schedulesdirect.org
ServerAlias mythtv.org
ServerAlias wiki.mythtv.org
ServerAlias mythtv.com www.mythtv.com
ServerAlias mythtv.info www.mythtv.info
ServerAlias alcor-2.osuosl.org
#ServerAlias mythtv.snowman.net
ServerAdmin [email protected]
## Enable these for the live site
DocumentRoot /opt/www/www.mythtv.org/htdocs
ErrorLog /opt/www/www.mythtv.org/logs/error.log
CustomLog /opt/www/www.mythtv.org/logs/access.log combined
# Enable rewrites
RewriteEngine on
# Rewrites for alternate hostnames
RewriteCond %{HTTP_HOST} ^wiki\.mythtv\.org$ [NC]
RewriteRule (.*) http://www.mythtv.org/wiki$1 [R=permanent,L,QSA,NC]
RewriteCond %{HTTP_HOST} ^([^.]+\.)?mythtv\.info$ [NC]
RewriteRule (.*) http://www.mythtv.org/wiki$1 [R=permanent,L,QSA,NC]
# One hostname to rule them all
RewriteCond %{HTTP_HOST} !^www\.mythtv\.org$
RewriteRule /?(.*) http://www.mythtv.org/$1 [R=permanent,L,QSA,NC]
# Redirect requests for our FTP directory to OSU's FTP servers
RewriteRule ^/ftp/(.*)$ ftp://ftp.osuosl.org/pub/mythtv/$1 [R,NC,L]
# Documentation redirect
RewriteRule ^/docs/(.*)$ http://www.mythtv.org/wiki/MythTV-HOWTO [R,NC,L]
#
# Aliases and links to other programs that live on the site, too
#
# Random files
Alias /misc /opt/www/misc-files
# Mailman
# ScriptAlias /cgi-bin /usr/lib/cgi-bin
# ScriptAlias /mailman /usr/lib/cgi-bin/mailman
# <Directory "/usr/lib/cgi-bin">
# AllowOverride None
# Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
# Order allow,deny
# Allow from all
# </Directory>
# Pipermail Mailman Archives
# Alias /pipermail /var/lib/mailman/archives/public
# Mediawiki
Alias /w /opt/www/wiki.mythtv.org/
Alias /wiki /opt/www/wiki.mythtv.org/index.php
# <Directory /opt/www/wiki.mythtv.org/>
# RewriteEngine on
# RewriteCond %{HTTP_HOST} !^www\.mythtv\.org$
# RewriteRule (.*) http://www.mythtv.org/wiki/$1 [R=permanent,L,QSA,NC]
# </Directory>
<Directory /opt/www/wiki.mythtv.org/images/>
AllowOverride None
php_admin_flag engine off
AddType text/plain .html .htm .shtml
</Directory>
# Not sure if this is still used, so it's disabled
#Alias /awstats-icon/ /usr/share/awstats/icon/
# The following rewrite conditions need to live within a <Directory> tag. Make
# sure that it matches the DocumentRoot defined above.
<Directory /opt/www/www.mythtv.org/htdocs/>
# Some special instructions for the controller file
<Files mythtv.*>
setenv db_file "/opt/www/web-db/mythtv.sqlite"
setenv vote_db_file "/opt/www/web-db/themevotes.sqlite"
</Files>
# PHP Configuration
<Files *.php>
# These settings are intended for apache 2.x. If your version of apache
# doesn't support php_value, or things like memory_limit aren't working
# as expected, then use these settings as examples for your own php.ini
# files.
php_value safe_mode 0
php_value register_globals 0
php_value magic_quotes_gpc 0
php_value file_uploads 0
php_value allow_url_fopen On
php_value zlib.output_handler Off
php_value output_handler NULL
# If you have a large number of channels, you may need to increase this
# value to prevent PHP from running out of memory.
php_value memory_limit 16M
# Note: php_flag does not work in older versions of php
php_flag output_handler "NULL"
</Files>
# Turn on the rewrite engine
RewriteEngine on
# Redirect some old pages so we don't lose SEO
RewriteCond %{REQUEST_URI} ^/index\.php
RewriteRule (.*) / [R=permanent,L]
RewriteCond %{REQUEST_URI} ^/modules\.php
RewriteCond %{QUERY_STRING} name=Downloads
RewriteRule (.*) /download [R=permanent,L]
RewriteCond %{REQUEST_URI} ^/modules\.php
RewriteCond %{QUERY_STRING} name=MythFeatures
RewriteRule (.*) /detail/mythtv [R=permanent,L]
RewriteCond %{REQUEST_URI} ^/modules\.php
RewriteCond %{QUERY_STRING} name=MythInstall
RewriteRule (.*) /docs [R=permanent,L]
RewriteCond %{REQUEST_URI} ^/modules\.php
RewriteCond %{QUERY_STRING} name=MythInfo
RewriteRule (.*) /support [R=permanent,L]
RewriteCond %{REQUEST_URI} ^/modules\.php
RewriteCond %{QUERY_STRING} name=Stories_Archive
RewriteRule (.*) /news [R=permanent,L]
RewriteCond %{REQUEST_URI} ^/modules\.php
RewriteCond %{QUERY_STRING} name=Web_Links
RewriteRule (.*) /support [R=permanent,L]
RewriteCond %{REQUEST_URI} ^/modules\.php
RewriteCond %{QUERY_STRING} name=News&file=article&sid=(.+?)
RewriteRule (.*) /news/%1 [R=permanent,L]
# Skip over cache-friendly rewrites
RewriteRule ^[0-9]+/(css|img|cache|js)(/.*)?$ $1$2 [PT,QSA]
# Google verification files
RewriteRule ^google.+\.html$ - [L]
# Skip out early if we've already been through rewrites,
# or if this is a /css/, /js/ or /cache/ directory request.
RewriteRule ^(css|img|cache|js|themes|schema|robots.txt|[a-z_]+\.(php))(/|$) - [L]
# Redirect most of the remaining URL requests to the main mythweb script.
# It will then handle any requests given to it.
RewriteRule ^(.+)$ mythtv.php/$1 [QSA,L]
# Catch anything else that comes through and send it to mythweb.php with no parameters.
RewriteRule ^(.*)$ mythtv.php [QSA,L]
</Directory>
# Disable ETags: http://developer.yahoo.com/performance/rules.html#etags
FileETag None
# Turn on Expires headers
ExpiresActive On
# These types should be cached for at least 36 days after the client
# downloads them because new versions will get different URLs (36 days
# to keep yslow happy in months with 31 days)
ExpiresByType text/javascript A3110400
ExpiresByType application/x-javascript A3110400
ExpiresByType text/css A3110400
# Images should be cached for at least a week
ExpiresByType image/gif A604800
ExpiresByType image/jpeg A604800
ExpiresByType image/png A604800
ExpiresByType image/x-icon A604800
# Specify the MIME type for favicon.ico in case the server configuration
# doesn't or in case the server configuration uses the IANA-approved MIME type
# (image/vnd.microsoft.icon)--which most browsers won't recognize.
AddType image/x-icon .ico
# Enable mod_deflate.
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript
# This is helpful for mod_deflate -- it prevents proxies from changing
# the user agent to/from this server, which can prevent compression from
# being enabled. It is disabled here because many distros seem not to
# enable mod_headers by default, but I recommend that you enable it.
Header append Vary User-Agent env=!dont-vary
</VirtualHost>