-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
296 lines (209 loc) · 9.49 KB
/
INSTALL
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
Tunez Installation instructions:
(Written by Philip Lowman)
NOTE!!
------------
Before you begin running commands you must first determine what you want Tunez
to do for you.
There are currently 5 supported modes:
local-php
Local playback to your soundcard using a php script (requires a compiled
php binary)
local-perl
Local playback to your soundcard using a perl script and provided PQueue
perl module
ices
This is the newer icecast support (utilizes the perl support in ices
v0.3). This also requires installing the PQueue perl module.
This does NOT work with OGG files (not a limitation of Icecast v2.0 but
rather that of ices itself. Please email [email protected] and encourage
them to add support for OGG files to ices2)
shout-php (not suggested, use ices)
Shout is executed to stream audio to a shoutcast (v1) server via php.
(requires a compiled php binary)
shout-perl (not suggested, use ices)
Shout is executed to stream audio to a shoutcast (v1) server via perl.
Dependencies:
-------------
The following dependencies are required depending on what mode you are in.
Simply look above, determine your mode and if you see your mode listed you
need that software.
--
(All)
- Web server with php4 support (apache works)
- MySQL (tested with 3.23.49, 4.0.13)
- Album image support requires php compiled with libcurl support
Debian packages:
apt-get install php4 php4-mysql php4-curl apache mysql-server
--
(local-perl),(shout-perl)
- PQueue perl module (included in PQueue directory)
- DBD::Mysql perl module
Debian packages:
apt-get install libdbd-mysql-perl
--
(local-php),(shout-php)
- You will require a php binary in this mode which supports mysql calls
- Download from www.php.com
--
(shout-php),(shout-perl)
- Icecast 1.3.12 ( http://www.icecast.org/download.html )
- I think it comes with the shout command... not sure though
Debian packages:
apt-get install icecast-server icecast-client
--
(ices)
- Icecast v2.0 and all of it's dependencies. Most of them are listed in the
HOWTO-Icecast file.
- Ices v0.3 (find it here: http://www.icecast.org/ices.php )
Debian packages:
apt-get install icecast2 libshout3 libshout3-dev
(you will still have to install ices2 from source because the version packaged
in unstable is not v0.3)
Setup:
------
Please continue with the steps in this documentation.
You must perform all steps with (all) next to them. The remainder of the
steps should be performed if they are relevant to your chosen configuration
(local-perl), (local-php), (shout-perl), (shout-php), or (ices).
(all) Moving your html/ directory
---------------------------------
1. Move the contents of the html/ subdirectory in Tunez to the place where
apache can display them.
2. It is strongly recommended to leave the rest of your tunez folder in a
folder that is NOT web-accessible since sensitive data might be viewable to
people on the web (tunezd.pl, etc.)
(all) Database setup: (if you've already setup a database you can skip these)
---------------------
1. Ensure you have a root password set for mySQL. Some installed
distributions of mySQL come without a root password! If you have not yet set
a root password for your mySQL server you should do so with the following
command:
$ mysql -uroot
mysql> SET PASSWORD FOR root@localhost=PASSWORD('yourpassword');
mysql> (hit Ctrl-d)
If it responds "Access denied" after you enter "mysql -uroot",
then you already have a password...
2. Create a database called tunez or whatever you want to call it.
You can create the Tunez database with the following command or you can
simply use something like phpmyadmin if you aren't comfortable with this.
It is strongly recommended you do not use the "root" mysql user for Tunez.
$ mysql -uroot -p
MYSQL> CREATE DATABASE tunez;
MYSQL> GRANT ALL on tunez.* to tunez@localhost identified by 'your-password';
MYSQL> FLUSH privileges;
MYSQL> (hit Ctrl-D)
(all) Tunez config script setup:
--------------------------------
1. Edit config.inc.php in the root directory of Tunez and add your mysql
username, password, and database there.
2. Change the $_CONF['mode'] option to your configuration mode of choice
(local-php, local-perl, etc.)
3. Find the $_CONF['dirs'] array and add the directories you want shown on tunez to it.
4. Change anything else you like but be careful with some of the options. :)
(all) tunez.inc.php setup:
--------------------------
1. Edit tunez.inc.php in the html/ subdirectory and set the location for
including the config.inc.php file:
# You must set the path to your confic.inc.php file here! This should be
# the only thing you have to touch in this file
require_once("/path/to/config.inc.php");
(local-php), (shout-php) Tunezd.php configuration:
--------------------------------------------------
1. Set the path to tunez.inc.php in your tunezd.php file.
(local-perl), (shout-perl) tunezd.pl configuration:
-------------------------------------
1. Modify tunezd.pl and add the mysql username, password, etc. (we don't have
a unified config file yet, sorry).
2. Ensure the paths to mpg123 and ogg123 are correct if you are using local
mode. Likewise ensure the paths to the shout binary are correct if you are
using shout.
3. If you are using shout, enter the hostname and password of the icecast
server you are using where prompted.
(local-perl), (shout-perl), (ices) Compiling PQueue Perl Module:
--------------------------------------------------------
1. Run the following commands to compile and install the PQueue perl module
$ cd PQueue
$ perl Makefile.PL
$ make
# make install (as root)
2. Why are we using a perl module when a perl script would suffice?
Two reasons
1. Code reuse (check out ices.pm & tunezd.pl and compare with PQueue.pm)
2. I was bored and wanted to learn something new
(all) PHP Setup for webserver:
------------------------------
Locate your php.ini file (for your webserver). On my system (Debian) this is
at /etc/php4/apache/php.ini although YMMV
1. If you have lots of audio files find max_execution_time and make it longer
to allow for better importing of songs into Tunez. I suggest at least 2
minutes (120 seconds). You can always change it back later when you're
finished with the initial importing.
max_execution_time = 120
2. If you want HTTP uploading to work find this line and set it to the
biggest audio file size you'll ever upload to Tunez. By default it's only 2M.
I suggest 10-15M although again, YMMV.
upload_max_filesize = 15M
3. Restart apache
Run:
/etc/init.d/apache restart [ for debian ]
or
/etc/rc.d/init.d/apache restart [ for redhat/mandrake ]
(all) Compiling detach:
-----------------------
Detach is required if you want to be able to control spawning and killing
processes from the webserver. Simply run 'make' in the detach-1.2 directory.
If for some reason you don't want any web control over the tunez daemon you
can ignore this step.
$ cd detach-1.2
$ make
(all) Compiling smixer:
-----------------------
We're using a program called smixer for the volume page. If you want to be
able to change the volume you need to compile it. (Yes we know the directory
is called tmixer, but it's really not worth changing at this point)
$ cd tmixer
$ make
(local-perl),(local-php) Permissions:
-------------------------------------
If you forget this step the install script will bitch at you.
Make sure your audio devices /dev/dsp and /dev/mixer have write permissions
for the daemon (which will be launched by apache). THIS IS IMPORTANT. If you
do an "ls -l" on /dev/dsp and /dev/mixer they MUST be writeable by the user
which is running Apache, otherwise you will not hear sound.
If you aren't going to be spawning the daemon from Apache you must ensure the
user that is running tunezd.pl or tunezd.php has write permissions to /dev/dsp
and /dev/mixer
If you are the only user on your machine and don't care much about security
execute these commands as root:
chmod o+rw /dev/dsp
chmod o+rw /dev/mixer
This will allow any local user access to use your sound card.
(local-php), (shout-php) Remember you need a PHP binary!
--------------------------------------------------------
If you are using php as a daemon (tunezd.php) you will need a PHP binary in
order to start it (which you may even need to compile if you can't find a
packaged version of php for your distro which provides mysql support).
Download PHP from www.php.net and after compiling set the $_CONF['php_binary']
variable in your config.inc.php file to wherever your php binary is (probably
/usr/local/bin/php)
(all) Loading the database, and creating an admin account
-----------------
1. Go to /admin/setup/admin_setup.php in a webbrowser and go through the
wizard
2. After you have finished the wizard DELETE the setup directory or the
admin_setup.php file!!!
STEP 2 IS VERY IMPORTANT!!!! If you don't delete this file then anyone can
wipe your entire tunez database (not fun)!
(ices) Ices setup:
------------------
Make sure you compiled the PQueue module and the detach binary above.
Follow the directions in HOWTO-Icecast
(all) Security:
---------------
Ensure that the configuration files in the root of your Tunez directory are
not world readable and only readable by your webserver if you are on a system
with multiple accounts. This is because these files contain your database
password which is a bad thing to share!
config.inc.php
ices.conf (if you are using Ices)
tunez.pl (if you are using Perl)