window实现MRBS会议预定系统部署

一,准备资料

1.mrbs源码下载“Meeting Room Booking System - Browse /mrbs/MRBS 1.11.5 at SourceForge.net

2.window环境nginx服务下载(nginx-1.24.0.zip) nginx: download

3.php服务下载(php-8.3.10-nts-Win32-vs16-x86.zip) PHP For Windows: Binaries and sources Releases

4.mysql服务下载MySQL :: Download MySQL Community Server 

二,软件安装配置

1.mrbs配置

(1)解压mrbs压缩包,mrbs/目录下可见“INSTALL”文件,描述了安装所需环境及一些会议系统配置信息,英文好的可直接参考该文件

(2)mrbs/web目录将config.inc.php-semp文件改为config.inc.php(mrbs执行调用配置文件),打开文件修改配置信息;注意:systemdefaults.inc.php&areadefaults.inc.php两个文件为基准配置文件,不可轻易修改,如有修改可拷贝至config.inc.php文件修改即可生效

(3)config.inc.php文件修改如下:

<?php // -*-mode: PHP; coding:utf-8;-*-
namespace MRBS;

use IntlDateFormatter;

require_once 'lib/autoload.inc';

/**************************************************************************
 *   MRBS Configuration File
 *   Configure this file for your site.
 *   You shouldn't have to modify anything outside this file.
 *
 *   This file has already been populated with the minimum set of configuration
 *   variables that you will need to change to get your system up and running.
 *   If you want to change any of the other settings in systemdefaults.inc.php
 *   or areadefaults.inc.php, then copy the relevant lines into this file
 *   and edit them here.   This file will override the default settings and
 *   when you upgrade to a new version of MRBS the config file is preserved.
 *
 *   NOTE: if you include or require other files from this file, for example
 *   to store your database details in a separate location, then you should
 *   use an absolute and not a relative pathname.
 **************************************************************************/

/**********
 * Timezone
 **********/

// The timezone your meeting rooms run in. It is especially important
// to set this if you're using PHP 5 on Linux. In this configuration
// if you don't, meetings in a different DST than you are currently
// in are offset by the DST offset incorrectly.
//
// Note that timezones can be set on a per-area basis, so strictly speaking this
// setting should be in areadefaults.inc.php, but as it is so important to set
// the right timezone it is included here.
//
// When upgrading an existing installation, this should be set to the
// timezone the web server runs in.  See the INSTALL document for more information.
//
// A list of valid timezones can be found at http://php.net/manual/timezones.php
// The following line must be uncommented by removing the '//' at the beginning
$timezone = "Asia/Shanghai"; //修改时区,该参数必须,不写打开会议页面会有警告提醒


/*******************
 * Database settings
 ******************/
// Which database system: "pgsql"=PostgreSQL, "mysql"=MySQL
$dbsys = "mysql";  //数据库,我使用的是MySQL数据库
// Hostname of database server. For pgsql, can use "" instead of localhost
// to use Unix Domain Sockets instead of TCP/IP. For mysql "localhost"
// tells the system to use Unix Domain Sockets, and $db_port will be ignored;
// if you want to force TCP connection you can use "127.0.0.1".
$db_host = "localhost"; //数据库地址,window下用localhost,我用IP地址导致连接失败
// If you need to use a non standard port for the database connection you
// can uncomment the following line and specify the port number
// $db_port = 1234;
// Database name:
$db_database = "mrbs"; //数据库名称,与MySQL中创建的数据库名称一致
// Schema name.  This only applies to PostgreSQL and is only necessary if you have more
// than one schema in your database and also you are using the same MRBS table names in
// multiple schemas.
//$db_schema = "public";
// Database login user name:
$db_login = "root"; //数据库访问名
// Database login password:
$db_password = '*********'; //数据库访问密码
// Prefix for table names.  This will allow multiple installations where only
// one database is available
$db_tbl_prefix = "mrbs_";
// Set $db_persist to TRUE to use PHP persistent (pooled) database connections.  Note
// that persistent connections are not recommended unless your system suffers significant
// performance problems without them.   They can cause problems with transactions and
// locks (see http://php.net/manual/en/features.persistent-connections.php) and although
// MRBS tries to avoid those problems, it is generally better not to use persistent
// connections if you can.
$db_persist = false;


/* Add lines from systemdefaults.inc.php and areadefaults.inc.php below here
   to change the default configuration. Do _NOT_ modify systemdefaults.inc.php
   or areadefaults.inc.php.  */

// The company name is mandatory.   It is used in the header and also for email notifications.
// The company logo, additional information and URL are all optional.

$mrbs_company = "你的会议室名称";   // This line must always be uncommented ($mrbs_company is used in various places)

$override_locale = 'zh-CN'; //中文简体,默认是英文

(4)其实我根据自己需求将会议类型进行了客制化,折腾了半天,改了源码,最后实现了80%;发现配置档可以直接进行配置,配置完成仅需在mrbs/web/lang/lang.zh-cn,新增类型即可(不想泄露信息,所以在此不贴修改,熟悉前端的一看便知);新增完成修改配置项,修改systemdefaults.inc.php(配置在config.inc.php应该也可以,大家可以试一下,我懒得试了;违背的不修改systemdefaults.inc.php文件的原则o(* ̄︶ ̄*)o)配置如下:

unset($booking_types);    // Include this line when copying to config.inc.php
$booking_types[] = "E"; //系统默认
$booking_types[] = "I"; //系统默认
$booking_types[] = "G"; //新增
$booking_types[] = "H"; //新增

2.nginx服务配置

(1)将nginx压缩包,解压至你看着比较顺眼的位置

(2)修改nginx配置文件(D:\nginx\nginx-1.24.0\conf)

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80; #服务器监听端口
        server_name  0.0.0.0; #域名,0.0.0.0允许所有外部用户访问

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            #root   html;
            #index  index.html index.htm;
			root E:/software/MRBS/mrbs/web;  #mrbs index.php文件路径
			index index.html index.htm index.php;
			autoindex on; #充许列表目录
        }

        #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   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$ {
        #    root           html;
		#root E:/software/MRBS/mrbs/web;
            fastcgi_pass   127.0.0.1:9000; #php服务信息
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  E:/software/MRBS/mrbs/web$fastcgi_script_name;
            include        fastcgi_params;
			#fastcgi_param  SCRIPT_NAME  $fastcgi_script_name;
        }

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

    #client_max_body_size 2000M;

    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

(3)nginx配置文件修改完成,进nginx文件路径(如果有条件将nginx加入环境变量更便捷)执行nginx -t 检查配置是否有误

(4)启动nginx服务 start nginx.exe

(5)查看nginx是否正常运行 tasklist | findstr nginx

(6)其他实用命令

nginx关闭:nginx -s quit

nginx重启:nginx -s reload

查看服务端口是否被占用:netstat -ano | findstr :80

命令添加环境变量:
setx PATH "%PATH%;C:\php"
查看环境变量:
echo %PATH%

3.php服务配置

(1)将php压缩包解压缩,我将解压文件拷贝至了C盘根目录,放其他盘应该也没问题

(2)修改配置文件,将php.ini-development文件改为php.ini

//配置文件内容太多,没有全部复制,仅把需要修改的参数列举如下:
extension_dir = "ext"
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1
extension=mysqli
extension=intl
extension=pdo_mysql

(3)PHP运行有个大坑,在window下运行一段时间会挂掉;在此先不介绍服务启动方法,下面“疑难杂症”中会介绍启动方法

4.MySQL服务器部署及数据库创建

(1)解压缩MySQL压缩包

(2)在my.ini同级目录新建data文件夹

(3)修改mysql/my.ini配置文件(根据自己文件路径信息配置)

[mysqld]
port=3306
basedir=E:\\software\\MySQL\\mysql
datadir= E:\\software\\MySQL\\mysql\\data
max_connections=200
max_connect_errors=10
character-set-server=utf8mb4
default-storage-engine=INNODB
 
[mysql]
default-character-set=utf8mb4
[client]
port=3306
default-character-set=utf8mb4

(4)用压缩包方式安装,首先进入MySQL的文件目录(E:\software\MySQL\mysql\bin)执行初始化命令: mysqld.exe --initialize --user=mysql --console,安装完成如下图(一定要记录该数据库登录密码):

(5)执行MySQL服务安装命令:mysqld.exe  –install

(6)启动数据库服务mysqld.exe --console

(7)登录数据库:mysql.exe -uroot -p

(8)修改数据库密码,进入数据库后执行命令ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘new_password’修改密码(mysql> ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘new_password’)

至此数据库创建完成,下一步开始建数据库,建mrbs数据表

(9)终端连接数据库,导入mrbs数据表

我用的是DBeaver数据库终端工具,连接成功后,传建数据库:

mrbs/路径找到tables.my.sql文件,DBeaver中打开SQL编辑器,并连接至mrbs数据库,将tables.my.sql中创建表的SQL语句,一个表一个表的拷贝的SQL编辑器,单个执行(DBeaver,批量执行会报错)

tables.my.sql中SQL全部执行完成,共新建9个表

关闭MySQL服务命令:mysqladmin.exe -u root -p 你的密码 shutdown

三,服务部署

第二步所有动作全部执行完成,按照上述命令启动所有服务,浏览器输入IP+端口号即可访问会议室预约系统,如下图示意

四,疑难杂症

在window环境下,PHP服务运行一段时间会自行挂掉,运行指令为:php-cgi.exe -b 127.0.0.1:9000 -c php.ini

解决办法:xxfpm

(1)下载xxfpm Gitee Search

根据gitee服务介绍,将xxfpmW文件copy至PHP文件根目录,xxfpmW配置文件采用默认值即可,然后直接运行 xxfpmW.vbe文件,运行成功可在任务管理器看到同时有五个FastCGI服务在运行

这样完美解决了PHP服务挂掉的问题。

(2)PHP服务关闭方法:

a.任务管理器中右键 Microsoft ® Windows Based Script Host 结束任务。

b.任务管理器中右键 xxfpmW.exe 结束任务。

MRBS 会议室预定管理系统简介 MRBS是一个基于PHP/MySQL/PostgreSQL开发的,使用浏览器访问的会议室预订管理系统。使用区域对会议室进行分组管理。 MRBS 会议室预定管理系统特点: •网络/内联网 - 可透过浏览器的任何工作站 •简单跟随,基于Web的选项和直观演示 •灵活的重复预订 •身份验证与您现有的用户数据库(如Netware的,NT域,NIS等) •确保冲突的项目不能进入 •报告选项 •可选的日/周/月视图 •多种身份验证级别(只读,用户,管理员) •支持按预订时间或时段 - 非常适合在学校使用 •房间管理员可以预订的通过电子邮件通知 •支持多国语言(翻译为加泰罗尼亚语,捷克语,中国,丹麦语,荷兰语,芬兰语,法语,德语,希腊语,意大利语,日语,韩语,挪威语,葡萄牙语,斯洛文尼亚语,西班牙语,瑞典语,土耳其语) •稳定和使用中的许多组织 •MySQL和Postgres的支持 演示的登录名密码都是admin MRBS更新日志: 修正了邮件调试输出 修复了升级17使用PostgreSQL时(日期时间数据类型) 新增产量的冲洗期间大型数据库的升级长期提供一些反馈 PostgreSQL中固定的问题升级25(日期时间数据类型) 修正各种问题与升级24[e4674a64d965] 要警惕的措辞小的改动,以支付超出1.4.6升级 增加了一个命名空间语句来避免冲突升级与24 在提交修正错字 MRBS 会议室预定管理系统页面展示  相关阅读 同类推荐:站长常用源码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值