Linux Learning one: Installing JDK and Tomcat

Source: Internet
Author: User
Tags bz2 first string gpg parent directory posix psql file transfer protocol iptables

Using SECURECRT

First, the installation of CentOS Rzsz,

1.yum Automatic Installation: (yum installation Rzsz)

Yum Install Lrzsz

    

2. The manual installation method is as follows: (the package is a problem, or the first way)

2.1. Download software rzsz-3.48.tar.gz

wget http://freeware.sgi.com/source/rzsz/rzsz-3.48.tar.gz Download.

2.2 Unzip the tar zxvf rzsz-3.48.tar.gz

2.3. Install CD rzsz-3.48

Make POSIX or make Linux

2.4. If the following prompt appears:

-bash:make:command not found.

2.5. The table system does not have the compiler installed, SSH installation:

Yum-y install gcc automake autoconf libtool make

2.6. Execute the make POSIX command again

[[email protected] src] #make POSIX

Cc-o-dposix-dmd=2 Rz.c-o RZ

Geneva size RZ

Text data BSS Dec hex filename

25444 648 10464 36556 8ECC RZ

Rm-f RB Rx RC

-LN RZ RB

-LN RZ RX

-LN RZ RC

Ten Cc-o-dposix sz.c-o sz

One size sz

Text data BSS Dec hex filename

30565 708 43072 74345 12269 sz

RM-F SB SX Zcommand Zcommandi

-LN SZ SB

-LN SZ SX

-Ln sz Zcommand

ln sz Zcommandi

[[Email protected] src]#

3. In order to facilitate the use of this tool, copy the relevant files to the directory/usr/bin below, only need to copy 2 files RZ and SZ

CP RZ Sz/usr/bin

"Note:" I was following the automatic installation, the first method.

Second, use the RZ command to upload files

The file transfer protocols under SECURECR are ASCII, Xmodem, Ymodem, Zmodem



ASCII: This is the fastest transport protocol, but only text files can be transferred.



Xmodem: This ancient transmission protocol is slow, but due to the use of CRC error detection method, the transmission accuracy rate can be as high as 99.6%.



Ymodem: This is an improved version of Xmodem, which uses 1024-bit segments to deliver faster than Xmodem.



Zmodem:zmodem adopts the stream-flow (streaming) transmission mode, the transmission speed is fast, but also has the function of automatically changing the section size and the breakpoint continuation transmission, the fast error detection and so on. This is currently the most popular file Transfer protocol



Set default upload Download directory

Options->session Options->terminal->xmodem/zmodem

Set upload and download directories on the right



Using Zmodem to upload files from a client to a Linux server

1. Log in to the Linux terminal with SECURECRT.

2. Select the path where you want to place the uploaded file, in the directory and then enter the RZ command, SECURECRT will pop up the file selection dialog box, find the file you want to upload in the search scope, press the Add button. Then OK can upload the file to Linux.

Or, in the Transfer->zmodem upoad list pop-up File selection dialog box, select the file and press the Add button. Then the OK window closes automatically. Then under Linux, select the directory where the files are stored and enter the RZ command. Liunx the file to the directory.

To download files to the client using Zmodem:

SZ filename

Zmodem receive can start on its own. The downloaded file is stored in the default download directory you set.



If the RZ, sz command is not valid, please install RZSZ-0.12.20-853.2.I586.RPM first

The specific installation method is:

RPM-IVH rzsz-0.12.20-853.2.i586.rpm

Common commands:
First, LS only lists the file name (equivalent to Dir,dir can also be used)
-A: Lists all files, including hidden files.
-L: List form, which contains most of the properties of the file.
-R: Recursive display.
--help: Help for this command.
Second, CD change directory
CD/: Go to the root directory
CD: Go back to your directory (different directories are different, root is/root,xxt for/home/xxt
Cd.. : Back to Parent directory
PWD: Displays the directory where you are currently
Three. Less file name: View the contents of the file.
Four. Q exit the Open file.
Five. Upload file: RZ Select the file to be transferred, OK.
Six. download file: Sz Specify the file name, enter to hit, that is downloaded to the Securecrt/download directory.
Seven: Delete file: RM Delete file, rmdir delete empty directory.

Eight. Show the last 20 commands entered: History 20

Nine. Get help command--help View command under detailed parameters: such as: RZ--help, Sz--help.


10. The CD Entry command to a folder:
mkdir+ folder name command to create a folder
sz+ file name from server-side send files to native command
RZ commands to transfer files from the local to the server side
ll lists all files in the current directory, including details for each file
Dir to the current folder
VI Open the current file
11. When editing a file:
A switch to edit mode
CTRL + C Exit Edit mode
DD Delete entire row
: Q Exits the current file
: W writes and saves the current file
-F Force XX parameters ...

Other commands:
1.PS-EF//View the server process as a list of the server processes that are displayed.
PS shows the process currently running on the system/usr/bin/ps [options]-e display each now running process-F to generate a full list

Actual operation:
--------------------------------------
1 SSH client connects to 10.5.1.55 system (see Starting remote client Instructions Securecrt.doc)
$ cd/home/bea2/user_projects/csdomain/bin
2 Viewing the WEBLOGIC92 service process
$ ps-eaf | grep WebLogic
BEA2 327926 331940 0 13:08:45 pts/4 0:00 grep weblogic
WebAdmin 421908 368956 0 Sep 24-4:13/usr/java5_64/bin/java-xms256m-xmx512m-da-dplatform.home=/home/weblogi c/bea/weblogic92-dwls.home=/home/weblogic/bea/weblogic92/server-dwli.home=/home/weblogic/bea/weblogic92/ Integration-dweblogic.management.discover=true-dwlw.iterativedev=false-dwlw.testconsole=false- Dwlw.logerrorstoconsole=-dweblogic.ext.dirs=/home/weblogic/bea/patch_weblogic923/profiles/default/sysext_ manifest_classpath-dweblogic.name=adminserver-djava.security.policy=/home/weblogic/bea/weblogic92/server/lib/ Weblogic.policy WebLogic. Server
BEA2 491796 385044 00:12:50 PTS/6 182:55/usr/java5_64/bin/java-xms6g-xmx8g-javaagent:/home/bea2/user_projects/ csdomain/introscope/wily/agent.jar-dcom.wily.introscope.agentprofile=/home/bea2/user_projects/csdomain/ introscope/wily/introscopeagent.profile-dcom.wily.introscope.agent.agentname=adminserver-da-dplatform.home=/ home/weblogic/bea/weblogic92-dwls.home=/home/weblogic/bea/weblogic92/server-dwli.home=/home/weblogic/bea/ weblogic92/integration-dweblogic.management.discover=true-dwlw.iterativedev=-Dwlw.testConsole=- Dwlw.logerrorstoconsole=-dfile.encoding=gbk-dibm.stream.nio=true-dweblogic.ext.dirs=/home/weblogic/bea/patch_ weblogic923/profiles/default/sysext_manifest_classpath-dweblogic.name=adminserver-djava.security.policy=/home/ Weblogic/bea/weblogic92/server/lib/weblogic.policy WebLogic. Server
Note: According to the above prompts to see the login user bea2 Start process, note the Red BEA2 for the process has, 491796 for the process number
3 Execute the following command to kill the process
$ kill-9 491796 (based on 2 operation to find the system process number)
Description: Execute $ ps-eaf after execution | The grep weblogic command will not see the process number of the WebLogic process
4 Starting the Service
$./quickrun.sh

-------------------------------------------------------------------
2.ant-buildfile cms_maintrunk.xml//build Bag
3.VI test.txt//Browse file contents
I {insert write input}
ESC exits Insert
: wq! Write save and Exit VI mode
: q! Do not save Exit VI mode
4. I am generally accustomed to using the PS–EF command to see the server process as a list, and to see the process of the server with the command Pstree so that the server process is displayed as a tree.
The advantage of the Pstree command is that the parent process of a process can be identified immediately. You may need to use the-P option to display the PID for each process, and the-u option to display the user name that started the process.
In general, this tree structure is longer, and you need to do so Pstree–up | Less this will give you an overview of the entire process tree structure.
5.secureCRT garbled Solution: Options->sessionoptions->appearance->font to change the default to UTF-8, you can display the Chinese font.

6.hostname: Check hostname
7.ifconfig Query Host IP
8. Use CTRL + C and CTRL + V under S-CRT:
Options---Global options---Edit default settings go inside and point terminal---emulation then point mapped Keys, point lower part, use Windows copy and Paste key, click Confirm.



1. Enter the SQL runtime environment.
[Email protected] bin]$/psql-n dbname-u usrname
stay81=# Select COUNT (*) from table1;
Count
-------
5986
(1 row)
9. Command to enter VI:
VI FileName: Opens or creates a new file and places the cursor at the beginning of the first
VI +n FileName: Opens the file and places the cursor at the beginning of nth
VI + FileName: Opens the file and places the cursor at the beginning of the last line
VI +/pattern FileName: Opens the file and places the cursor at the first string that matches the pattern
10. Move the Cursor Class command:
}: Move the cursor to the beginning of the paragraph
{: Cursor moves to end of paragraph
NG: Cursor moves to the beginning of nth
n+: The cursor moves down n rows
N: Move the cursor up n rows
n$: Cursor moves to end of Nth line
H: Move the cursor to the top row of the screen
M: Move the cursor to the middle line of the screen
L: The cursor moves to the last line of the screen
0: (note is the number 0) cursor moves to the beginning of the current line
$: Cursor moves to the end of the current line
11. Screen Tumbling Class command:
Ctrl+u: First half screen to file
Ctrl+d: Half-screen to the end of the file
Ctrl+f: Turn a screen at the end of the file//as if R
ctrl+b; Turn one screen to the top of the file

12. Search command:
/pattern: Searches for pattern at the end of the file from the beginning of the cursor
? pattern: Searches for pattern from the beginning of the cursor to the top of the file
N: Repeat the last search command in the same direction
N: Repeats the last search command in the opposite direction

Postgres using:
2. Exit, exit after use, or the connection has been suspended.
stay81=# \q
3.postgres data export.
[Email protected] bin]$/pg_dump-u postgres-t testtable-d testDB > Testtable.dump
or [[email protected] bin]$./pg_dump-u postgres-d testdb-t testtable-f c-v > Testtable.dump
4. Postgres data import.
[Email protected] bin]$/psql-u postgres-d TestDB < Testtable.dump
or [[email protected] bin]$./pg_restore-u postgres-d TestDB < Testtable.dump
5. On one host, dump the database directory on another host.
Pg_dump-h host1-p 5432 dbname | Psql-h host2-p Post1 dbname
Or./pg_dump-u postgres-d testdb1-t testtable |./psql-u postgres-d TESTDB2
-U is the user name,-D is the DB name, and-T is the table name, which is not required if the entire database is exported.
6.php execution.
[Email protected] bin]$/usr/bin/php-q./batchstart.php


Actual operation:
/home/absys6$ ls
DVLP dvlp_bak20090413 Personal tmp
/home/absys6$ CD DVLP
/home/absys6/dvlp$ ls
/home/absys6/dvlp$ CD Sv_policy
/home/absys6/dvlp/sv_policy$ ls
Include SRC
/home/absys6/dvlp/sv_policy$ CD src
/home/absys6/dvlp/sv_policy/src$ ls
/home/absys6/dvlp/sv_policy/src$ ls *pc//filtering the file
/home/absys6/dvlp/sv_policy/src$ grep VIP *PC//Lists part of the code that contains all the. pc files for the VIP.
/home/absys6/dvlp/sv_policy/src$ VI plyprmcnt.pc//view entire file

Third, install the TAR package

1. Copy the installation files to your directory, and if you are logged in as root, copy the software to/root.
#cp Xxx.tar.gz/root
2, decompression.
#tar Xvzf xxx.tar.gz
or simply double-click Unzip.
3, check the compilation.
#./configure
4. After checking, the makefile file will be generated for compiling. At this point, you can start compiling.
#make.
5, after the successful compilation, start the installation.
#make Install
6. After installation, the files generated during the process of compiling the temporary files and configuration should be cleared.
#make Clean
#make Distclean
This completes the installation.
If you want to uninstall, execute make Uninstall


Packaging and compressing files
BUNZIP2 file1.bz2 Extract a file called ' file1.bz2 '
bzip2 file1 compress a file called ' File1 '
Gunzip file1.gz Extract a file called ' file1.gz '
gzip File1 compress a file called ' File1 '
gzip-9 file1 Maximum Compression
RAR a File1.rar test_file create a package called ' File1.rar '
RAR a file1.rar file1 file2 dir1 simultaneously compresses ' file1 ', ' file2 ' and directory ' Dir1 '
rar x File1.rar decompression rar Package
Unrar x File1.rar decompression rar Package
TAR-CVF Archive.tar File1 Create a non-compressed tarball
TAR-CVF Archive.tar file1 file2 dir1 Create a file containing ' file1 ', ' file2 ' and ' Dir1 '
TAR-TF Archive.tar Display the contents of a package
TAR-XVF Archive.tar Release a package
TAR-XVF ARCHIVE.TAR-C/TMP releases the compressed package into the/tmp directory
TAR-CVFJ archive.tar.bz2 Dir1 Create a compressed package in BZIP2 format
TAR-XVFJ archive.tar.bz2 extract a compressed package in BZIP2 format
TAR-CVFZ archive.tar.gz Dir1 Create a zipped package in gzip format
TAR-XVFZ archive.tar.gz Unzip a compressed package in gzip format
Zip file1.zip file1 Create a zip-format compression Package
Zip-r file1.zip file1 file2 Dir1 compresses several files and directories into a zip-format package at the same time
Unzip File1.zip unzip a zip-format tarball


RPM Packages-(Fedora, Redhat and similar systems)
RPM-IVH package.rpm Installing an RPM package
RPM-IVH--nodeeps package.rpm Install an RPM package and ignore dependency warnings
Rpm-u package.rpm Update a RPM package without changing its configuration file
Rpm-f package.rpm update one to determine which RPM package is installed
Rpm-e package_name.rpm Delete an RPM package
RPM-QA display all installed RPM packages in the system
Rpm-qa | grep httpd shows all RPM packages with the words "httpd" in their names
Rpm-qi Package_name get special information for an installed package
RPM-QG "System environment/daemons" shows the RPM package for a component
RPM-QL Package_name displays a list of files provided by an already installed RPM package
RPM-QC Package_name Displays a list of configuration files provided by an already installed RPM package
Rpm-q package_name--whatrequires shows a list of dependencies that exist with a RPM package
Rpm-q package_name--whatprovides shows the volume of a RPM package
Rpm-q package_name--scripts Show scripts executed during installation/removal L
Rpm-q package_name--changelog shows the revision history of a RPM package
rpm-qf/etc/httpd/conf/httpd.conf confirm which RPM package is provided for the given file
RPM-QP package.rpm-l displays a list of files provided by a RPM package that has not been installed
RPM--import/media/cdrom/rpm-gpg-key Import Public key digital certificate
RPM--checksig package.rpm confirming the integrity of a RPM package
RPM-QA Gpg-pubkey confirm the integrity of all RPM packages that have been installed
Rpm-v package_name Check file size, license, type, owner, group, MD5 check, and last modified time
Rpm-va Check all installed RPM packages in the system-use with care
RPM-VP package.rpm confirm that an RPM package is not installed
Rpm2cpio package.rpm | Cpio--extract--make-directories *bin* Run executable from an RPM package
rpm-ivh/usr/src/redhat/rpms/' arch '/package.rpm install a built-in package from a RPM source
Rpmbuild--rebuild package_name.src.rpm Build a RPM package from one RPM source

Appendix: Configuring Environment Variables for JDK:

Three ways to configure environment variables

  

After the JDK is installed, go to the JDK Bin directory and execute "./java" to see if the environment variable is configured, you can enter "Java/javac" in any directory.

In the same vein, starting Tomcat is also going into the bin directory of Tomcat, executing "./startup.sh", which starts Tomcat

1. Modify the/etc/profile file

This approach is recommended if your computer is used only as a development, because all user shells have the right to use these environment variables, which can pose a security issue for the system.

• Open/etc/profile with a text editor

Vi/etc/profile

(click "I" to edit, press ESC, then ":" Colon, press "q!" : Do not save, press "Wq": Save. Press the ENTER key to confirm)
• At the end of the profile file, add:

Java_home=/usr/java/jdk1.7.0_75
Path= $JAVA _home/bin: $PATH
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export Java_home
Export PATH
Export CLASSPATH

Save: Source/etc/profile

Then, enter the command: Java, Javac will be able to

• No need to log in again
• annotations
A. You want to change/USR/SHARE/JDK1.5.0_05JDK to your JDK installation directory
B. Use the colon ":" to separate the paths under Linux
C. $PATH/$CLASSPATH/$JAVA _home is the value used to refer to the original environment variable
When setting environment variables, be careful not to overwrite the original value, which is a
A common error.
D. Current directory in Classpath "." It is a common mistake to throw away the current directory.
E. Export is exporting these three variables as global variables.
F. The case must be strictly differentiated.

2. Modify the. bashrc file
    
This method is more secure, it can control the use of these environment variable permissions to the user level, if you need to give a user permissions to use these environment variables, you only need to modify their personal user home directory of the. bashrc file on it.

• Open the. bashrc file in the user directory with a text editor
• At the end of the. bashrc file, add:
      
Set java_home=/usr/share/jdk1.5.0_05
Export Java_home
Set path= $JAVA _home/bin: $PATH
Export PATH
Set classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export CLASSPATH

• Re-login

3. Set variables directly under the shell

Do not support the use of this method, because the shell, your settings are invalid, so this method is only temporary use, and later to use the time to reset, more trouble.

Simply execute the following command at the shell Terminal:

Export java_home=/usr/share/jdk1.5.0_05
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Iv. Linux System Open the system firewall port:

Linux System Open firewall port

Test environment Redhat 5.4, open 3306 and 8080 ports

Modify the Iptables file under/etc/sysconfig:

# Firewall configuration written by System-config-securitylevel
# Manual Customization of this file are not recommended.
*filter
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [0:0]
: Rh-firewall-1-input-[0:0]
-A input-j Rh-firewall-1-input
-A forward-j Rh-firewall-1-input
-A rh-firewall-1-input-i lo-j ACCEPT
-A rh-firewall-1-input-p ICMP--icmp-type any-j ACCEPT
-A rh-firewall-1-input-p 50-j ACCEPT
-A rh-firewall-1-input-p 51-j ACCEPT
-A rh-firewall-1-input-p UDP--dport 5353-d 224.0.0.251-j ACCEPT
-A rh-firewall-1-input-p udp-m UDP--dport 631-j ACCEPT
-A rh-firewall-1-input-p tcp-m tcp--dport 631-j ACCEPT
-A rh-firewall-1-input-m state--state established,related-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 21-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 80-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 443-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 8080-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT
-A rh-firewall-1-input-j REJECT--reject-with icmp-host-prohibited
COMMIT

Restart Iptables

[Email protected]/]#/sbin/service iptables restart

Linux Learning one: Installing JDK and Tomcat

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.