时间:2021-07-01 10:21:17 帮助过:32人阅读
CentOS: 6.5-x86_64
Apache: 2.4.9
PHP: 5.5.6
Ruby: 2.1.5
Redmine: 2.5.2
Mysql: 5.6.16
二.安装CentOS_6.5-x86_64
1. 系统安装流程
界面1选择基本存储设备
界面2选择全新安装
界面3主机名:localhost,同时左下角点击配置网络
弹出的网络链接界面中,选择Systemeth0 点击编辑
弹出的System eth0编辑界面中,选中自动连接,选择IPv4标签,方法改为手动。
点击添加,地址栏里IP输入192.168.1.XXX,子网掩码输入24 ,网关输入192.168.1.1
DNS服务器:202.96.209.133,点击应用
关闭网络链接界面
界面4,默认
界面5,密码:XXXXX
界面6,选择使用所有空间,左下角的查看并修改分区布局,勾上
界面7,数据存储设备区域中,将安装的硬盘移动到右边的安装目标设备中,并且点击选中引导装载程序。
界面8,删除LVM卷组下的设备,删除设备下的分区标签,如sda1,sda2等,仅保留sda,sdb这类的设备标签。
创建新的分区方案,方案如下:
Sdb1 /boot ext4 100MB 强制主分区
Sdb2 / ext4 20 GB
Sdb3 /usr/local ext4 50GB
Sdb4 扩展分区
Sdb5 /var ext4 20 GB 建议将所有的系统日志指向该目录的log目录下
Sdb6 空 swap 6144 MB 内存的1-2倍之间,建议1.5倍
Sdb7 /home ext4 剩余全部空间
界面9,点击更换设备,选择引导扇区的第一分区
界面10,选择Minimal Desktop
安装完成后重启
创建用户名:redmine 密码:XXXXX
设置时间网络同步
启动kdump,默认
完成后重启。
2. 安装基本依赖组件
# su - //转root
# yum -y install makeapr* autoconf automake gcc gcc-c++ zlib-devel openssl openssl-devel pcre-develgd kernel keyutils patch perl kernel-headers compat* mpfr cppglibc libgomp libstdc++-devel ppl cloog-ppl keyutils-libs-devellibcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm*freetype libjpeg* libpng* php-common php-gd ncurses* libtool* libxml2libxml2-devel patch lrzsz vin curl-devel php-mcrypt libmcrypt libmcrypt-devel vim mod_ssl
3. 修改防火墙
# vi/etc/sysconfig/iptables //修改防火墙配置文件,开放相应端口
-A INPUT -m state --state NEW -m tcp-p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp-p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp-p tcp --dport 8000:9000-j ACCEPT
-A INPUT -m state --state NEW -m tcp-p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp-p tcp --dport 3000 -j ACCEPT
# /etc/init.d/iptablesrestart #最后重启防火墙使配置生效
4. 关闭SELINUX
# vi /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
# reboot #重启系统
三.安装Mysql-5.6.16
# su - //改成root用户权限
1. 安装cmake-2.8.10.2
# tar -xzvfcmake-2.8.10.2.tar.gz
# cd cmake-2.8.10.2
# ./bootstrap
# make
# make install
# cd ..
2. 设置mysql用户组
# groupadd mysql
# useradd -r -g mysql mysql
3. 创建mysql 安装目录
# mkdir -p /usr/local/mysql ///程序目录
# mkdir -p /home/data/mysqldb //数据文件目录
4. 编译安装MySQL-5.6.16
# tar -zxvf mysql-5.6.16.tar.gz
# cd mysql-5.6.16
# cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/home/data/mysqldb-DMYSQL_TCP_PORT=3306 -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_bin-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk -DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1-DWITH_DEBUG=0 -DWITH_READLINE=1 -DWITH_SSL=yes
#(有时候会出现找不到/usr/local/mysql/data 等警告,不管他,直接继续编译)
# rm CMakeCache.txt 重新运行配置,需要删除CMakeCache.txt文件
# make
# make install
5. 修改安装目录
# cd /usr/local/mysql
# chown -R mysql:mysql .
6. 修改数据库文件目录
# cd /home/data/mysqldb
# chown -R mysql:mysql .
7. 初始化数据库
# cd /usr/local/mysql
# scripts/mysql_install_db--user=mysql --datadir=/home/data/mysqldb
8. 复制mysql服务启动配置文件
# cp/usr/local/mysql/support-files/my-default.cnf /etc/my.cnf (可以覆盖)
9. 复制mysql服务启动脚本及加入PATH路径
# cp support-files/mysql.server/etc/init.d/mysqld
#vi /etc/profile
PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
export PATH
# source /etc/profile
# vi /etc/my.cnf
在[mysqld]下添加
datadir =/home/data/mysqldb
10. 设置开机启动mysql
# chmod 755 /etc/init.d/mysqld
# chkconfig mysqld on
11. 修改mysql 密码
# service mysqld start
# /usr/locsl/mysql/bin/mysqladmin -uroot -p password "jorudan0407"
# service mysqld restart
# /usr/local/mysql/bin/mysql -u root–p //新密码登录验证
mysql> showdatabases;
四.安装Ruby-2.1.5
1. 安装ruby-2.1.5
# tar xzf ruby-2.1.5.tar.gz
# cd ruby-2.1.5
# ./configure --prefix=/usr/local/ruby
# make
# make install
# cd ..
添加到环境变量
# vi /etc/profile
export PATH=/usr/local/ruby/bin:$PATH
# source /etc/profile
查看ruby版本号
# ruby -v
ruby 2.1.5p273(2014-11-13 revision 48405) [x86_64-linux]
2. 安装rubygems-2.4.6
# tar xzf rubygems-2.4.6.tgz
# cd rubygems-2.4.6
# ruby setup.rb
# cd ..
提示:gem是一种文件组织的包,一般的ruby的很多插件都有由这种各种的包提供。
# gem -v
2.4.6
# which gem
/usr/local/ruby/bin/gem
3. 安装rails-3.2.19
# gem sources -l
*** CURRENT SOURCES ***
https://rubygems.org/
# gem sources --remove https://rubygems.org/
https://rubygems.org/ removed from sources
# gem sources -ahttps://ruby.taobao.org/
https://ruby.taobao.org/ added to sources
# gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/
Redmine需要考虑Ruby版本兼容性问题,请参考:
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
Redmine选择安装2.5.3版本,因此rails安装3.2版本
# gem install rails -v=3.2.19
# rails -v
Rails 3.2.19
五.安装Apache-2.4.9
1. 安装apr-1.5.1
# tar –zxf apr-1.5.1.tar.gz
# cd apr-1.5.1
# ./configure –prefix=/usr/local/apr
# make
# make install
# cd ..
2. 安装apr-util-1.5.4
# tar –zxf apr-util-1.5.4.tar.gz
# cd apr-util-1.5.4
# ./configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config
# make
# makr install
# cd ..
3. 安装pcre-8.33
# tar –zxf pcre-8.33.tar.gz
# cd pcre-8.33
# ./configure --prefix=/usr/local/pcre
# make
# make install
# cd ..
4. 安装openssl-1.0.1l
# tar –zxf openssl-1.0.1l.tar.gz
# cd openssl-1.0.1l
# ./config --prefix=/usr/local/openssl -fPIC no-gost
# make
# make install
# cd ..
5. 安装apache-2.4.9
# tar –zxf httpd.2.4.9.tar.gz
# cd httpd.2.4.9
# ./configure --prefix=/usr/local/apache2--with-mpm=worker --enable-cache --enable-disk-cache --enable-mem-cache--enable-file-cache --enable-nonportable-atomics --enable-mods-shared=most --enable-so--enable-rewrite--enable-ssl --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --with-ssl=/usr/local/openssl
# make
# make install
# cd ..
6. 追加fcgid模块
# tar zxvf mod_fcgid-2.3.6.tar.gz
# cd mod_fcgid-2.3.6
# APXS=/usr/local/apache2/bin/apxs./configure.apxs ----->/soft/apache/bin是apache的安装地址
# make
# make install
7. 设置apache 开机启动
需注意,如果系统自身带着httpd服务的话,需要先卸载
# yum list |grep httpd
如果存在
# yum remove httpd
正式进行设置开机启动
# cp /usr/local/apache2/bin/apachectl/etc/rc.d/init.d/httpd
# vi /etc/rc.d/init.d/httpd
在#!/bin/sh后面加入下面两行
#chkconfig:345 85 15
#description:Start and stops the Apache HTTP Server.
# chmod +x /etc/rc.d/init.d/httpd
# chkconfig --add httpd
8. 修改 http.conf
# mkdir –p /var/www/html //创建www根目录
# vi/usr/local/apache2/conf/httpd.conf
添加ServerName localhost:80
Listen 8000 //为redmine虚拟服务器预留端口
Listrn 8008 //为bugfree虚拟服务器预留端口
修改
DocumentRoot "/usr/local/apache2/htdocs”
e DocumentRoot"/var/www/html"
e
CustomLog "logs/access_log"common
e CustomLog "/var/log/httpd/access_log"common
ErrorLog"logs/error_log"
e ErrorLog"/var/log/httpd/error_log"
9. 验证
重启apache,
# service httpd restart
然后用浏览器打开网页。
六.安装PHP-5.5.6
1. 安装zlib-1.2.8
# tar zxvf zlib-1.2.8.tar.gz
# cd zlib-1.2.8
# ./configure--prefix=/usr/local/zlib
# make
# make install
# cd ..
2. 安装libxml2-2.7.1
# tar zxvf libxml2-2.7.1.tar.gz
# cd libxml2-2.7.1
# ./configure--prefix=/usr/local/libxml2 --without-zlib
# make
# make install
# cd ..
3. 安装libpng-1.2.31
# tar zxvf libpng-1.2.31.tar.gz
# cd libpng-1.2.31
# ./configure--prefix=/usr/local/libpng
# make
# make install
# cd ..
4. 安装freetype-2.5.0.1
# tar zxvf freetype-2.5.0.1.tar.gz
# cd freetype-2.5.0.1
# ./configure--prefix=/usr/local/freetype -without-png
# make
# make install
# cd ..
5. 安装jpeg9
# tar zxvf jpegsrc.v9.tar.gz
# cd jpeg-9/
# ./configure--prefix=/usr/local/jpeg9
# make
# make install
# cd ..
6. 安装libmcrypt-2.5.7
# tar -zxvf libmcrypt-2.5.7.tar.gz
# cd libmcrypt-2.5.7
# mkdir -p /usr/local/libmcrypt
# ./configureprefix=/usr/local/libmcrypt/
# make
# make install
# cd ..
7. 安装GD-2.0.35
# tar -zxvf gd-2.0.35.tar.gz
# mkdir -p /usr/local/gd
# cd gd-2.0.35
# ./configure --prefix=/usr/local/gd--enable-m4_pattern_allow --with-jpeg=/usr/local/jpeg9--with-png=/usr/local/libpng --with-zlib=/usr/local/zlib--with-freetype=/usr/local/freetype --with-libmcrypt=/usr/local/libmcrypt
# make
# make install
# cd ..
8. 安装PHP-5.5.6
# tar -zxvf php-5.5.6.tar.gz
# cd php-5.5.6
# ./configure--prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc--with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock--with-gd --with-iconv--with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr/local/jpeg9--with-png-dir=/usr/local/libpng --with-zlib=/usr/local/zlib--with-libxml-dir=/usr/local/libxml2 --enable-xml --enable-bcmath--enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex--enable-mbstring --enable-ftp --enable-gd-native-ttf --without-pear--with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip--enable-soap --with-gettext --enable-session --with-mcrypt=/usr/local/libmcrypt/--enable-mbstring --with-pdo-mysql=/usr/local/mysql
# make
# make install
# cp php.ini-production/usr/local/php/php.ini
9. 修改apache2配置,加载php模块
# vi/usr/local/apache2/conf/httpd.conf
在LoadModule php5_module modules/libphp5.so
添加
AddTypeapplication/x-httpd-php .php
AddTypeapplication/x-httpd-php-source .phps
修改
OptionsIndexes FollowSymLinks
e Options Indexes FollowSymLinksIncludes IncludesNOEXEC ExecCGI
#service httpd restart
10. 验证phpinfo
# vim /usr/local/apache2/htdocs/index.php
date_default_timezone_set("PRC");
phpinfo();
?>
打开浏览器,访问192.168.1.32
11. 追加curl模块
# tar -zxvf curl-7.41.0.tar.gz
# cd/home/redmine/php-5.5.6/ext/curl //php源码的目录
# /usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-config--with-curl=/home/redmine/curl-7.41.0
# cd /home/redmine/curl-7.41.0
# make
# make install
修改php.ini文件
# vi /usr/local/php/php.ini
追加extension=curl.so
12. 踩过的坑
(1)直接在curl的源码目录最上层,运行phpize,提示如下错误:
Cannot find config.m4.
Make sure that you run'/home/zhuyx/local/php-5.5.3/bin/phpize' in the top level source directory ofthe module
原因:
phpize扩展安装,源包需要有config.m4这个配置文件;当前扩展的源码包不包含(memcache的就包含)。
解决方法:
(1)进入php源码包的 ext/curl 下面运行phpize,再进行安装
(2)./configure --with-php-config=/php编译后目录/bin/php-config --with-curl=curl源码目录
问题扩展:
安装其他的php扩展的时候,遇到类似问题,都可以采取上述解决方案。
七.安装phpMyAdmin-4.3.12
1. 安装phpMyAdmin-4.3.12
# unzipphpMyAdmin-4.3.12-all-languages.zip
# mvphpMyAdmin-4.3.12-all-languages /var/www/html/phpMyAdmin
打开浏览器,地址http://192.168.1.32/phpMyAdmin
2. 创建redmine数据库
登录phpMyAdmin,root/XXXX
创建2个redmine用户,主机分别为%,localhost,都对同名数据库具有最大权限。
八.安装Redmine-2.5.3
1. 部署程序文件
# tar xzf redmine-2.5.3.tar.gz -C /usr/local/
# mv /usr/local/redmine{-2.5.3,}
2. 安装redmine依赖的所有ruby包
# cd /usr/local/redmine
# gem install mysql2 #用mysql2能提供性能
# gem install bundler #注意是在网站根目录下执行
Successfully installed bundler-1.8.5
Parsing documentation for bundler-1.8.5
Done installing documentation for bundlerafter 3 seconds
1 gem installed
# bundle install --withoutdevelopment test rmagick #完成redmine依赖包的安装
bundler是用来管理ruby的包依赖的工具
Gem::RemoteFetcher::FetchError:Errno::ETIMEDOUT: Connection timed out - connect(2) for "rubygems.global.ssl.fastly.net"port 443 (https://rubygems.org/gems/builder-3.0.0.gem)
An error occurred while installing builder(3.0.0), and Bundler cannot continue.
Make sure that `gem install builder -v'3.0.0'` succeeds before bundling.
# gem install builder -v'3.0.0'
# gem install coderay -v'1.1.0'
#gem install json -v '1.8.2'
# gem installjquery-rails -v '2.0.3'
#gem install net-ldap -v '0.3.1'
#gem install ruby-openid -v '2.3.0'
#gem install rack-openid -v '1.4.2'
#gem install redcarpet -v '2.3.0'
#bundle install --without development test rmagick # 再次执行
3. 初始化redmine数据库
修改Redmine的database.yml
# cd /usr/local/redmine/config
# cp database.yml.exampledatabase.yml
# vi database.yum #修改对应数据库连接信息
production:
adapter: mysql2
database: redmine
host: 192.168.1.XXXX //建议使用IP地址,而非机器名redmine.server,默认的webrick在解析服务器名称方面效率非常低,导致响应非常慢,redmine.server
username: redmine
password: "XXXXX"
encoding: utf8
为Rails生成cookies秘钥
# rake generate_secret_token
创建数据库结构
# RAILS_ENV=production rakedb:migrate
生成缺省数据
# RAILS_ENV=productionREDMINE_LANG=zh rake redmine:load_default_data
4. 调整文件系统权限
# cd /data/wwwroot/redmine
# mkdir -p public/plugin_assets
# chown -R redmine/usr/local/redmine/
# chmod -R 755 /usr/local/redmine/
tmp和tmp/pdf (若不存在则创建该路径,用于生成 PDF 文件);public/plugin_assets(若不存在则创建该路径,plugins资源)
5. 修改redmine配置文件
# cpconfiguration.yml.example configuration.yml
# mkdir -p /home/data/redmine/attachments
# chown -R redmine/home/data/redmine
#chmod -R 755 /home/data/redmine
#mkdir -p /var/log/redmine
#chown -R redmine.redmine /var/log/redmine
# vi configuration.yml
修改delivery_method: smtp
e delivery_method: async_smtp
attachments_storage_path: /home/data/redmine/attachments
scm_stderr_log_file:/var/log/redmine/scm_stderr.log
:wq 退出
6. 启动和关闭redmine
# vi /etc/passwd #使www用户有bash权限,lnmp脚本安装www用户没有bash权限
redmine:x:501:501::/home/redmine:/bin/bash
# su redmine -c "rubyscript/rails server webrick -e production -d"
或# rubyscript/server webrick -e production -d
或# ruby/usr/local/redmine/script/server webrick -e production –d
地址:http://IP:3000(注意:打开iptables 3000端口号)
缺省管理员用户:
login: admin
password: admin
停止服务方法:(ps命令查出此进程的pid号,再杀掉,目前好像只能这样,我看了--help里面,还没有停止的参数。)
# ps aux | grep ruby
# kill -9 [PID]
九.整合Apache和Redmine
1. 安装Passenger
# gem install passenger
Fetching: passenger-5.0.4.gem (100%)
Building native extensions. This could take a while...
Successfully installed passenger-5.0.4
Parsing documentation for passenger-5.0.4
Installing ri documentation for passenger-5.0.4
Done installing documentation for passenger after 5 seconds
1 gem installed
# passenger-install-apache2-module
Welcome to the PhusionPassenger Apache 2 module installer, v5.0.4.
This installer will guide you through the entire installationprocess. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module willbe installed for you.
2. You'll learn how toconfigure Apache.
3. You'll learn how to deploya Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise youon how to
solve any problems.
Press Enter to continue, or Ctrl-C to abort.
输入回车,显示
--------------------------------------------
Which languages are you interested in?
Use
If the menu doesn't display correctly, press '!'
? ? Ruby
? Python
? Node.js
? Meteor
继续按回车
Installation instructions for required software
* To install Apache 2:
Please install it with yuminstall httpd
* To install Apache 2development headers:
Please install it with yuminstall httpd-devel
* To install Apache PortableRuntime (APR) development headers:
Please install it with yuminstall apr-devel
* To install Apache PortableRuntime Utility (APU) development headers:
Please install it with yuminstall apr-util-devel
If the aforementioned instructions didn't solve your problem, thenplease take
a look at the Users Guide:
/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.4/doc/Users guideApache.html
https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html
# ln -s/usr/local/apache2 /etc/httpd
# mkdir -p /usr/lib/httpd
# ln -s/usr/local/apache2/modules /usr/lib/httpd/modules
# ln -s/usr/local/apache2/bin/httpd /usr/sbin/httpd
# rm /usr/sbin/apxs
# /bin/ln -s /usr/local/apache2/bin/apxs/usr/sbin/apxs
# yum install httpd-devel
# yum install apr-devel
# yum installapr-util-devel
# passenger-install-apache2-module
--------------------------------------------
Almost there!
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.4/buildout/apache2/mod_passenger.so
PassengerRoot/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.4
PassengerDefaultRuby/usr/local/ruby/bin/ruby
After you restart Apache, you are ready to deploy any number of web
applications on Apache, with a minimum amount of configuration!
Press ENTER to continue.
--------------------------------------------
Deploying a web application: an example
Suppose you have a web application in /somewhere. Add a virtual hostto your
Apache configuration file and set its DocumentRoot to/somewhere/public:
ServerNamewww.yourhost.com
# !!! Be sure to pointDocumentRoot to 'public'!
DocumentRoot/somewhere/public
# This relaxes Apachesecurity settings.
AllowOverride all
# MultiViews must beturned off.
Options -MultiViews
# Uncomment this ifyou're on Apache >= 2.4:
#Require all granted
And that's it! You may also want to check the Users Guide forsecurity and
optimization tips, troubleshooting and other useful information:
/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.4/doc/Users guideApache.html
https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html
Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
https://www.phusionpassenger.com
Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.
最终出现这个表示安装成功。
2. 配置Apache加载Passenger
# vi /usr/local/apache2/conf/httpd.conf
添加
LoadModulepassenger_module /usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.4/buildout/apache2/mod_passenger.so
PassengerRoot/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.4
PassengerDefaultRuby/usr/local/ruby/bin/ruby
修改
取消 LoadModulerewrite_module modules/mod_rewrite.so的#注释
取消Includeconf/extra/httpd-vhosts.conf 的#
:wq退出
3. 为redmine创建虚拟机
# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
把两个标签
追加
ServerName 192.168.1.XXXX
ServerAdmin maoyunzhi@jorudan.com.cn
# !!! Be sure to point DocumentRoot to'public'!
DocumentRoot /usr/local/redmine/public
# This relaxes Apache securitysettings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache>= 2.4:
Require all granted
AddHandler fcgid-script .fcgi
FCGIWrapper"/usr/local/ruby/bin/ruby /usr/local/redmine/public/dispatch.fcgi".fcgi
ErrorLog"/var/log/httpd/redmine-error_log"
CustomLog"/var/log/httpd/redmine-access_log" common
:wq 退出
# cd /data/wwwroot/redmine/public/
# cp dispatch.fcgi.exampledispatch.fcgi
# cp htaccess.fcgi.example. htaccess
4. 修改文件权限
# chown –R apache.apache/home/data/redmine
# chown –R apache.apache/usr/local/redmine
# chown –R apache.apache/var/log/redmine
5. 重启apache
# service httpd restart
打开浏览器,http://192.168.1.32:8000/
十.安装Bugfree-3.0.4
1. 安装bugfree-3.0.4
# unzipbugfree_v3.0.4.zip
# cd /var/www/html/bugfree3.0.4/
# chmod -R 777 install
2. 配置bugfree参数
打开浏览器 http://192.168.1.32/bugfree3.0.4/install/,对照路径权限,逐个修改
# mkdir -p /home/data/bugfree/BugFile
# chown -R apache.apache /home/data/bugfree
# chmod -R 755 /home/data/bugfree
# chmod -R 777 assets
# chmod -R 777 protected/runtime
# chmod -R 777 protected/config
# ln -s/home/data/bugfree/BugFile BugFile
# viprotect/config.sample.php
修改'uploadPath' => '../BugFile',
e 'uploadPath' =>'/home/data/bugfree/BugFile',
'picPreviewApp'=> 'http://'.$_SERVER['SERVER_ADDR'].'/BugFile',
e 'picPreviewApp' =>'http://'.$_SERVER['SERVER_ADDR'].':8008/BugFile',
:wq 退出
# vi install/index.php
修改define('UPLOADPATH',realpath(dirname(dirname(dirname(__FILE__)))).DIRECTORY_SEPARATOR.'BugFile');
e define('UPLOADPATH', realpath((dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'BugFile');
//取消一对dirname取值
:wq退出
# vi protected/extensions/kindeditor4/assets/php/upload_json.php
修改$save_path = '../../.. /BugFile/';
e $save_path ='/home/data/bugfree/BugFile/';
$save_url = 'http://'.$_SERVER['SERVER_ADDR'].'/BugFile/';
e $save_url= 'http://'.$_SERVER['SERVER_ADDR'].':8008/BugFile/';
:wq 退出
再次刷新安装配置页面,所有前置条件都满足后,选择继续,进入数据库配置界面。
打开phpMyAdmin界面,新建2个用户bugfree,设置主机分别为%和localhost,,密码zaq12wsx,并创建同名数据库。
在bugfree的数据库配置界面中,服务器为localhost,数据库名为bugfree,密码zaq12wsx,点击安装。
3. 配置apache虚拟服务器
# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
ServerAdmin info@jorudan.com.cn
DocumentRoot"/var/www/html/bugfree3.0.4"
ServerName bugfree.jorudan.com.cn
ErrorLog"/var/log/httpd/bugfree-error_log"
CustomLog"/var/log/httpd/bugfree-access_log" common
Options Indexes FollowSymLinks IncludesIncludesNOEXEC ExecCGI
:wq退出
4. 重启Apache
# service httpd restart
如果修改没有生效,请删除assets下所有文件,在刷新页面。
以上就介绍了CentOS6.5+apache+mysql+php+Ruby+Redmine+phpMyAdmin+BugFree,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。