This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9538|Reply: 1

Jexus web server V5.1 installation configuration points

[Copy link]
Posted on 10/10/2017 1:31:20 PM | | |
1. Introduction to Jexus:
Jexus web server for linux is a web server based on . .NET compatible environment, running on Linux/unix operating systems, to support high-performance web servers with ASP.NET as the core function.
Jexus V5.1 has the following features:
01. Support ASP.NET. This is the core function of Jexus. Whether it is stability, ease of use, concurrent bearing capacity, parallel processing speed, Jexus support for ASP.NET is excellent;
02. Support Fast-CGI. Through Fast-CGI, Jexus can support all WEB applications with Fast-CGI service functions, including PHP;
03. It has a powerful URL rewriting function based on regular expressions;
04. It has a strong reverse proxy function. Support multi-objective load balancing and seamless integration of local and remote websites.
05. It has strong streaming media support capabilities, supports FLV/F4V video file dragging and playback, and supports Microsoft smooth streaming technology;
06. Support "server push" technology, equipped with corresponding server-side and client-side development interfaces, which is a powerful tool for developing modern WEB applications;
07. It has a controllable "ASP.NET front-end cache", which can maximize the carrying capacity and response speed of ASP.NET websites;
08. Support Https, with SSL encryption data security transmission capability;
09. It has a basic and practical intrusion detection function, which can automatically terminate the identified illegal requests.
10. The installation and deployment are very simple, and the operation and use are extremely simple.


2. Preparations before installation:

1. The system has installed mono 2.10.8 or later, as for how to install mono on linux, please refer to the relevant articles on the www.linuxdot.net.
2. Please confirm that there are two library files in the Linux system, libc.so.6 and libdl.so.2, if you need to enable https, the system also needs to have libssl.so.x.x.x library files, such as libssl.so.0.9.8, if not, please install OpenSSH.


3. Download and unzip the Jexus installation package:
1. Download:
Address: http://www.linuxdot.net/down/jexus-5.1.tar.gz, you can download it with wget, such as: wget http://www.linuxdot.net/down/jexus-5.1.tar.gz

2. Decompression:
tar -zxvf jexus-5.1.tar.gz

3. Installation:
Jexus installation is very simple, just a process of copying, pasting, and registering global assemblies, but be aware that you need to operate as root.
A. To copy the file, it is recommended to install jexus into /usr/jexus:
sudo cp -rf jexus-5.1 /usr/jexus
B. Register global assembly:
cd /usr/jexus
sudo ./jws.regsvr
C. Check the permissions of jws.start, jws.stop, jws.restart, and jws.regsvr script files to determine whether they have executable permissions.


4. Run test
    After copying the Jexus file, Jexus should work properly and even further configuration is not required at all.
    Emphasis: If you have another WEB server installed on your server and the service is running, please stop it to avoid port conflicts that prevent Jexus from starting.

    If it's the latest installation, first create a default website folder: /var/www/default and put a home file in it, such as index.htm or default.htm
    Go to the jexus working folder, start jexus, and the command is as follows:
    cd /usr/jexus
    sudo ./jws.start
    After launching, please try to visit this website to see if you can see the homepage or the welcome page of jexus, which is: "http:// server IP address" or "http:// server IP address/info".


5. Jexus system configuration
Jexus works well according to the default configuration, and further configuration is for Jexus to better suit your needs.
One of the most important configuration files in Jexus is jws.conf, which is in the same folder as the rest of Jexus's working files.
jws.conf has the following basic configuration content:

SiteLogDir=log #网站日志以及Jexus系统日志的存放位置, required field. Relative paths based on jws.exe files can be used
SiteConfigDir=siteconf #网站配置文件存放的位置, which is required. Absolute paths can be used, or relative paths based on the jws.conf file
Runtime=v4.0.30319 #设定Jexus工作进程运行于哪个.NET version
httpd.processes=1 #工作进程的数量, it is recommended to use one process for every 6-8 core CPUs, and a maximum of 4 processes can be set
httpd.user=www-data #工作进程以什么用户身份和对应权限工作, default to root
php-fcgi.set=/usr/bin/php-cgi,6 #如果需要Jexus同时充当PHP FastCGI server, this sentence is the fast-cgi setting, divided into two parts, before the comma is the path of the php-cgi file, and after the comma is the number of php processes
CertificateFile=/xxxx/xx.crt #SSL证书路径 (if you need to use https protocol to fill in)
CertificateKeyFile=/xxxx/xx.key #SSL密钥文件路径 (if you need to use https protocol)

Note: In jws.conf, SiteConfigDir and SiteLogDir are required.


6. Website configuration

Jexus supports multi-site, you can set up as many websites as you want with different ports, domain names, and virtual paths.
1) All website configuration files must be placed in the site configuration folder specified in jws.conf, which cannot contain any other files except the website configuration file, because jexus will think that any file here represents a different website.
2) Each website has and only one configuration file, the file name of the configuration file is the name of this website, such as www.mysite.cn this website, the configuration file name can be written as "mysite", of course, it can also be written as other file names, so that administrators can easily remember and recognize, but pay special attention: the file name should not have spaces!
3) A website can have as many domain names as you want, different websites cannot have the same domain name, and a website without a domain name can only have one.


Let's take www.mysite.cn as an example to talk about the configuration of the website
Create a file in the website configuration folder, the name of the file should have some meaning (at least to give the server administrator an idea of which website the configuration file belongs to)
The file name of the configuration file for this website is mysite

sudo miv mysite

A. Basic content of website configuration:
port=80 # jexus WEB server listening port (required.) It can be other ports, of course)
root=/ /var/www/mysite # The root path (virtual directory) of the website URL and the corresponding physical path, which must be separated by a space between the two path strings (required. Even if this website is a pure reverse proxy station, it must be filled in)

#可选项
hosts=mysite.cn,www.mysite.cn # Website domain name (recommended to fill in), you can use a generic domain name, such as: *.mysite.cn (do not fill in this item or only fill in a "*" sign to indicate that this is the default website, and there can only be one default site on one port)
indexs=index.aspx, index.htm # Home page file name, you can write multiple files, separated by English commas (can be left unfilled. Because the JWS system contains common homepage names)
aspnet_exts=mspx,ttt # Add new or custom ASP.NET extensions (not recommended.) Multiple extensions are separated by English commas without dots. The system contains common extensions)


B. Minimal configuration example
port=80
root=/ /var/www/default

C. Advanced options for website configuration
The advanced options for website configuration are all optional and should be optional according to the actual needs of the website.
With the flexibility to use advanced options, you can set up a unique and powerful server platform or server group.

1. Use the "URL Rewrite" function
URL rewriting means that the WEB server interprets and matches the visitor's request URL path resource according to the specified matching rules to another real RUL path resource.

For example, if you want someone to access a file of type ".php", the server will return the file /404.html:
rewrite=^/.+?\. (asp|php|cgi)$ /404.html
# Format:
# "rewrite=" is followed by two parts blocked by a space between the two parts.
  Whitespace before the matching condition: Describe the matching condition of the URL with a regular expression.
  Space followed by matching target: refers to which rule the server will respond with if the user's access path meets the previous match criteria.

Another example:
Resolve "/bbs" to "/bbs/index.aspx" and match "/bbs/file-1" to "/bbs/show.aspx?id=1":
rewrite=^/bbs$ /bbs/index.aspx
rewrite=^/bbs/file-([0-9]{1,6})$ /bbs/show.aspx?id=$1
Format explanation: The equal sign of rewrite contains two parts, which are separated by space spaces. The first half is a regular expression that describes the URL path style (in the user's browser) that requires URL rewriting, and the second half is the real URL path that the JWS should rewrite and access when the user's URL conforms to the previous regular expression.

2. Prohibit access to this website by a certain IP or IP segment
denyfrom=111.222.111.*
denyfrom=101.202.111.*
denyfrom=101.201.1.132

3. Prohibit access to the contents of a folder and its subfolders
DenyDirs=URL path to the website folder path, such as "/abcfiles" or "~/abcfiles", multiple paths, separated by a comma

4. Whether to perform security checks on the requested URL
This option is true by default, that is, it needs to be checked, unless you really need to turn off this option, you can leave it unfilled, the format is as follows:
checkquery=false
(Turning this off can improve server speed, but for security reasons, it is not recommended to turn it off)

5. NOFILE (no file) function
nofile=/mvc/controller.aspx
(Note: This is a Jexus-specific feature that refers to what file the server will respond to if the file the user wants to access does not exist.) )
(Note: After routing, the original RUL path will be stored in a server variable "X-Real-Uri" specific to Jexus)
(Tip: With this function, or with the URL Rewrite function, you can completely isolate the URL path from the real path, so as to hide information and simplify the URL.) )

6. NOLOG (no log) function
nolog=yes
(Note: Disabling the website log function will improve the processing speed of the WEB server system, but the shortcoming is also obvious, that is, you cannot know the website access in detail)

7. Long connection switch
keep_alive=true
Note: The default value of V5.1 is true, that is, the long connection is used by default, and it can be left unfilled.

8. Reverse proxy function
reproxy= /abc/ http://www.xxxx.com:890/abc/
The value of the parameter consists of two parts: the root path of the RUL of the site and the root path of the URL of the target website, which are separated by spaces.
*Technique: The target address of reverse generation can be multiple, separated by English commas, such as:
reproxy=/abc/ http://192.168.0.3/abc/,http://192.168.0.4/abc/
When the user accesses /abc/, JEXUS will randomly select a server to access to achieve the effect of load balancing or server clustering.

9. Accept the services provided by FAST-CGI
For TCP connections:
fastcgi.add=file extension that needs to be processed by fast-cgi|tcp: IP address of the fast-cgi service: port
For example: fastcgi.add=php,php3|tcp:127.0.0.1:9000
For Unix Sockets:
fastcgi.add=File extension that needs to be handled by fcgi |socket: path
For example: fastcgi.add=php,php3|socket:/tmp/phpsvr

10. Enable the gzip compression function
usegzip=true #即UseGzip
Explanation: After enabling this function, when users access files such as ".htm" and ".js", Jexus will GZIP these files and send them to the user's browser, which can save more network bandwidth.

11. Enable HTTPS for SSL secure transmission
This function encrypts the data between the server and the customer to provide data confidentiality. For specific methods, please visit the www.linuxdot.net's special explanation.


7. Jexus operation:

1. The format of the basic startup command (only an example, not recommended)
mono /usr/jexus/jws.exe
For example: mono /usr/jexus/jws.exe
After this command runs, use the Ctrl+c key combination to exit the program

2. Run in the background in the form of "service", only need to add a space after the basic command and add a "&" sign (only as an example, not recommended)
mono /usr/jexus/jws.exe &

3. Automatic start-up:
Add the following command to /etc/rc.local or the boot script of the test:
mono /usr/jexus/jws.exe >/dev/null 2>&1 &
or
/usr/jexus/jws.start  #推荐方式


(Note: Different Linux systems may have different boot methods, and users should flexibly customize them according to the characteristics of different systems)
(Tip: jws.start is a script file, users can modify it appropriately according to the characteristics of their system to make it start)

4. Use scripts to operate Jexus (recommended):
Jexus comes with three scripts, namely: jws.start, jws.restart, and jws.stop.

Function 1, operation on Jexus server:
jws.start #启动JEXUS服务, which can be written to the rc.local file, so as to achieve the purpose of booting auto-start;
jws.stop #停止Jexus的运行.
jws.restart #重启Jexus;

Function 2, operate on a specified website:
jws.restart Site Name #加载/Start/Restart a specified website
jws.stop website name #停止一个指定的网站


Note that these scripts need to have executable permissions, and the operator must also have administrator (root) privileges.


8. Uninstall:
1. Delete the command line of boot auto-start Jexus that you manually added in the rc.local file (if you haven't added it in the first place, you don't have to do this step)
2. Delete the jexus folder and all its contents (it is recommended to delete only *.exe and *.dll, and others, such as website configuration files, do not need to be deleted so that they can be re-enabled in the future).


9. Information feedback and technical exchange:
Website: www.linuxdot.net


10. Important Statements:
Jexus V5.1 is free software that can be freely downloaded, distributed, and used. However, Jexus authors, publishers, and maintainers do not make any express or implied promises regarding the use, function, effect, technical support, and other related content of Jexus, and do not assume any direct or indirect responsibility.




Previous:Xiaobai asked, how to buy a recharge card?
Next:JS generates GUIDs
Posted on 1/23/2019 11:11:01 AM |
Thank you for reading
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com