Common linux Installation

Source: Internet
Author: User
Jdk1.5 Installation
1. Download jdk-1_5_0_16-linux-i586.rpm
# Rpm-ivh jdk-1_5_0_16-linux-i586.rpm
Set Environment Variables
# Vi/etc/profile
# Set java environment
JAVA_HOME =/usr/java/jdk1.5.0 _ 16
Export JAVA_HOME
CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/li B/
Export CLASSPATH
PATH = $ JAVA_HOME/bin: $ PATH
Export PATH
To enable JDK to be used by all users, you can:
Vi/etc/profile. d/java. sh
Enter the following content in the new java. sh file:
# Set java environment
JAVA_HOME =/usr/java/jdk1.5.0 _ 16
CLASSPATH =.: $ JAVA_HOME/lib/tools. jar
PATH = $ JAVA_HOME/bin: $ PATH
Export JAVA_HOME CLASSPATH PATH
Save and exit, and then assign the permission to java. sh: chmod 755/etc/profile. d/java. sh
Modified to make the profile take effect
# Source/etc/profile
3. Use the echo command on the terminal to check the environment variable settings.
# Echo $ JAVA_HOME
# Echo $ CLASSPATH
# Echo $ PATH
4. Check whether JDK is successfully installed.
# Java-version
If you see the JVM version and related information, the installation is successful!
Run the rpm-q httpd command to check which packages are installed in apache.
Rpm-qa query installed RPM packages
Install apache2.0.63
Tar vxf httpd-2.0.63.tar.bz2
# Cd httpd-2.0.63
#./Configure-enable-so-enable-rewrite-enable-deflate-enable-headers-with-mpm = worker
./Configure-enable-so-enable-rewrite-with-mpm = worker
# Make
# Make install
The installation directory is in/usr/local/apache2/
Run make distclean before re-compilation.
Install resin2.1.17
The installation directory is in/usr/resin-2.1.17/
# Tar vxf resin-2.1.17.tar.gz-C/usr/
# Cd/usr/resin-2.1.17/
Sometimes # CFLAGS = "-O3-fPIC"./configure -- with-apache =/usr/local/apache2
#./Configure -- with-apache =/usr/local/apache2
# Make
# Make install
Automatic Configuration of modules
Chcon-t textrel_shlib_t '/usr/resin-2.1.17/libexec/libresin. so'
# Vi bin/start. sh
If you want the resin to run automatically at system startup, you should add a start. sh to the resin. The content is as follows:
#--------------------------------------
If [-e/usr/resin-2.1.17/httpd. pid]; then
Kill-9 'cat/usr/resin-2.1.17/httpd. Pi'
Fi
JAVA_HOME =/usr/java/jdk1.5.0 _ 16
Export JAVA_HOME
CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/li B/
Export CLASSPATH
PATH = $ JAVA_HOME/bin: $ PATH
Export PATH
/Usr/resin-2.1.17/bin/httpd. sh restart &
#--------------------------------------
Modify permissions
# Chmod 755 bin/start. sh
# Vi/etc/rc. local
The file can be placed in the bin directory of the resin installation directory. The reason for starting with start. sh is that resin cannot obtain the system environment variable JAVA_HOME or CLASSPATH at system startup.
Then, add the following code in/etc/rc. local and you will be OK:
/Usr/resin-2.1.17/bin/start. sh
/Bin/sleep 5
/Usr/local/apache2/bin/apachectl start
Ln-s/usr/local/apache2/bin/apachectl/usr/sbin/apachectl
Ln-s a.txt c.txt (execute the command to generate a soft link file named a.txt)
Run in the background. Add &
/Usr/local/apache2/bin/apachectl restart
/Usr/resin-2.1.17/bin/start. sh &
Tar-cvf home.155.com.tar ROOT/-- exclude = ROOT/user -- exclude = ROOT/temp
Apache Testing Tool
(SUM indicates the total number of requests, and CUR indicates the number of concurrent requests)
AB-n SUM-c CUR http: // 127.0.0.1: 80/test. jsp
AB-n 1000-c 100 http: // 127.0.0.1: 80/test. jsp
AB-n 10-c 10-w http://home.155.com: 80/home. jsp? Pid = 1, 10039
AB-n 1000-c 1000-w http://home.155.com: 80/test. jsp
AB-n 1000-c 1000-w http://home.155.com: 80/test.html
AB-n 100-c 100-w http://home.155.com: 80/myblog. jsp? Pid = 1, 10039
Query the number of processes
Ps-A | grep http | wc-l
Ps-A | grep java | wc-l
Netstat-apunt | wc-l
How many links are there?
Common vi commands
Jump to row 100 # 100gg
Undo # u
View the folder size
Du-sh
SecureCRT File Transfer
First, set the path for saving SecureCRT upload and download files
Options-> session-> Xmodem/Zmodem-> upload/download-> OK
Linux redhat
1. upload files from linux to PC
Shell> sz/etc/rc. local
Example:
[Root @ test root] # sz/etc/rc. local
Rz
Starting zmodem transfer. Press Ctrl + C to cancel.
Transferring rc. local...
100% 464 bytes 464 bytes/s 00:00:01 0 Errors
2. upload files from a PC to linux
Shell> rz
Select the file to be transferred and click OK.
3. sftp
Securecrt press ALT + P to start a new session for ftp operations.
View open ports
Nmap-sS-O 121.11.150.22
Modify the firewall configuration file:
Vi/etc/sysconfig/iptables
Add the following line:
-A RH-Firewall-1-INPUT-m state-state NEW-m tcp-p tcp-dport 3306-j ACCEPT
If you want to activate ports such as 21, you only need to replace 3306 with the ports to be opened, such as 21.
After configuration, restart iptable
Service iptables restart
Then you can access Mysql from the Internet.
View started programs

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.