Tampilkan postingan dengan label Opensource. Tampilkan semua postingan
Tampilkan postingan dengan label Opensource. Tampilkan semua postingan

Install Room Booking System - Hệ thống đặt phòng họp online

Trong bài viết này mình sẽ hướng dẫn các bạn setup hoàn chỉnh 1 hệ thống đặt phòng trực tuyến mã nguồn mở được viết bằng CFWheels:




"CFWheels is an open source CFML (ColdFusion Markup Language) framework inspired by Ruby on Rails that provides fast application development, a great organization system for your code, and is just plain fun to use. One of our biggest goals is for you to be able to get up and running with CFWheels quickly. We want for you to be able to learn it as rapidly as it is to write applications with it."


thông tin thêm về mã nguồn này các bạn có thể tự tham khảo nhá.


Các bước cài đặt hệ thống bao gồm các bước:


1. cài đặt server centos

2. cài apache, mysql (nếu cần thì cài thêm phpmyadmin để quản lý mysql cho tiện)
3. cài đặt Railo và Apache Connector
4. Cài đặt java

Chi tiết các bước cài đặt như sau:

1. Cài đặt server CentOS : hướng dẫn này cài trên Centos 6, các bạn có thể cài trên CentOS 7, Ubuntu hay Debian cũng được. Mình thực hiện lab trên máy ảo. Mục này mình chỉ nêu nội dung, còn lại các bạn tự thực hiện.

- mình dùng bản cài CentOS-6.7-x86_64-minimal.iso các bạn có thể download trên mạng
- Setup server như bình thường
- Đặt hostname server
- Set IP server
- Nhớ tắt Selinux & accept rules iptable or disable iptables luôn
Done, xong bước 1, chuyển qua bước 2

2. Cài đặt apache, mysql


yum install httpd mysql-server php php-mysql -y
service httpd start
chkconfig httpd on
service mysqld start
chkconfig mysqld on
mysql_secure_installation 
Đăng nhập vào mysql tạo 1 database có tên là roombooking (bước này sẽ giải thích ở bước sau)
CREATE USER 'root@localhost' IDENTIFIED BY 'yourpassword';
CREATE DATABASE IF NOT EXISTS roombooking;
GRANT ALL PRIVILEGES ON roombooking.* TO 'root@localhost' IDENTIFIED BY 'yourpassword';
Ở đây mình dùng luôn user root, các bạn dùng user khác thì tạo user mới rồi thay thế vô cho phù hợp

3. Cài đặt Railo và Apache Connector :


Railo Server, commonly referred to as Railo (/raɪloʊ/ raɪ-lo), is open source software which implements the general-purpose CFML server-side scripting language, often used to create dynamic websites, web applications and intranet systems. CFML is a dynamic language supporting multiple programming paradigms and runs on the Java virtual machine (JVM).


Ngoài Railo còn có Lucee hay ColdFusion.

Do bản server của mình đang chạy 64bit nên mình sẽ download bản Railo x64 tương ứng
wget http://railo.viviotech.net/downloader.cfm/id/125/file/railo-4.2.1.008-pl0-linux-x64-installer.run -O railo.run
link download dự phòng  
Lucee: http://www.mediafire.com/download/9jzpmoflhe1cwcs/lucee-4.5.2.018-pl0-linux-x64-installer.run

Set quyền cho file railo.run
chmod 744 railo.run
Thực thi cài đặt
./railo.run 
 Nhấn 4 để chọn ngôn ngữ English

Nhấn Enter để tiếp tục

Nhấn Y để đồng ý,
Nhập 2 lần password cho server Railo

Port va user root để mặc định, ai muốn thay đổi thì nhập vào và phải nhớ port , user khác thì thay đổi sao cho phù hợp với bước tạo database phía trên

Nhấn yes để khởi động Railo
Hệ thống sẽ tiếp tục hỏi bạn có muốn cài Apache Connector ko? nhấn Y

Enter tiếp
Cuối cùng nhấn Y để chạy cài đặt


Quá trình cài đặt diễn ra khoảng 30s - 01ph



Finished


Restart Apache:
  service httpd restart
4. Setup JAVA

Kiểm tra xem server đã cài đặt java chưa?
java -version
Nếu chưa thì tiến hành cài đặt
yum install java7 -y    
Chạy lệnh trên ko được thì làm theo hướng dẫn tại đây
Sau khi cài xong ta khởi động lại Railo và bật Railo start cùng hệ thống
service railo_ctl restart 
chkconfig railo_ctl on 
Ok vậy là các bước cài đặt đã xong, ta mở trình duyệt lên, truy cập vào server Railo theo đường dẫn

http://server_ip_addr:8888 

Control panel


http://svripaddr:8888/railo-context/admin/server.cfm


http://svripaddr:8888/railo-context/admin/web.cfm

đăng nhập bằng pass lúc nãy tạo ở trên


vào server nhìn menu bên trái dưới mục service chọn datasource ==> create new database
chọn mysql và đặt tên cho database là roombooking, nhập user với password quản lý database ==> Create.


Tải source code tại đây: https://github.com/neokoenig/RoomBooking/releases/download/1.2/RoomBooking-1-2-1.zip
Link dự phòng tại đây
Tải về giải nén ra rồi copy source code lên server theo đường dẫn :  /opt/railoa/tomcat/webapps/ROOT/roombooking
Sau đó import file new-installation.sql trong source code ở đường dẫn roombooking\install\new-installation.sql gồm 10 table vào database roombooking đã tạo trước đó.





Sau khi copy source code & import database xong, mở trình duyệt lên gõ http://server_ip_addr:8888/roombooking/install để tiến hành cài đặt,
Khi mọi thứ ok hết sẽ hiển thị bước điền user & password admin.

Sau đó bạn xóa hoặc đổi tên thư mục install và reload lại trang web sẽ được kết quả như hình



Đến đây hoàn tất quá trình cài đặt ứng dụng, chúc các bạn thành công.


các bạn có thể sử dụng demo tại trang chủ: http://roombooking.oxalto.co.uk/
Hướng dẫn cài đặt của tác giả: https://roombooking.readme.io/docs/requirements

Bài viết tham khảo

https://www.digitalocean.com/community/tutorials/how-to-set-up-railo-cfml-engine-with-tomcat-and-apache-on-a-debian-7-or-ubuntu-13-vps
http://www.gpickin.com/index.cfm/blog/multi-cfml-engine-install-installing-railo-on-linux-centos





Meeting Room Booking System (MRBS) - Website đặt phòng họp nội bộ miễn phí

Meeting Room Booking System (MRBS) - Website đặt phòng họp nội bộ miễn phí

MRBS - Meeting Room Booking System. http://mrbs.sourceforge.net/demo.php
1 dạng web ứng dụng sử dụng PHP and MySQL/pgsql. Source code và data được chia sẻ hoàn toàn miễn phí, dễ cài đặt, dễ sử dụng.

MRBS để làm gì ?-> Để tạo một website đặt phòng họp nội bộ miễn phí, dành cho các công ty không chú trọng quá lớn đến một hệ thống hiện đại, sử dụng phần mềm cao cấp cho vấn đề này.

MRBS có thể cài trên server linux hoặc windows. 
Ở đây mình dùng Windows + XAMPP để cái đặt, ngoài XAMPP các bạn muốn dùng cái gì cũng được, vì nó tựa tựa nhau cả.

Vào vấn đề chính.
DOWNLOAD MRBS tại đây: http://sourceforge.net/projects/mrbs/files/
Phiên bản hiện tại cho bài viết này là mrbs-1.45.0.zip. (2,1 MB) Key mở khóa download !ODsS3fpxTllgUm6s1nrvDi1BZz4x04a-ONuLmFFRDiM

Giải nén gói zip, ta được 1 đống file sql, ... abc xzy tùm lum, và 1 cái folder WEB. Các bạn chỉ quan tâm tới file tables.my.sql và thư mục web.

PHẦN I: CÀI ĐẶT MRBS

Bước 1: Cài đặt MRBS

Trên localhost/phpmyadmin, tạo data tên là mrbs (mình khuyên là mrbs, đỡ phải chỉnh sửa nhiều ). Sau đó import file tables.my.sql vào. Được 7 bảng như hình:



Sau đó, copy toàn bộ file bên trong thư mục web paste vào đường dẫn webroot của xampp: htdocs/mrbs

Bước 2: Chỉnh sửa file config

Trong thư mục chứa source web, tìm file config.inc.php và sửa như sau: 
Trích:
// 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

/*******************
* Database settings
******************/
// Which database system: "pgsql"=PostgreSQL, "mysql"=MySQL,
// "mysqli"=MySQL via the mysqli PHP extension
$dbsys = "mysqli";
// Hostname of database server. For pgsql, can use "" instead of localhost
// to use Unix Domain Sockets instead of TCP/IP.
$db_host = "localhost";
// Database name:
$db_database = "mrbs";
// 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_";
// Uncomment this to NOT use PHP persistent (pooled) database connections:
Lưu ý các thông số 
$dbsys= "mysqli"; 
$db_host = "localhost"; 
$db_database = "mrbs"; 
$db_login = "root"; 
$db_password = ''; 
chỉnh cho đúng với thông số tạo trong phpmyadmin
Bước 3: Chỉnh timezone
phiên bản mới này mục timezone sẽ nằm trong file "systemdefaults.inc.php" , mở file lên và set thành "Asia/Ho_Chi_Minh", nếu không làm bước này các bạn sẽ gặp thông báo lỗi timezone khi truy cập trang web.

/**********
 * 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/Ho_Chi_Minh";

OK đã tạm xong phần cài web, truy cập local để thưởng thức: http://localhost/mrbs 


PHẦN II: Tạo User cho các phòng ban đăng nhập

Không giống như các phiên bản trước, ở phiên bản này cách tạo user đã xuất hiện trong menu admin, các bạn chỉ cần truy cập vào mục user list sau đó tạo user theo ý muốn



Phần III - Thay đổi Type tương ứng với màu hiển thị các phòng ban.

Để dễ phân biệt các phòng ban, source này cho phép chúng ta tạo mỗi type tưong ứng với màu của một phòng ban. Các type này mình cũng chả biết nó cấu hình ở đâu nữa, chỉ biết lấy ra gán ghép vào cho nó thôi.


Để thêm 1 màu mới cho phòng ban nào đó, các bạn vào file "systemdefaults.inc.php" ,  tìm tới đoạn:

/*************
 * Entry Types
 *************/

// This array lists the configured entry type codes. The values map to a
// single char in the MRBS database, and so can be any permitted PHP array
// character.
//
// The default descriptions of the entry types are held in the language files
// as "type.X" where 'X' is the entry type.  If you want to change the description
// you can override the default descriptions by setting the $vocab_override config
// variable.   For example, if you add a new booking type 'C' the minimum you need
// to do is add a line to config.inc.php like:
// 
// $vocab_override["en"]["type.C"] =     "New booking type";
//
// Below is a basic default array which ensures there are at least some types defined.
// The proper type definitions should be made in config.inc.php.
//
// Each type has a color which is defined in the array $color_types in the styling.inc
// file in the Themes directory

$booking_types[] = "I";
$booking_types[] = "E";
$booking_types[] = "A";
$booking_types[] = "B";
$booking_types[] = "C";
// Default type for new bookings
$default_type = "I";

Mặc định khi cài xong chỉ có 2 type I & E là Internal & External, các bạn vào đây thêm mới type , ví dụ ở đây mình đã thêm 3 type là A,B,C.

Sau khi thêm xong, các bạn vào thư mục lang,  mở file lang.en và tìm tới dòng: 
// Entry types
$vocab["type.G"]

Sau đó sửa tên &  thêm các type giống với file bên trên vào.

// Entry types
$vocab["type.I"] = "HR";
$vocab["type.E"] = "ADM";
$vocab["type.A"] = "BGD";
$vocab["type.B"] = "IE";
$vocab["type.C"] = "PE";

Chắc có bạn sẽ thắc mắc tại sao lại mở thư mục lang.en lên đúng ko? trong file "systemdefaults.inc.php" nó mặc định ngôn ngữ là english, nếu bạn nào muốn đổi sang ngôn ngữ khác thì vào đó thay thế, rồi thêm type theo đúng ngôn ngữ mình chọn là dc.

Phần IV - Tạo khu vực phòng họp

Nhìn hình là hiểu 





Done!

Bài viết có tham khảo của bác kingston bên nhatnghe http://www.nhatnghe.com/forum/showthread.php?t=668502

Kategori

Ads

Kategori