继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Apache+Mysql+php+ZenTaoPMS安装配置文档

慕UI0519722
关注TA
已关注
手记 296
粉丝 85
获赞 267

基于Apache+Mysql+php+ZenTaoPMS安装配置

一、Apache安装配置

tar zxvf httpd-2.2.23.tar.gz
cd httpd-2.2.23

mkdir –p /usr/local/app/apache2

./configure --prefix=/usr/local/app/apache2 --enable-so \

--enable-maintainer-mode --enable-rewrite     #添加后面的参数是为了解析svn

make && make install

/usr/local/app/apache2/conf/httpd.conf         #apache主配置文件          /usr/local/app/apache2/bin/apachectl –t       #检查配置是否正确(Syntax OK)

/usr/local/app/apache2/bin/apachectl  –v      #查看版本信息(正确安装)

/usr/local/app/apache/bin/apachectl  {start/stop/restart}       #基本命令

#输入http://192.168.0.210/#提示It Works!  表示安装成功


#下面是可选命令参数(供参考)

cpsupport/apachectl /etc/init.d/httpd

vi/etc/init/httpd

# Startup script for the Apache Web Server

# chkconfig: - 85 15

# description: Apache is a World Wide Web server. It is used toserve

# HTML files and CGI.

# processname: httpd

# pidfile: /usr/local/app/apache2/log/httpd.pid

# config: /usr/local/app/apache2/conf/httpd.conf

chmod 755 /etc/init.d/httpd

mkdir -p /var/log/httpd/access_log

service httpd  {start/stop/restart/status}

vim http.conf

   Listen 8888

   LoadModule php5_module        modules/libphp5.so    

          User apache

          Group apache

          ServerName 192.168.0.201:8888

          <IfModule dir_module>

               DirectoryIndex index.php index.html

          </IfModule>

          AddType application/x-httpd-php .php

          AddType application/x-httpd-php-source .phps        

          </VirtualHost>

          <Directory /usr/local/app/apache2/htdocs/>

              AllowOverride all

              Options -MultiViews

          </Directory>

          <VirtualHost *:8888>

              ServerName pj.zentao.com

              DocumentRoot /usr/local/app/apache2/htdocs/

          </VirtualHost>


二、Mysql安装配置

groupaddmysql                              #添加分组

useradd-g mysql -d /usr/local/mysql -s /sbin/nologin mysql #添加用户

tarzxvf mysql-5.5.tar.gz

mvmysql-5.5 /usr/local/mysql

cd/usr/local/mysql

chown –Rmysql:mysql . #修改权限,相当于chown-R mysql . /chgrp -R mysql.

mkdir –p/u1/mysql/data                    #创建数据存放库

mkdir –p/u1/mysql/logs                    #创建日志库

chown –Rmysql.mysql  /u1/mysql/data       #设置权限

chown –Rmysql.mysql  /u1/mysql/logs       #下面是初始化数据库

#修改主配置文件my.cnf

basedir        = /usr/local/mysql

datadir         =/u1/mysql/data

bind-address    =192.168.0.210

port           = 3306

socket          =/tmp/mysql.sock

log-bin         =/u1/mysql/logs/mysql-bin

innodb_log_group_home_dir = /u1/mysql/logs

./scripts/mysql_install_db--user=mysql

--defaults-file=/usr/local/mysql/my.cnf

cpsupport-files/my-medium.cnf /etc/my.cnf          #有提示输入y

cpsupport-files/mysql.server /etc/init.d/mysql.server

bin/mysqld_safe--user=mysql &      #在后台启动mysql服务,ctrl+c退出

vim /etc/profile                    #设置环境变量,添加如下内容(重启生效)

PATH=$PATH:/usr/local/mysql/bin/

export PATH

mysql                               #登录数据库(正确登录,表示安装完成)

mysql>create database zentao;

mysql>grant all privileges on zentao.* to 'bug'@'localhost'identified by 'bug*()';

mysql>flush privileges;

vimstart.sh                        #建立启动脚本文件,添加如下一行内容

/usr/local/mysql/bin/mysqld--defaults-file=/usr/local/mysql/my.cnf &

chmod+x start.sh                   #添加可执行权限


#下面是可选命令参数(供参考)

cp support-files/mysql.server/etc/init.d/mysql

chmod 755 /etc/init.d/mysql

chkconfig --add mysql

chkconfig --level 35 mysql on               #设置开机启动

service mysql start

/usr/local/mysql/bin/mysqladmin-u root password ‘123456

/usr/local/mysql/bin/mysql -uroot -p 123456


三、php安装:

tar zxvf libmcrypt-2.5.7.tar.gz

cd libmcrypt-2.5.7

./configure

make && make install

mkdir –p /usr/local/app/php

tar zxvf php-5.4.8.tar.gz

cd php-5.4.8

yum install bison

./configure \

--prefix=/usr/local/app/php \

--with-mysql=/usr/local/mysql \

--with-apxs2=/usr/local/app/apache2/bin/apxs \

--with-gd --with-jpeg-dir=/usr/lib--enable-gd-native-ttf \

--with-zlib-dir=/usr/lib --with-png-dir=/usr/lib \

--with-freetype-dir=/usr/include/freetype2 \

--enable-sockets --enable-ftp --enable-mbstring \

--with-pdo-mysql=shared


libtool --finish/u1/tool/php-5.4.8/libs


注:--with-pdo-mysql=shared加载使php支持mysql连接(省略第六步)

*******************************************************************************

问题1:

[root@gy210 ~]# /usr/local/app/apache2/bin/apachectl-t

httpd: Syntax error online 422 of /usr/local/app/apache2/conf/httpd.conf: Cannot load/usr/local/app/apache2/modules/libphp5.so into server:/usr/local/app/apache2/modules/libphp5.so: undefined symbol: OnUpdateBool


问题2:

[root@gy210 ~]#/usr/local/app/apache2/bin/apachectl -t

httpd: Syntax error on line 422 of/usr/local/app/apache2/conf/httpd.conf:Cannot load/usr/lib/apache2/modules/libphp5.so into server:/usr/lib/apache2/modules/libphp5.so: undefined symbol: zend_parse_parameters

解决办法:

yum install bison

******************************************************************************

make && makeinstall

cp php.ini-development/usr/local/app/php/lib/php.ini

cd /usr/local/app/php/etc

cp php-fpm.conf.default php-fpm.conf

vim php.ini

   expose_php= off

   max_execution_time= 300

   max_input_time= 120

   memory_limit= 64M

   error_reporting= E_ALL | E_STRICT

   display_errors= off

   error_log= /u1/logs/php_errors.log

   post_max_size= 16M

       extension_dir="/usr/local/app/php/lib/php/extensions/

no-debug-non-zts-20100525"

extension=pdo_mysql.so

extension=mcrypt.so

extension=http.so

extension=apc.so

extension=sphinx.so

upload_tmp_dir = /dev/shm

upload_max_filesize = 32M

allow_url_fopen = off

date.timezone = Asia/Shanghai

session.entropy_length = 0

session.entropy_file =


四、安装ZenTaoPms:

unzip ZenTaoPms.zip

mv ZenTaoPms /usr/local/app/apache2/htdocs/             #采用页面安装方式

chown -R apache:apache /usr/local/app/apache2/htdocs/

http://192.168.0.210:8888/zentaopms/www/install.php 或者:

http://pj.zentao.com/zentaopms/www/install.php


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP