Problems encountered during project deployment in Linux

Source: Internet
Author: User
Problems encountered during project deployment in Linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. 1. When a project is configured with a domain name, you must change the tomcat port to 80. Note that when you replace the configuration file, remember to change the tomcat port.

2. the hosts file in disk C is used to configure the domain name. If the domain name is not configured in hosts, the windows system will go to the Internet to find the correct domain name. When the domain name is configured in hosts, it won't go to the Internet.

3. file update process:
(1): remotely connect to server 11 or server 12.
(2): log on to ftp and replace the file to be replaced.
(3): Use SSH to connect to the internet server and execute a shell script, mis_updata.sh

The whole process of executing this shell script:
[1]: judge whether the publisher is a root user. If it is not a root user, su to the root user.
[2]: Get the system time and stop the tomcat service. Sometimes the Connection refused error is reported because tomcat is not started but the shell script is executed, the error is reported because tomcat is disabled first.
[3]: Move the original mainone project and add the system time after the project. Note the path problem here. The copied project is placed in the/app/java_project/mis/updata directory.
[4]: Move the backed up project to the path of the original project (/app/java_project/mis/mainone), and change the name to the name of the original project, pay attention to path issues. (When writing shell scripts by yourself)
[5]: Enable the tomcat service, copy the modified project to the updata directory, and rename it mis_beifen. This step is actually a project backup.
[6]: Change the permission of the backup project to 777.
[7]: exit the root user.

4. When configuring the global data source, add ROOT under the app/java_project/tomcat5.0/conf/Catalina/www.dayumi11.com directory. xml. Note: The configuration file must contain the global data source configuration.

The/www.dayumi11.com directory is automatically generated after tomcat is started. You do not need to create it manually. However, an error is reported when this directory is generated, because the ROOT. xml file needs to be added to configure the global data source.

5. project running Directory:/app/java_project/mis/mainone
Project Backup Directory:/app/java_project/mis/updata/mis_beifen

6. shell script directory:/home/mis/updata

7. regularly clear the catalina. out file: the system automatically runs the clear_logs.sh script in/home/mis/clear_logs. Otherwise, the catalina. out file will gradually become larger and eat memory!

8. Note: After you have updated the project, mainone and mis_beifen are identical. When you want to update the project again, the three files are actually identical, mainone, mis_beifen, and mainone_back2007_10_10_10_46_17

9. Steps for updating shell scripts:
(1) Stop tomcat first.

(2) Move the currently running project (mainone) to/app/java_project/mis/updata for backup, and add the system time (mainone_2007_10_10_14_38 ).

(3) Move the modified project (mis_beifen) to/app/java_project/mis and rename it mainone.

(4) Enable tomcat.

(5) run the mainone and cp-R projects to the/app/java_project/mis/updata/directory and rename them as mis_beifen.

(6) change the mis_beifen permission to a maximum of 777.

10. mis_updata.sh is updated in the backup (mis_beifen). Restart tomcat. Jsp_updata.sh is updated in the running project (mainone). You do not need to restart tomcat.

11. Process: ps-aux | grep mysql can view the process
Ps-9 (Force kill process)

12. Problem: mounting a windows disk under a virtual machine is not very good, because the virtual machine is equivalent to a new machine, not a dual system, but a dual system, you can directly mount it, you can also set the windows drive letter to be automatically mounted when the linux system is started.

13. Start tomcat to load ROOT. xml: As the author said: the first time tomcat is started, server is loaded. xml, in the server. find the project path in xml, and then automatically generate a ROOT under the localhost directory. xml file, which also saves the project path information. When you start tomcat for the second time, you will find that tomcat will automatically load ROOT. xml without loading the server. xml file, because the ROOT. xml file also contains the project path.

14. In Linux, crontab is a service for backing up a file in Linux. It can be automatically backed up, but you have to configure it and google it !! Example: crontab-u root/app/java_project/dayumi/oa.txt sets a user's crontab service for a file.

15. Summary of this issue:
(1) first, there is a problem with tomcat configuration. For jdk1.5 and above, you only need to configure JAVA_HOME without configuring Catalina_home.

(2) When configuring the global data source, you must add ROOT. xml.

(3) In the tomcat configuration file server. xml, configure the domain name, the target path of the add-on, the database connection pool, and the data source. Note: It is unclear how to load the server when tomcat is started. xml file. Normally, the web is loaded when tomcat is started. xml file, and other files to be loaded should be in the web. xml configuration, such as sturts-config.xml. It may also be that server. xml is automatically loaded when tomcat is started. Find the project path and load the project according to the configuration of server. xml.

(4) Chen Lei gave me compiled files, only jsp, js, css, And. class files, and no java files.

(5) under normal circumstances: Put the compiled. class file under the webapp directory, and The. class file will be loaded only when tomcat is started. This is a project that complies with J2EE standards. (See the old Li Jian directory. the class file is stored in the webapp directory. It may be because the tomcat data source is configured. the target path of the add-on is configured in the xml file.

16. After tomcat is started, do not rush to access it in a browser after the project is fully loaded.

17. Yesterday's problem:
(1) The JAVA_HOME configuration is incorrect.
(2) The ROOT. XML file is not added when the global data source is configured.
(3) If tomcat is not fully started, access is made.
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.