Mantis 迁移手记(Ubuntu Server 10.04 + Nginx 1.x + PHP-FPM 5.x + Mantis 1.2.8)

公司原来的Mantis在个人的机器上,现在购置了服务器,迁移到Linux系统中,以下是手记


1.MySQL安装配置
1.1.安装
$sudo apt-get install mysql-server


1.2.配置
$mysql -uroot -p
输入root密码

建立用户
mysql>create user 'mantis'@'localhost' identified by 'mantis';
建表
mysql>create database mantis default character set=utf8;
授权
mysql>grant all privileges on mantis.* to 'mantis'@'localhost';
mysql>quit;
直接从现有的库导入数据
$mysqldump -h 192.168.1.117 -umantis -pmantis mantis | mysql -umantis -pmantis mantis;


2.Nginx安装配置
2.1.安装最新版的
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
提示Ok

sudo vim /etc/apt/sources.list
加入nginx官方源
deb http://nginx.org/packages/ubuntu/ lucid nginx
deb-src http://nginx.org/packages/ubuntu/ lucid nginx
更新
sudo apt-get update
sudo apt-get install nginx

2.2.配置
因为各版本不同,请先
more /etc/nginx/nginx.conf看一下配置文件的位置


建立mantis的目录
sudo mkdir -p /var/www/mantis


sudo vim /etc/nginx/nginx的配置文件位置
server {
    listen       8000;
    server_name  localhost 192.168.1.250; #可能要加域名,用空格分隔多个值


    #charset koi8-r;
    #access_log  /var/log/nginx/log/host.access.log  main;


    location / {
        root   /var/www/mantis;#这个位置是刚建立的
        index  index.php index.html index.htm;#加上了index.php,用空格分隔多个值
    }

    #error_page  404              /404.html;


    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }


    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}


    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
#下面几行取消注释
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name; #必须的,不然会出现No input file specified.
        include        fastcgi_params;
    }


    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

管理服务
sudo service nginx stauts
Usage: /etc/init.d/nginx {start|stop|status|restart|reload|force-reload|upgrade|configtest}




3.PHP5-FPM安装,配置
参考文档
http://shen2.cn/2010/08/nginx-php5-fpm/
http://qlj.sh.cn/linux/20090815/nginx-php-no-input-file-specified/
http://rubyist-journal.com/2010/02/28/howto-nginx-php5-mysql-phpmyadmin-ubuntu-shortest-setup/
http://b.gkp.cc/2010/10/12/setup-nmp-on-ubuntu-1010/


3.1.安装
sudo vim /etc/apt/sources.list
加入非官方源
deb http://ppa.launchpad.net/jdub/devel/ubuntu maverick main
deb http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main
deb-src http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main

更新
sudo apt-get update
sudo apt-get install php5-fpm php5-mysql
#sudo apt-get install php-apc php5-curl php5-gd php5-imagick php5-mysql php5-memcache php5-memcached php5-mcrypt


3.2.配置
测试安装是否成功
sudo vim /var/www/mantis/test.php
输入
<?
phpinfo();
?>
http://192.168.1.250:8000/test.php


sudo vi /etc/php5/fpm/php.ini
设置(好象不改也没得事)
cgi.fix_pathinfo=0 


3.3.管理
sudo service php5-fpm
Usage: /etc/init.d/php5-fpm {start|stop|force-quit|restart|reload}


4.Mantis安装和配置
把已有的matis代码传到/var/www/mantis
http://192.168.1.250/admin/install.php
sudo vim config_inc.php #修改数据库连接,邮件SMTP,文件上传目录等
http://192.168.1.250/admin/ #查看安装结果


装完后:
sudo chmod -rwx /var/www/mantis/admin #去掉所有权限
sudo chmod -rwx /var/www/mantis/test.php #去掉所有权限


原文链接: http://blog.csdn.net/kimsoft/article/details/7277934

转载于:https://my.oschina.net/chen106106/blog/46065

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
请按照以下步骤在Ubuntu上安装Mantis: 1. 首先,确保你的系统已更新并安装了Apache和MySQL。 2. 使用以下命令安装PHP7.0及其相关组件:sudo apt-get install php7.0 php7.0-mysql php7.0-curl php7.0-xmlrpc php7.0-json php7.0-gd php7.0-mbstring php7.0-common php7.0-cli 3. 安装Mantis所需的附加软件包:sudo apt-get install git 4. 克隆Mantis的代码库到你的本地系统:git clone https://github.com/mantisbt/mantisbt.git 5. 进入Mantis的代码目录:cd mantisbt 6. 为Mantis创建一个数据库:mysql -u root -p -e "CREATE DATABASE mantis;" 7. 导入Mantis的数据库架构:mysql -u root -p mantis < sql/mysql/mantis_create_tables.sql 8. 为Mantis创建一个MySQL用户:mysql -u root -p -e "GRANT ALL PRIVILEGES ON mantis.* TO 'mantis'@'localhost' IDENTIFIED BY 'password';" 9. 复制并重命名`config_inc.php.sample`文件:cp config/config_inc.php.sample config/config_inc.php 10. 使用文本编辑器打开`config/config_inc.php`文件,并修改以下配置项: - `$g_hostname`:将其设置为`localhost` - `$g_db_name`:将其设置为`mantis` - `$g_db_username`:将其设置为`mantis` - `$g_db_password`:将其设置为之前为MySQL用户设置的密码 - `$g_crypto_master_salt`:将其设置为一个随机的字符串 11. 配置Apache,将Mantis的根目录指向`/path/to/mantisbt`。 12. 重启Apache服务器:sudo service apache2 restart 13. 现在,你可以通过浏览器访问`http://localhost/mantisbt`来安装和配置Mantis

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值