CentOS7+ApacheServer2.4+MariaDB10.0+PHP7.0+禅道项目管理软件8.0环境部署

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,高可用系列 2核4GB
云数据库 RDS PostgreSQL,高可用系列 2核4GB
简介: CentOS7+ApacheServer2.4+MariaDB10.0+PHP7.0+禅道项目管理软件8.0环境部署

CentOS7+ApacheServer2.4+MariaDB10.0+PHP7.0+禅道项目管理软件8.0环境部署

 


目录

一、        实践环境

二、        安装操作系统

三、        安装MariaDB数据库

四、        安装Apache Server

五、        PHP安装与配置

六、        安装禅道项目管理系统(PMS

 

一、     实践环境

CentOS 7操作系统(CentOS-7-x86_64-DVD-1503-01.iso)

下载地址:http://ftp.riken.jp/Linux/centos/7/isos/x86_64/

 

Apache HTTP Server(httpd-2.4.17.tar.gz)

下载地址1http://pan.baidu.com/s/1c1pfUiW

下载地址2http://httpd.apache.org/download.cgi

 

 

MariaDB 10.0(MariaDB-10.0.19-centos7-x86_64)

下载地址1http://pan.baidu.com/s/1jH3gPbK

下载地址2https://downloads.mariadb.org/mariadb/+releases/

 

 

PHP 7.0(php-7.0.0.tar.gz)

下载地址1:http://pan.baidu.com/s/1o7v7hou

下载地址2http://php.net/downloads.php

 

 

禅道项目管理软件8.0.stable版本(ZenTaoPMS.8.0.stable.zip)

下载地址1http://pan.baidu.com/s/1bolelv5

下载地址2

http://sourceforge.net/projects/zentao/files/8.0/ZenTaoPMS.8.0.stable.zip/download

 

Apache Server安装相关依赖软件

apr(apr-1.5.2.tar.gz), apr-util(apr-util-1.5.4.tar.gz)

下载地址:http://mirrors.cnnic.cn/apache/apr/

 

pcre(pcre-8.37.tar.gz)

下载地址:http://pcre.org/

 

PHP安装相关依赖软件

libxml2(libxml2-2.6.27.tar.gz)

下载地址:http://download.chinaunix.net/download/0007000/6095.shtml

 

以上依赖软件包集合下载地址2http://pan.baidu.com/s/1hrsv7nu

 

二、     安装操作系统

软件选择(SOFTWARE SELECTION)

 

 


磁盘分区(INSTALLATION DESTINATION)

 

 


三、     安装MariaDB数据库

安装

[root@localhost home]# ls

lost+found                                 MariaDB-10.0.19-centos7-x86_64-server.rpm

MariaDB-10.0.19-centos7-x86_64-client.rpm  MariaDB-10.0.19-centos7-x86_64-shared.rpm

MariaDB-10.0.19-centos7-x86_64-common.rpm  MariaDB-10.0.19-centos7-x86_64-test.rpm

MariaDB-10.0.19-centos7-x86_64-devel.rpm

[root@localhost home]# rpm -iUvh MariaDB*.*

warning: MariaDB-10.0.19-centos7-x86_64-client.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

  1:MariaDB-common-10.0.19-1.el7.cent################################# [ 14%]

  2:MariaDB-client-10.0.19-1.el7.cent################################# [ 29%]

started; log sequence number 1616697

……()

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !

To do so, start the server, then issue the following commands:

 

'/usr/bin/mysqladmin' -u root password 'new-password'

'/usr/bin/mysqladmin' -u root -h localhost.localdomain password 'new-password'

 

Alternatively you can run:

'/usr/bin/mysql_secure_installation'

 

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

……()

  4:MariaDB-devel-10.0.19-1.el7.cento################################# [ 57%]

  5:MariaDB-shared-10.0.19-1.el7.cent################################# [ 71%]

  6:MariaDB-test-10.0.19-1.el7.centos################################# [ 86%]

Cleaning up / removing...

  7:mariadb-libs-1:5.5.41-2.el7_0    ################################# [100%]

 

编辑/etc/my.cnf文件,添加如下带背景色内容

[root@localhost ~]# vim /etc/my.cnf

#

# This group is read both both by the client and the server

# use it for options that affect everything

#

[client-server]

 

#

# include all files from the config directory

#

!includedir /etc/my.cnf.d

[mysqld]

user=mysql

~                                                                                                                                                                                            

~    

启动数据库服务器

[root@localhost home]# /usr/sbin/mysqld --user=mysql

                                                                                                                                                                                       

修改root用户密码                                                  

[root@localhost home]# /usr/bin/mysqladmin -u root password 'test1234'

 

进行安全设置

[root@localhost home]# /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

     SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

 

In order to log into MariaDB to secure it, we'll need the current

password for the root user.  If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

 

Enter current password for root (enter for none):

OK, successfully used password, moving on...

 

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

 

You already have a root password set, so you can safely answer 'n'.

 

Change the root password? [Y/n] n

... skipping.

 

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

 

Remove anonymous users? [Y/n] y

... Success!

 

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

 

Disallow root login remotely? [Y/n] n

... skipping.

 

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

 

Remove test database and access to it? [Y/n] y

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

 

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

 

Reload privilege tables now? [Y/n] y

... Success!

 

Cleaning up...

 

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

 

Thanks for using MariaDB!

 

创建用户与授权

[root@localhost ~]# mysql -u root -ptest1234

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 5

Server version: 10.0.19-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create user 'testacc'@'182.168.1.103' identified by 'test1234';

Query OK, 0 rows affected (0.00 sec)

 

MariaDB [(none)]> grant all on *.* to 'testacc'@'%' identified by 'test1234';

Query OK, 0 rows affected (0.00 sec)

> grant all privileges on *.* to 'testacc'@'192.168.1.100'identified by 'test1234';

Query OK, 0 rows affected (0.00 sec)

> flush privileges;

 

注:这里192.168.1.100mysql客户端所在主机,即我本地主机

 

 

四、     安装Apache Server

安装相关依赖软件

[root@localhost tmp]# tar -xvzf apr-1.5.2.tar.gz

……()

 

[root@localhost tmp]# tar -xvzf apr-util-1.5.4.tar.gz

……()

 

[root@localhost tmp]# tar -xvzf pcre-8.37.tar.gz

……()

 

1、安装pcre

[root@localhost yum.repos.d]# yum install gcc

……()

 

[root@localhost yum.repos.d]# yum install gcc-c++

……()

 

注:如果编译pcre时未安装gccgcc-c++,会分别报告如下错误

configure: error: no acceptable C compiler found in $PATH

configure: error: You need a C++ compiler for C++ support.

 

安装pcre

[root@localhost tmp]# cd pcre-8.37

[root@localhost pcre-8.37]# ./configure --prefix=/usr/local/pcre

……()

[root@localhost pcre-8.37]# make && make install

……()

 

2、安装apr

[root@localhost tmp]# cd apr-1.5.2/

[root@localhost apr-1.5.2]# ./configure --prefix=/usr/local/apr

……()

[root@localhost apr-1.5.2]# make && make install

……()

 

3、安装apr-util

[root@localhost tmp]# cd apr-util-1.5.4/

[root@localhost apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

……()

 

[root@localhost apr-util-1.5.4]# make && make install

……()

 

安装Apache Server

[root@localhost tmp]# tar -xvzf httpd-2.4.17.tar.gz

[root@localhost tmp]# cd httpd-2.4.17/

[root@localhost httpd-2.4.17]# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre

……()

 

[root@localhost httpd-2.4.17]# make && make install

……()

 

简单配置与启动

编辑httpd.conf,找到ServerName,去掉注释符号,或者在其下新增一行

[root@localhost httpd-2.4.16]# vim /usr/local/apache/conf/httpd.conf

 

 


启动服务

[root@localhost httpd-2.4.16]# /usr/local/apache/bin/apachectl -k start

 

访问

 


 

注意:如果无法访问,关闭防火墙或者开放端口(临时),如下

[root@localhost services]# systemctl stop firewalld.service

 

[root@localhost services]# iptables -I INPUT -p TCP --dport 80 -j ACCEPT

 

注:建议先临时关闭防火墙,否则后面的数据库用户也无法远程连接,这会导致禅道安装失败

 

五、     PHP安装与配置

安装依赖包

[root@localhost tmp]# tar -xvzf libxml2-2.6.27.tar.gz

[root@localhost tmp]# cd libxml2-2.6.27

[root@localhost libxml2-2.6.27]# ./configure --prefix=/usr/local/libxml12

……()

 

[root@localhost libxml2-2.6.27]# make && make install

……()

 

安装php

[root@localhost tmp]# tar -xvzf php-7.0.0.tar.gz

……()

 

[root@localhost php-7.0.0]# yum install php

……()

 

[root@localhost php-7.0.0]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/libxml12/  --with-pdo-mysql

……()

 

 

[root@localhost php-7.0.0]# make && make install

……()

 

注:  --with-pdo-mysql非常重要,如果这里不指定该选项,安装禅道时可能会报错,如下,pdo_mysql扩展未加载

 

 


以下是php官网文档中的部分(也就是不用自己去单独编译安装PDO_MYSQL扩展了,网上关于这个的安装教程笔者试过,死活不行,各种错误

For example, on Ubuntu the php5-mysql package installs the ext/mysql, ext/mysqli, and PDO_MYSQL PHP extensions. On CentOS, the php-mysql package also installs these three PHP extensions.

Alternatively, you can compile this extension yourself. Building PHP from source allows you to specify the MySQL extensions you want to use, as well as your choice of client library for each extension.

When compiling, use --with-pdo-mysql[=DIR] to install the PDO MySQL extension, where the optional [=DIR] is the MySQL base library. As of PHP 5.4,mysqlndis the default library. For details about choosing a library, seeChoosing a MySQL library.

Optionally, the --with-mysql-sock[=DIR] sets to location to the MySQL unix socket pointer for all MySQL extensions, including PDO_MYSQL. If unspecified, the default locations are searched.

Optionally, the --with-zlib-dir[=DIR] is used to set the path to the libz install prefix.

$ ./configure --with-pdo-mysql --with-mysql-sock=/var/mysql/mysql.sock

 

 

参考连接:http://php.net/manual/en/ref.pdo-mysql.php

 

配置php

[root@localhost php-5.6.12]# cp php.ini.dist /usr/local/php/lib/php.ini

注:如果没有php.ini.dist则把php.ini-development php.ini-production中的任何一个重命名为php.ini.dist即可

 

配置httpd.confapache支持PHP

# vim /usr/local/apache/conf/httpd.conf

 

找到AddType application/x-gzip .gz .tgz ,然后添加如下带背景颜色的内容(.前面有空格)

 

#################Added by laiyu##################

   AddType application/x-httpd-php .php

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

   #################################################

   #AddType application/x-gzip .tgz

 

重启Apache

[root@localhost php-7.0.0]# /usr/local/apache/bin/apachectl stop

[root@localhost php-7.0.0]# /usr/local/apache/bin/apachectl start

 

测试php是否成功安装

写一个php测试页info.php,放到Apachehtdocs目录下。

 

在浏览器中输入:服务器地址/info.php,如:http://192.168.40.80/info.php

如果可看到php版本,系统等相关信息则表示成功了

 

 


修改改配置文件php.ini

1、找到如下带背景色内容,去掉注释符号“;”

extension=php_mysqli.dll

;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client

;extension=php_openssl.dll

;extension=php_pdo_firebird.dll

extension=php_pdo_mysql.dll

 

2、找到如下带背景色内容,再其下新增如下内容

; The path can be defined as:

;

;     session.save_path = "N;/path"

(注:以下带背景色内容为新增的)

;     added by shouke

     session.save_path = "0;/var/lib/php/session/"

;

; where N is an integer.  Instead of storing all the session files in

; /path, what this will do is use subdirectories N-levels deep, and

; store the session data in those directories.  This is useful if

; your OS has problems with many files in one directory, and is

a more efficient layout for servers that handle many sessions.

; NOTE 1: PHP will not create this directory structure automatically.

;         You can use the script in the ext/session dir for that purpose.

; NOTE 2: See the section on garbage collection below if you choose to

;         use subdirectories for session storage

;

; The file storage module creates files using mode 600 by default.

; You can change that by using

;

;     session.save_path = "N;MODE;/path"

 

说明:如上,session.save_path = "N;MODE;/path",其中,N表示多级目录,值为数字,如果大于0,则不会执行自动垃圾回收,对于绝大多数站点,大于1或者2的值会不太合适——因为这需要创建大量的目录:例如,值设置为3需要在文件系统上创建64^3个目录,将浪费很多空间和inode。仅仅在绝对肯定站点足够大时,才可以设置N大于2MODE表示创建的Session文件权限,默认使用mode 600创建文件。/path表示Session存储路径

 

保存,重启Apache

 

找到; extension_dir = "./",在其下新增一行,如下带背景色内容

; http://php.net/extension-dir

; extension_dir = "./"

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

; On windows:

; extension_dir = "ext"

说明:这一步修改操作或许可以不执行,

 

修改会话存储目录权限

[root@localhost session]# chmod o=rwx -R /var/lib/php/session/

 

注:如果这里进行修改权限操作,那么安装禅道时可能会报如下错误

 


六、     安装禅道项目管理系统(PMS

[root@localhost tmp]#unzip  ZenTaoPMS.8.0.stable.zip

……()

 

[root@localhost tmp]#mv zentaopms /usr/local/apache/htdocs/

 

接着打开浏览器访问

http://192.168.1.103/zentaopms/www/index.php

 

打开后会出现一个界面,上面有一个大大的安装按钮,点击安装按钮开始安装(不好意思,这一步忘记截图了)

 


 

如上,勾选协议,点击【下一步】,

 


如上,点击下一步


 

如上,填写数据库相关信息,注意这里的信息必须准确填写,,点击【保存】


如上,点击【下一步】

 

 

如上,输入公司名称,超级管理员帐号和密码信息,点击【保存】

 

如上,安装成功,有必要的话删除安装文件install.php,点击【登陆禅道管理系统】

 

 


登陆,查看

 

 


查看数据库

 


注:要么关闭防火墙,要么开放相关端口并写入静态配置文件,不然会出现无法访问的情况。

 

接下来的问题:

1.假如以上部署在内网,咋让外网的人员也可以访问呢?

2.数据备份

 

pdf版下载:

CentOS7+ApacheServer2.4+MariaDB10.0+PHP7.0+禅道项目管理软件8.0环境部署.pdf

 

相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。   相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情: https://www.aliyun.com/product/rds/mysql 
目录
相关文章
|
4月前
|
Linux 编译器 开发工具
在CentOS环境下升级GCC编译器的指南
总结:本文提供了一种方法来升级CentOS的GCC编译器,通过使用CentOS的软件集合和开发者工具集工具,可以比较平滑地进行升级。在整个过程中无需从源代码编译,这样既省去了复杂的编译过程,也避免了可能出现的与系统库不兼容的风险。请注意,使用第三方仓库可能会带来系统稳定性和安全性上的潜在影响。所有操作都应谨慎进行,并确保有相应的数据备份。
637 19
|
7月前
|
关系型数据库 MySQL PHP
利用PhpStorm、phpstudy和xdebug快速构建PHP调试环境
至此,我们已经完成了PHP调试环境的构建。现在,你可以在PhpStorm中打开你的PHP项目,设置断点,然后开始调试你的代码了。希望这个指南能帮助你快速构建PHP调试环境,提高你的开发效率。
435 26
|
7月前
|
Java 关系型数据库 MySQL
JDK、Tomcat、MariaDB数据库和Profile多环境的配置与使用
以上就是JDK、Tomcat、MariaDB数据库和Profile多环境的配置与使用的基本步骤。这些步骤可能会因为你的具体需求和环境而有所不同,但是基本的思路是一样的。希望这些信息能够帮助你更好地理解和使用这些工具。
249 17
|
7月前
|
Ubuntu Linux PHP
利用PHP压缩音频:Linux环境下的ffmpeg简易安装指南
希望这个指南能为你的编程之旅提供帮助。只需记住,每一行代码都像音乐的音符,组合在一起,创造出美妙的旋律。祝你编程愉快!
248 6
|
9月前
|
监控 Linux PHP
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
290 20
|
10月前
|
网络协议 Java 应用服务中间件
centos7环境下tomcat8的安装与配置
本文介绍了在Linux环境下安装和配置Tomcat 8的详细步骤。首先,通过无网络条件下的文件交互软件(如Xftp 6或MobaXterm)下载并解压Tomcat安装包至指定路径,启动Tomcat服务并测试访问。接着,修改Tomcat端口号以避免冲突,并部署Java Web应用项目至Tomcat服务器。最后,调整Linux防火墙规则,确保外部可以正常访问部署的应用。关键步骤包括关闭或配置防火墙、添加必要的端口规则,确保Tomcat服务稳定运行。
|
Web App开发 搜索推荐 Unix
Linux系统之MobaXterm远程连接centos的GNOME桌面环境
【10月更文挑战第21天】Linux系统之MobaXterm远程连接centos的GNOME桌面环境
2162 5
Linux系统之MobaXterm远程连接centos的GNOME桌面环境
|
SQL 安全 JavaScript
在多用户环境中,如何确保 PHP Shell 的安全性?
在多用户环境中,如何确保 PHP Shell 的安全性?
121 1
|
安全 Linux 数据库连接
CentOS 7环境下DM8数据库的安装与配置
【10月更文挑战第16天】本文介绍了在 CentOS 7 环境下安装与配置达梦数据库(DM8)的详细步骤,包括安装前准备、创建安装用户、上传安装文件、解压并运行安装程序、初始化数据库实例、配置环境变量、启动数据库服务、配置数据库连接和参数、备份与恢复、以及安装后的安全设置、性能优化和定期维护等内容。通过这些步骤,可以顺利完成 DM8 的安装与配置。
1299 0