Ubuntu 14.04 64bit compile and install Monaserver and test

Source: Internet
Author: User
Tags http request ini mkdir git clone
1. Installation dependencies and requirements
Monaserver is written based on C + + 11, such as Std::thread, Std::unique_ptr, which requires a GCC version of at least 4.8.2
For Ubuntu 14.04.2, this is satisfying.


Additional reliance on OpenSSL and Luajit libraries
sudo apt-get install Libssl-dev
Luajit uses the source installation method, the official website address
Http://luajit.org/download.html
It is recommended to download the latest source installation from GitHub, Master is the current stable branch, currently LuaJIT-2.0.3

git clone http://luajit.org/git/luajit-2.0.git
I found that the git resource download failed and changed to 2.0.3 version of the source package download
wget http://luajit.org/download/LuaJIT-2.0.3.tar.gz
Tar zxf luajit-2.0.3.tar.gz
CD LuaJIT-2.0.3
Make
sudo make install

2. Download source code compilation
git clone https://github.com/MonaSolutions/MonaServer
CD Monaserver
Make
If a compilation error occurs, use the following command to clear the
Make clean
When the compilation is complete, use the
Tree-l 2

We will see the following directory structure

We see that in addition to generating the executable file Monaserver, a tmp temp directory is generated below each directory to hold the intermediate file *.O for compilation generation, the most important directory being monaserver, and the other two directories monabase and Monacore only provide dynamic library calls .


3. Configuration
No configuration file Monaserver.ini found in the source code, the default value will be used. We can also manually generate a configuration file in the installation directory Monaserver.ini
Monaserver.ini in the configuration item explanation:
Host:clients and other servers see the domain name or IP
Socketbuffersize:socket receive and send buffer byte size
Threads:mona thread pool threads, usually equal to or greater than the CPU's virtual or physic core number, automatically detects CPU cores by default
[Application]
Dir: directory containing data and www
[Servers]
Port: Receives other incoming servers connected ports, otherwise cannot establish connection with other servers. Note that the connection between servers is unencrypted TCP, and the port should be inside the firewall
Targets: The Monaserver address to connect at startup, semicolon-delimited, connect every 10 seconds, and the query part of the URL contains tokens, such as
targets=192.168.0.2:1936?name=master&arg=val;192.168.0.3:1936
The dynamic nature of the server object will be generated Server.name,server.arg
[RTMFP]
Port: Listens for ports on incoming RTMFP request, default 1935
Keepaliveserver:servers between keepalive packets periodically sent (in seconds), default 15s, 5s-255s is legal
[RTMP]
PORT: Listening for ports on incoming RTMP request, default 1935
[HTTP]
PORT: Listening for ports on incoming HTTP request, default 80
Timeout: The maximum time the server killed the connection when no data was received, default 7 seconds
The default index file name in the Index:http protocol, if specified, each connection will be redirect to this index
[WebSocket]
Timeout: The maximum time the server killed the connection when no data was received, default 120 seconds
[logs]
Directory: Write log file directories, default Monaserver/logs
Name: Log file names, default log
Rotation: The number of log files stored in the logs directory

Here's a sample of Monaserver.ini.
; Monaserver.ini
Socketbuffersize = 114688
[RTMFP]
Port = 1985
Keepalivepeer = 10
Keepaliveserver = 15
[logs]
Name=log
Directory=c:/monaserver/logs

4. Start
The monaserver contains some startup parameters, and the command-line option is used only for development and test scenarios, to view the full startup parameters, using

sudo./monaserver-h


The following starts with administrator privileges Monaserver
sudo./monaserver--daemon [--pidfile=/var/run/monaserver.pid]
The following command-line launches the Monaserver:
sudo./monaserver--pidfile=/tmp/monaserver.pid



5. Testing
Flash client connects Monaserver using the classic Netconnection method
_netconnection.connect ("rtmfp://localhost/");
Port default 1935, if you have another configuration in Monaserver.ini, please add after localhost
The following path parameter allows you to connect to the server application
_netconnection.connect ("Rtmfp://localhost/myapplication");
Below we are going to test the function of Monaserver, according to Monaserver/functionaltests/readme.txt, we create two subdirectories under the executable program directory WWW and data, create the corresponding symbolic link
Cd/home/taoyx/program/monaserver/monaserver
Mkdir-p www
Mkdir-p data
Ln-s/home/taoyx/program/monaserver/functionaltests/www/functionaltests/home/taoyx/program/monaserver/ Monaserver/www/functionaltests
Ln-s/home/taoyx/program/monaserver/functionaltests/data/functionaltests/home/taoyx/program/monaserver/ Monaserver/data/functionaltests
Start Monaserver below:

sudo./monaserver--pidfile=/tmp/monaserver.pid


Open in Browser
Http://localhost/FunctionalTests/FunctionalTests.html
Each time you click on a test project, after you run it, select the next Test project, and then continue with the test. Currently found behind the RTMFP, etc. can not be tested through, need to study the source code, to follow-up study.




Finally, use CTRL + C to interrupt monaserver and end the functional test.


Reference documents
[1].http://blog.chinaunix.net/uid-11344913-id-4976154.html
[2].http://bbs.chinaffmpeg.com/forum.php?mod=viewthread&tid=254&extra=

[3].http://www.monaserver.ovh/installation.html


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.