Centos 6.9 Install mantisbt-2.12

yum install gcc gcc-c++ autoconf automake libtool libtool make cmake zlib zlib-devel openssl openssl-devel pcre pcre-devel numactl libaio perl-Time-HiRes per-devel libxml2 libxml2-devel curl curl-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel unzip wget bzip2 bzip2-devel gmp gmp-devel readline readline-devel libxslt libxslt-devel pcre pcre-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers ncurses ncurses-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel expat-devel -y

下载HTTP
wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.4.29.tar.gz
wget http://mirrors.hust.edu.cn/apache//apr/apr-1.6.3.tar.gz
wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
wget http://mirrors.hust.edu.cn/apache//apr/apr-iconv-1.2.2.tar.gz

解压HTTP相关
tar -zxvf httpd-2.4.29.tar.gz
tar zxvf apr-1.6.3.tar.gz -C httpd-2.4.29/srclib/ && mv httpd-2.4.29/srclib/apr-1.6.3 httpd-2.4.29/srclib/apr
tar zxvf apr-util-1.6.1.tar.gz -C httpd-2.4.29/srclib/ && mv httpd-2.4.29/srclib/apr-util-1.6.1 httpd-2.4.29/srclib/apr-util
tar zxvf apr-iconv-1.2.2.tar.gz -C httpd-2.4.29/srclib/ && mv httpd-2.4.29/srclib/apr-iconv-1.2.2 httpd-2.4.29/srclib/apr-iconv

拷贝php文件
cp /root/php-7.1.15/php.ini-production /usr/local/php7/etc/php.ini
cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
cp /root/php-7.1.15/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm


编译安装http
cd httpd-2.4.29
./configure --prefix=/usr/local/httpd2.4.29 \
--sysconfdir=/etc/httpd2.4 \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-cgid \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-included-apr \
--with-apr-iconv=srclib/apr-iconv \
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork \
--enable-include

make && make install


配置httpd启动脚本
cp /usr/local/httpd2.4.29/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache 2.4.29


开机启动httpd
chkconfig --add httpd
chkconfig httpd on


配置http
vi /etc/httpd2.4/httpd.conf
#193
ServerName IP:80

#253
   <IfModule dir_module>
  DirectoryIndex index.html index.php
  </IfModule>

开启php支持
#385
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php5

启动http
service httpd start

测试http
curl ip

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

下载libmcrypt
wget https://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz

解压libmcrypt
tar -zxvf libmcrypt-2.5.8.tar.gz

cd /libmcrypt-2.5.8
./configure
make && make install

环境so
vi /etc/ld.so.conf
/usr/local/lib
         
刷新
ldconfig

编译安装php7

下载php
wget http://cn2.php.net/distributions/php-7.1.15.tar.gz

解压php
tar -zxvf php-7.1.15.tar.gz

cd php-7.1.15

cp -frp /usr/lib64/libldap* /usr/lib/

./configure \
--prefix=/usr/local/php7 \
--with-config-file-path=/usr/local/php7/etc \
--with-config-file-scan-dir=/usr/local/php7/etc/php.d \
--with-apxs2=/usr/local/httpd2.4.29/bin/apxs \
--with-mcrypt=/usr/include \
--enable-fpm \
--enable-inline-optimization \
--enable-pcntl \
--disable-debug \
--disable-rpath \
--enable-shared  \
--enable-soap \
--with-libxml-dir \
--with-xmlrpc \
--with-openssl \
--with-mcrypt \
--with-mhash \
--with-pcre-regex \
--with-sqlite3 \
--with-zlib \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--with-cdb \
--enable-dom \
--enable-exif \
--enable-fileinfo \
--enable-filter \
--with-pcre-dir \
--enable-ftp \
--with-gd \
--with-openssl-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir  \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gettext \
--with-gmp \
--with-mhash \
--enable-json \
--enable-mbstring \
--enable-mbregex \
--enable-mbregex-backtrack \
--with-libmbfl \
--with-onig \
--enable-pdo \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-zlib-dir \
--with-pdo-sqlite \
--with-readline \
--enable-session \
--enable-shmop \
--enable-soap \
--enable-simplexml \
--enable-sockets  \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-libxml-dir \
--with-xsl \
--enable-zip \
--with-ldap \
--enable-mysqlnd-compression-support \
--with-pear \
--disable-fileinfo \
--enable-opcache

编译php
make && make install

拷贝配置文件到相应目录
cp /php-7.1.15/php.ini-production /usr/local/php7/etc/php.ini
cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
cp /php-7.1.15/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

赋予php-fpm权限
chmod +x /etc/init.d/php-fpm

开机启动php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on

启动php-fpm
/etc/init.d/php-fpm start

添加php环境变量
vi /etc/profile
export PATH=$PATH:/usr/local/php7/bin

刷新环境变量
source /etc/profile

配置php参参
vi /usr/local/php7/etc/php.ini
#1688
mbstring.func_overload = 0

#404
memory_limit = 1024M

#705
always_populate_raw_post_data = -1

#671
post_max_size = 20M

#824
upload_max_filesize = 2M

#383
max_execution_time = 300

#393
max_input_time = 300

#939
date.timezone = Asia/Shanghai
====================================================================================================================
下载mantisbt
wget https://jaist.dl.sourceforge.net/project/mantisbt/mantis-stable/2.12.0/mantisbt-2.12.0.tar.gz

解压mantisbt
tar -zxvf mantisbt-2.12.0.tar.gz

配置安装mantisbt
mv mantisbt-2.12.0 /usr/local/httpd2.4.29/htdocs/mantisbt

chmod -R 777 /usr/local/httpd2.4.29/htdocs/mantisbt

vi  /usr/local/httpd2.4.29/htdocs/mantisbt/config_defaults_inc.php 
数据库连接
46 $g_hostname                             = '192.168.2.99';
52 $g_db_username                  = 'mantisbt';
57 $g_db_password                  = 'Password';
63 $g_database_name                = 'mantisbt';
78 $g_db_type                              = 'mysql';

smtp邮件配置
642 $g_smtp_host = 'localhost';
650 $g_smtp_username = '账号';
658 $g_smtp_password = '密码'
665 $g_smtp_connection_mode = '';
674 $g_smtp_port = 25;
630 $g_phpMailer_method = 2;
422 $g_webmaster_email              = '[email protected]';
428 $g_from_email                   = '[email protected]';
440 $g_return_path_email    = '[email protected]';

1853 $g_allow_file_upload = ON;
1860 $g_file_upload_method = DISK;
810 $g_default_language = 'auto '
946 $g_fallback_language = 'chinese_simplified';

mysql 创建
mysql -u root -p
create database mantisbt;
grant all privileges on mantisbt.* to [email protected] identified by 'Password';

flush privileges;

测试页面(默认管理员账号:"administrator",默认密码:“root”)

Centos 6.9 Install mantisbt-2.12