SlackwareでAmpache

Slackware 10.2 を使用します

必要なソフトウェアのいくつかのバージョンを試して最終的にこれで動作しました:

Mysql- 4.1
Apache Httpd- 2.2.0
PHP- 5.1

These aren't the latest versions of Mysql and PHP but they work together essentially out of the box (there is a thread somewhere on this board that I can't find right now that explains the reasoning behind this) (maybe the knowledgeable reader can add to this). Anyway, if you are having trouble like I was you can try these versions. Otherwise it was probably just the linux-black-magic that these particular versions finally worked for me.

Install Mysql

get the standard tarball untar to your prefered Base Directory (/usr/local/mysql is a keen choice) Change to chosen Base Directory (cd /usr/local/mysql)

Now from the MysqL INSTALL file:

groupadd mysql
useradd -g mysql mysql
scripts/mysql_install_db --user=mysql
chown -R root *
chown -R mysql data
chgrp -R mysql *
bin/mysqld_safe --user=mysql &

That last command started MysqL as the user 'mysql', since for security reasons we don't want to run MysqL as root. To check that we have been successful, run as root (with MYSQLBASEDIRECTORY/bin in your path) # mysqlshow

You should see two databases that have been created by default: mysql and test (you have to be root to see both). Also, 3 mysql users have been created by default. These are users only in mysql, not linux system users.

Configure Mysql

The 3 default users are a root user and two anonymous users. As it stand no passwords have been set which means that anyone can log into your running database as root and have their way. To fix that, login to your mysql database as mysql root:

mysql -u root

Then at the mysql prompt

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');
mysql> SET PASSWORD FOR 'root'@'%' = PASSWORD('password');

Optionally delete the two anonymous users created by default:

mysql> DELETE FROM mysql.user WHERE User = '';
mysql> FLUSH PRIVILEGES;

Now we will be needing a mysql user besides the mysql root user, who will need full access to the database that ampache will create. Whilst still at the mysql prompt type:

mysql> GRANT ALL PRIVILEGES ON ampache.* TO 'admin'@'localhost'
-> IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON ampache.* TO 'admin'@'%'
-> IDENTIFIED BY 'password' WITH GRANT OPTION;

Replace admin and password with desired username and password. By default ampache creates a database named ampache. If you plan to name it differently just replace ampache in the above code with the desired database name.

Install Apache

Include the following options when compiling:

./configure --prefix=/usr/local/apache --enable-so

Install PHP

Include the following options when compiling.

./configure --prefix=/usr/local/apache/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql \
--with-iconv \
--with-config-file-path=/usr/local/apache/php

Iconv will be needed for ampache to read id tags correctly. After installing PHP, while you are still in the PHP source code directory execute

cp -p php.ini-recommended /usr/local/apache/php/php.ini

so we have a default php config file, which works for us.

Setup Apache

Now we need to edit the Apache config file, /usr/local/apache/conf/httpd.conf

# Make sure there's only **1** line with this directive:
LoadModule php4_module modules/libphp4.so
# If you are using Apache 2 you may need the following to
# cause the PHP interpreter handle files with a .php extension.
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 9524288
</Files>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php
# Uncomment one of the following (but not both)
# Use for PHP 4.x:
AddHandler php-script php
AddType text/html php

Get Ampache

Now extract the latest and greatest ampache tarball into /usr/local/apache/htdocs/ampache

Make sure that in your /usr/local/apache/htdocs directory (which is your root web directory): All files are readable by everyone, writable by owner (-rw-r–r–) All folders are readable and executable by everyone, writable by owner (drwxr-xr-x)

Run Web Install

Point to http://localhost/ampache in your browser.

  • On the first page enter the password you created for your mysql root user. *Give your database the name you chose earlier.
  • On the second page enter the username and password of the mysql user created earlier.
ja/install/slackware.txt · 最終更新: 2009/01/25 22:24 by momo-i
 
特に明示されていない限り、本Wikiの内容は次のライセンスに従います: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki