Ticket #4992: d915.conf

File d915.conf, 8.7 KB (added by panachoi@…, 12 years ago)

/etc/httpd/conf.d/d915.conf

Line 
1#
2# Apache configuration directives for MythWeb.  Please read INSTALL for setup
3# requirements and troubleshooting, along with the comments in this file.
4#
5
6############################################################################
7# If you intend to use authentication for MythWeb (see below), you will
8# probably also want to uncomment the following rules, which disable
9# authentication for MythWeb's download URLs so you can properly stream
10# to media players that don't work with authenticated servers.
11#
12#    <LocationMatch .*/pl/stream/[0-9]+/[0-9]+>
13#        Allow from all
14#    </LocationMatch>
15#
16#    <LocationMatch .*/music/stream.php>
17#        Allow from all
18#    </LocationMatch>
19
20
21#
22# CHANGE THIS PATH TO MATCH YOUR MYTHWEB INSTALLATION DIRECTORY!  e.g.
23#
24#    /var/www
25#    /home/www/htdocs
26#    /var/www/html/mythweb
27#    /srv/www/htdocs/mythweb
28#
29    <Directory "/var/www/html/d915">
30
31    ############################################################################
32    # I *strongly* urge you to turn on authentication for MythWeb.  It is disabled
33    # by default because it requires you to set up your own password file.  Please
34    # see the man page for htdigest and then configure the following four directives
35    # to suit your authentication needs.
36    #
37    #    AuthType           Digest
38    #    AuthName           "MythTV"
39    #    AuthUserFile       /var/www/htdigest
40    #    Require            valid-user
41    #    BrowserMatch       "MSIE"      AuthDigestEnableQueryStringHack=On
42    #    Order              allow,deny
43    #    Satisfy            any
44    #
45    #  * If you're running Apache earlier than 2.2, you will need to use
46    #    the AuthDigestFile command instead of AuthUserFile (3rd line above).
47    #
48    ############################################################################
49    # Some special instructions for the MythWeb controller files
50    #
51        <Files mythweb.*>
52
53        #
54        # Use the following environment settings to tell MythWeb where you want it to
55        # look to connect to the database, the name of the database to connect to, and
56        # the authentication info to use to connect.  The defaults will usually work
57        # fine unless you've changed mythtv's mysql.txt file, or are running MythWeb on
58        # a different server from your main backend.  Make sure you have mod_env enabled.
59        #
60            setenv db_server        "d915"
61            setenv db_name          "mythconverg"
62            setenv db_login         "mythtv"
63            setenv db_password      "mythtv"
64
65        #
66        # By default, MythWeb uses the hostname program to look up the hostname of the
67        # machine it runs on.  If this reports incorrect data, or you run MythWeb on a
68        # machine without the hostname program, set this to your current hostname.
69        #
70        #   setenv hostname         "my_mythbox"
71        #
72
73        # By default, php will always search the current directory for include files,
74        # but if you wish to install these directories outside of the current path
75        # (eg. for security reasons), set this variable to the directory that
76        # contains the directories like languages and templates.  eg.
77        #
78        #       setenv include_path      "/var/www/html/d915"
79
80        # If you want MythWeb to email php/database errors (and a backtrace) to you,
81        # uncomment and set the email address below.
82        #
83        # setenv error_email       "go_away@hell.org"
84        #
85
86        # If your local file system is something other than UTF-8, set this variable
87        # so that the music and video portions of MythWeb can provide proper links
88        # to your downloadable files.
89        #
90        #   setenv fs_encoding       "ISO-8859-1"
91
92        </Files>
93
94    ############################################################################
95    # The following settings relate to PHP config.
96    #
97
98        <Files *.php>
99
100        #  These settings are intended for apache 2.x.  If your version of apache
101        #  doesn't support php_value, or things like memory_limit aren't working
102        #  as expected, then use these settings as examples for your own php.ini
103        #  files.
104            php_value safe_mode                     0
105
106            php_value memory_limit                  32M
107
108            php_value register_globals              0
109            php_value magic_quotes_gpc              0
110            php_value file_uploads                  0
111            php_value allow_url_fopen               On
112
113            php_value zlib.output_handler           Off
114            php_value output_handler                NULL
115
116        # Note: php_flag does not work in older versions of php
117            php_flag output_handler                 "NULL"
118
119        </Files>
120
121    ############################################################################
122    # The settings below relate specifically to mod_rewrite and the rewrite
123    # engine used to make the MythWeb user experience a little easier to deal
124    # with by simplifying the URLs needed to access the various sections.  Do
125    # not touch these settings unless you really know what you're doing..
126    #
127
128    # Turn on the rewrite engine
129        RewriteEngine  on
130
131    # If MythWeb is installed outside of the document root (eg. using Alias) then
132    # you will need to set this directive to the base URL that MythWeb is visible
133    # from externally.  If you do not, the web server will return 'not found'.
134    #    RewriteBase    /mythweb
135
136    # Skip out early if we've already been through rewrites,
137    # or if this is a /css/, /js/ or /cache/ directory request.
138        RewriteRule    ^(css|data|images|js|themes|skins|README|INSTALL|[a-z_]+\.(php|pl))(/|$)     -     [L]
139
140    # Redirect /pl/ requests to the perl cgi handler.
141        RewriteRule     ^(pl(/.*)?)$            mythweb.pl/$1               [QSA,L]
142
143    # Redirect most of the remaining URL requests to the main mythweb script.
144    # It will then handle any requests given to it.
145        RewriteRule     ^(.+)$                  mythweb.php/$1              [QSA,L]
146
147    # If you're experiencing trouble with the previous two lines in your copy of
148    # apache, you could instead use something like:
149    #        RewriteRule     ^(pl(/.*)?)$           mythweb.pl?PATH_INFO=/$1    [L,QSA]
150    #        RewriteRule     ^(.+)$                 mythweb.php?PATH_INFO=/$1   [L,QSA]
151
152    # Catch anything else that comes through and send it to mythweb.php with no parameters.
153        RewriteRule     ^(.*)$                  mythweb.php                 [QSA,L]
154
155    ############################################################################
156    # You really shouldn't need to edit anything below this line, so please
157    # don't unless you know what you're doing.
158    #
159
160    # Allow .htaccess to override whatever it wants from the server config.
161        AllowOverride   All
162
163    # Allow browsers to follow symlinks that point outside of the web document
164    # tree.  This is how we access music, videos, etc.
165        Options         FollowSymLinks
166
167    # MythTV now uses the correct file suffix for mpeg files, so all .nuv files
168    # should actually be NuppleVideo.  However, apache probably doesn't know what
169    # those are, so we should tell it.
170        AddType video/nuppelvideo   .nuv
171
172    # Specify the MIME type for favicon.ico in case the server configuration
173    # doesn't or in case the server configuration uses the IANA-approved MIME type
174    # (image/vnd.microsoft.icon)--which most browsers won't recognize.
175        AddType image/x-icon        .ico
176
177    # Enable mod_deflate.  This works MUCH more reliably than PHP's built-in
178    # gzip/Zlib compressors.  It is disabled here because many distros seem not
179    # to enable mod_deflate by default, but I strongly recommend that you
180    # enable this section.
181    #
182    BrowserMatch ^Mozilla/4 gzip-only-text/html
183    BrowserMatch ^Mozilla/4\.0[678] no-gzip
184    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
185    #
186    AddOutputFilterByType DEFLATE text/html
187    AddOutputFilterByType DEFLATE text/css
188    AddOutputFilterByType DEFLATE application/x-javascript
189
190    # This is helpful for mod_deflate -- it prevents proxies from changing
191    # the user agent to/from this server, which can prevent compression from
192    # being enabled.  It is disabled here because many distros seem not to
193    # enable mod_headers by default, but I recommend that you enable it.
194    #
195    Header append Vary User-Agent env=!dont-vary
196
197    # Set up the perl handler so we can stream properly.  Do not use mod_perl
198    # because it has a tendency to hold onto child processes, which causes
199    # problems if the browser closes on an in-progress stream.
200    #
201        <Files *.pl>
202            SetHandler cgi-script
203            Options +ExecCGI
204        </Files>
205
206    </Directory>
207