红联Linux门户
Linux帮助

CentOS安装Zenphoto-用于创建网络相册的CMS

发布时间:2016-10-17 11:50:39来源:topspeedsnail.com作者:斗大的熊猫
Zenphoto是专注于创建网络相册的开源内容管理系统,基于PHP+MySQL。支持图片、视频、音频媒体,具备RSS输出、FTP上传、Tag、评论回复等功能。
This makes Zenphoto the ideal CMS for personal websites of illustrators, artists, designers, photographers, film makers and musicians.
主页:http://www.zenphoto.org/
Zenphoto源代码:https://github.com/zenphoto/zenphoto
 
1、安装LAMP(或LEMP)
yum install httpd mariadb-server php php-curl php-cli php-mysql php-pdo php-common php-gd php-mbstring
启动apache和mysql/mariadb服务:
systemctl start mariadb.service
systemctl start httpd.service
运行MariaDB初始化安全脚本(默认密码为空):
mysql_secure_installation
 
2、安装ImageMagic
yum install gcc php-devel php-pear ImageMagick ImageMagick-devel ImageMagick-perl
pecl install imagick
配置php添加imagick支持:
echo "extension=imagick.so" > /etc/php.d/imagick.ini
查看PHP是否已开启imagick:
php -m | grep imagick
重启Apache:
systemctl restart httpd
 
3、为Zenphoto创建数据库
mysql -u root -p
MariaDB [(none)]> CREATE DATABASE zenphoto_db;
MariaDB [(none)]> CREATE USER 'zenphoto'@'localhost' IDENTIFIED BY 'test1234';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON zenphoto_db.* TO 'zenphoto'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
上面SQL语句创建了一个zenphoto_db数据库和一个zenphoto用户(密码test1234)。
 
4、下载Zenphoto
cd /tmp
wget https://github.com/zenphoto/zenphoto/archive/zenphoto-1.4.13.zip
unzip zenphoto-1.4.13.zip -d /var/www/html/
mv /var/www/html/zenphoto-zenphoto-1.4.13 /var/www/html/zenphoto
更改目录权限:
chown -R apache:apache /var/www/html/zenphoto
 
5、配置Apache
创建虚拟主机配置文件:
vim /etc/httpd/conf.d/zenphoto.conf
写入如下内容:
<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/zenphoto/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/zenphoto-error_log"
CustomLog "/var/log/httpd/zenphoto-access_log" combined
<Directory "/var/www/html/zenphoto/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
注意替换域名。
重启apache:
systemctl restart httpd
 
6、完成安装
创建配置文件:
cd /var/www/html/zenphoto/
cp zp-core/zenphoto_cfg.txt zp-data/zenphoto.cfg.php
设置数据库连接:
vim zp-data/zenphoto.cfg.php
CentOS安装Zenphoto-用于创建网络相册的CMS
使用浏览器访问:your_domain.com
CentOS安装Zenphoto-用于创建网络相册的CMS
按照提示修复问题,主要是权限问题;关闭SELinux(http://www.linuxdiyf.com/linux/8270.html)。
CentOS安装Zenphoto-用于创建网络相册的CMS
设置管理员用户,完成安装:
CentOS安装Zenphoto-用于创建网络相册的CMS
CentOS安装Zenphoto-用于创建网络相册的CMS
 
本文永久更新地址:http://www.linuxdiyf.com/linux/25116.html