Resin study notes

Source: Internet
Author: User
Tags http authentication
The most common method for setting automatic service startup is in rc. add a script similar to the following in local: # sshd/usr/local/sbin/sshd # proftpd/usr/local/sbin/proftpd # apache/home/apache/bin/apachectlstart # mysql/home/mysql/bin/safe_mys

The most common way to set automatic service startup is to add a script similar to the following in rc. local:
# Sshd
/Usr/local/sbin/sshd

#Proftpd
/Usr/local/sbin/proftpd

# Apache
/Home/apache/bin/apachectl start

#Mysql
/Home/mysql/bin/safe_mysqld -- port = 3306 &

# Start oracle8i listener first
Su-oracle-c 'lsnrctl start'

# Start oracle8i
Su-oracle-c 'dbstart'

However, you have encountered a lot of trouble when configuring auto-start of RESIN, mainly because environment variables such as JAVA_HOME cannot be read during system initialization. Through some materials
Http://www.caucho.com/support/resin-interest/0112/0151.html
To configure RESIN as a configurable service, you need to perform the following steps:

After setting the JAVA_HOME environment variable, unpack the RESIN to/home/resin and execute the compilation script.
Resin-version.tar.gz % tar zxf
# Mv resin-version/home/resin
% Cd/home/resin/
%./Configure
% Make
# Make install

Copy $ RESIN_HOME/contrib/init. resin generated by makeinstall to/etc/rc. d/init. d/resin and chmod + x resin
Cp contrib/init. resin/etc/rc. d/init. d/resin
Chmod + x/etc/rc. d/init. d/resin

Modify some settings in resin: JAVA_HOME RESIN_HOME USER, etc,

Set the resin service to self-start at different startup levels:
#/Sbin/chkconfig resin reset

I also learned a lot about using chkconfig to manage service startup. In fact, the reason why the/etc/init. d/resin script can be configured with chkconfig is mainly due to the following annotations:

# Chkconfig: 345 85 15
# Description: Resin is a Java Web server.

This annotation indicates that the resin service is automatically started under runtime level 345 (/etc/rc. d/rc3.d rc4.drc5. d. use the corresponding link to init. d/resin), the start priority is 85, and the stop priority is 15. This will automatically generate S # resin and K # resin in the corresponding rc #. d. Previously, the files under rc. d/in GNU/Linux were not as concise as those in FREEBSD. With CHKCONFIG, I can simplify the management of the following files. After you use/sbin/chkconfigresin on to set the RESIN service to a self-starting service, you can also set the RESIN service in the systemservices settings on the setup interface of GNU/Linux.

If the RESIN serves as the port 80 service, the ROOT permission is required, and httpd cannot be used as the server starts. sh, but an executable file is required for implementation. /configure; make; makeinstall, the executable file will be generated under $ RESIN_HOME/bin/. the resin file is actually an execution wrapper. pl turns.

Start Resin on a slow machine:
RESIN is a JAVA application that consumes a lot of CPU resources during startup. Therefore, in some slow machines or according to the above configuration, sometimes it is strange to start up, in stderr. the log shows: "can 'tconnect to parent". This problem can be solved by adding a 15-second delay after the service is started:
In lines around/etc/init. d/resin: 43:
If test-n "$ USER"; then
Su-$ USER-c "$ EXE-pid $ PID start $ ARGS"
Else
$ EXE-pid $ PID start $ ARGS
Fi
# Add a 15-second delay after the service is started
Sleep 15

Problem solving process and ideas:

First check the resin log: stderr. log, which contains can't connect toparent, and then query "resin2 can't connect to parent" and "resin can't connect toparent" on google ", there are several Archive email lists. there is technical support in the archive of an email list, saying that the service waiting time is being adjusted to solve similar problems (you need to change the SOURCE ), another person said that when the P4 server is started, it needs to start a lot of CPU-consuming services, which may also cause the RESIN to fail to start. then I tried it on my own machine, log on to the machine before RESIN is started and find that both the RESIN and PERL scripts are running at startup, but after a while, the corresponding process will exit and the system will be stable after it is started, if you start RESIN again, the RESIN service is good. it indicates that the script itself is normal. Based on my previous experience, JAVA applications are a type that consumes CPU resources, to enable the RESIN to start up with enough CPU resources, I added Delay of 15 seconds to prevent subsequent services from affecting RESIN startup. The problem is solved, and the test is successful on other machines.

Of course, it is better to solve this problem with CAUCHO. no one needs to learn these tips. Therefore, I submitted my own solution in all similar BUG reports and asked to add a global variable in the init. resin script to allow users to set the wait time for startup. Add this solution to the document so that you can actively support open-source software with your own actions.

Use Resin's built-in log rotation, HTTP compression, caching, and simple HTTP authentication

As an application server, many functions do not need to be developed by yourself: We recommend that you put the configurations related to the application server in resin. conf, and the standard configuration of the Web application unrelated to the application server is placed in the WEB-INF/web. in xml.




1D


1 M



Filter-name = 'com. caucho. http. filter. gzipfilter'/>




Com. caucho. http. security. XmlAuthenticator






Related Article

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.