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

32 篇文章 2 订阅
5 篇文章 0 订阅

公司原来的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 #去掉所有权限

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值