This installation procedure describes the server version with a system wide installation on a LAMP system. After installing the required software phTagr must be initialized which is described in SetupProcedure. Please read the SoftwareRequirements before installing!
The given installation examples are based in on Ubuntu 10.04 but works similar on other system, too.
You are not an Web admin and want to install phTagr anyway? See Alternative Installation
You're running a phTagr and want to upgrade phTagr? See also:
- HowToUpdatePhtagr - Upgrade your phTagr with GIT or ZIP archives
Most likey you have already installed your LAMP with apache, mySQL and PHP. But if not, here are the required commands to install your first LAMP!
$ sudo apt-get install apache2 libapache2-mod-php5 php5-mysql php5-gd php5-cli php5-mcrypt mysql-server mysql-client
Enable Apache2's rewrite module:
$ sudo a2enmod rewrite
To allow overwrites by .htaccess files edit /etc/apache2/sites-enabled/000-default and change section of <Directory /var/www/>: Change AllowOverride None to AllowOverride All. The section should look like:
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>
Adjust some PHP limitations for the upload and edit /etc/php5/apache2/php.ini. Change the values of upload_max_filesize and post_max_size to 128M. See UploadLimits for further information.
; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 128M ... ; Maximum size of POST data that PHP will accept. ; http://php.net/post-max-size post_max_size = 128M
Now reload the configuration of Apache2.
$ sudo /etc/init.d/apache2 reload
(Optional:) Install external Programms
phTagr runs fine on a simple LAMP. However it can do more with some external helper programs:
- Exiftool is used to write back the MetaData to the image files like tags, categories, locations, date and geolocations. So all tags are saved within your photos an can be used by other programs! Without exiftool, only import (read) of MetaData is supported.
- FFmpeg is used to convert video files (AVI, MPEG, MOV) to flash videos. It is also used to create video thumbnails. Without ffmpeg phTagr can handle only flash movies. See also CreateFlashVideo
- ImageMagick is used alternativly to the GD library to create image previews.
- flvtool2 is used for creating better flash movies with cuepoint. This tool is really optional
You can install these programs with following command:
$ sudo apt-get install ffmpeg flvtool2 imagemagick libimage-exiftool-perl
Creating the database
Next we have to create a database which phTagr needs to store information:
$ sudo mysql -u root mysql> CREATE DATABASE phtagr DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; mysql> GRANT ALL ON phtagr.* TO 'phtagr'@'localhost' IDENTIFIED BY 'secretpassword'; mysql> quit
Download and prepare phTagr
cd /var/www sudo wget http://sourceforge.net/projects/phtagr/files/latest -O phTagr.tar.gz sudo tar xzf phTagr.tar.gz
Now your folder structure looks like this:
Now we need to make some folders accessible for the web server
$ cd phtagr $ sudo chown -R www-data config users tmp
(Or you can also use -with appropriate security caution- cd phtagr && sudo chmod -R go+w config users tmp)
Warning: If your rewrite does not work, the files of the users are not protected and are readable by the world! You should move phtagr's files to another location, copy the webroot to /var/www as phtagr and configure properly the settings in its index.php.
Note: Apache should run with enabled mod_rewrite. It not see http://book.cakephp.org/2.0/en/installation/advanced-installation.html#apache-and-mod-rewrite-and-htaccess
If you don't see anything you might have a problem with apaches redirection. Please see http://book.cakephp.org/2.0/en/installation/advanced-installation.html#apache-and-mod-rewrite-and-htaccess
[From cakePHP's book] If you don't want or can't get mod_rewrite (or some other compatible module) up and running on your server, you'll need to use Cake's built in pretty URLs. In config/core.php, uncomment the line that looks like:
Other methods for installing phTagr:
- HowToInstallInUserDir - Installes phTagr in your home directory (~/public_html)
- HowToInstallFromGit - Installes phTagr from code repository Git
- HowToMigrateToGit - Migrate a release installation to the Git version
- HowToInstallWamp - Install phTagr on Windows using WAMP
- phTagr+nginx - Rewrite rules for NGINX Webserver
|Please help us to make phtagr more popular Tell friends about it, add links to your blog or bookmark system, add your gallery to PhtagrInTheWild - read HowToHelp for more details|