Linux Common commands

Source: Internet
Author: User
Tags create directory session id mysql create mysql create database mysql login

Linux: Operating system, common commands on Application server: CD switch command CD/CD~CD../.. /CD XX ll show all the files ll-h friendly Display mkdir create directory mkdir directory name mkdir-P a/b/b/b rmdir Remove directory rmdir directory name: Remove empty directory Touch file name: Create an empty file CP file name directory/file name: Copy mv file name directory/File name : Move MV filename New file name: Rename RM file name: Delete file with ask RM-f file Name: Delete file without asking RM-RF Directory |file: Recursive file without asking tar: packaging|unzip a directory or file tar-CVF file name directory: Packages The specified directory into a specified file tar-ZCVF file name directory: Packages The specified directory and compresses it into a specified file tar-XVF file Name: Extract the specified file to the current directory tar-XVF File name-C Directory: Extract the specified files to the specified directory grep lookup|Pipe PS-ef |grep java netstate-an | Grep3306Kill-9PID: Force the end of a process ifconfig: View current network card information ping: see if the network is unobstructed chmod777filename Chown Change the attribution of the file/////////////////////////////////////////////Task 1: The Linux publishing online shop case1 . Install JDK A. Detect if the JDK is installed to run Java-version B. Uninstall it if necessary C. See Installing those JDK rpm-qa |grep java d. Uninstall first uninstall OpenJDK1.7rpm-E--Nodeps unloaded package rpm-E--nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3. el6.i686 re-unload OpenJDK1.6rpm-E--nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0. el6.i686 E. Install JDK upload jdk via ftp software upload (upload to root directory) in/usr/Local Create a Java directory mkdir java to copy the uploaded JDK to the Java directory CP/root/jdk.xxxxx.tar/usr/local/Java unzip it to tar-xvf Jdk.xxx.tar F. Installing dependent Yum install glibc.i686 g. Configuring environment variables Edit VI/etc/profile Add a message at the end of the file #SetJava Environment Java_home=/usr/local/java/jdk1.7. 0_72 CLASSPATH=.: $JAVA _home/Lib.tools.jar PATH= $JAVA _home/Bin: $PATH export java_home CLASSPATH PATH save exit Source/etc/profile makes the changed configuration effective immediately2 . Install MySQL A. Detect if MySQL rpm is installed-qa |grep MySQL B. Uninstalling the system comes with MySQL rpm-E--Nodeps unloaded package rpm-E--nodeps mysql-libs-5.1. in-1. el6.i686 c. upload MySQL d. in/usr/local/Create a MySQL E. copy mysql to MySQL directory f. Unzip the tar there will be several RPM files G. Installing server-side rpm for MySQL installation-IVH mysql-server-5.5. the-1. linux2.6. i386.rpm Note: The first time you log in to MySQL, you will need to install MySQL client rpm after you do not need a password.-IVH mysql-client-5.5. the-1. linux2.6. i386.rpm H. View MySQL service status services MySQL status start MySQL service mysql start stop MySQL Service MySQL Stop I modify the password of the root of MySQL login: MySQL-uroot Change Password: use MySQL; Update UserSetPassword = password ('1234')whereuser ='Root'; Flush privileges;# Refresh J. Turn on remote access grant all privileges on*. * To'Root'@'%'Identified by'1234';    Flush privileges; K. Opening the firewall port3306exit MySQL 3306 port release/sbin/iptables-i input-p TCP--dport3306-J ACCEPT to add this setting to the firewall's rules/etc/rc.d/init.d/iptables Save L: Set up the MySQL service to start joining the system service as the system starts: Chkconfig--add MySQL autostart: chkconfig mysql on3 . Install Tomcat A. In/usr/local/Create a Tomcat directory B. Copy Tomcat to/usr/local/Tomcat C. Unzip Tomcat D. Start Tomcat into bin mode 1:sh startup.sh Mode 2:./startup.sh E. Turn on the port number80808080 Port release/sbin/iptables-i input-p TCP--dport8080-J ACCEPT to add this setting to the firewall's rules/etc/rc.d/init.d/iptables Save
Note: View the log file tail-F Logs/catalina. outExit Ctrl+C4 . Publish Project A. Database and table backup STORE28 database under Windows mysqldump-uroot-p1234 store28 > g:/1. sql to upload 1.sql to the root directory through Remote Tools to restore the database first login MySQL CREATE database store28 enter STORE28 SOURCE/root/1. SQL B. Project packaging Project The features of the War War package: in Tomcat/WebApps directory As long as the Tomcat boot war will automatically unzip the Store.war to the root directory of the virtual machine to move Store.war to Tomcat/WebApps under the can///////////////////////////////////////////////////////////    /////////////////////////////////////////////////////////// nginx: Nginx is a lightweight web server/reverse proxy server and e-mail (imap/POP3) Proxy Server features: Reverse proxy load balancing static and dynamic separation ...            Reverse proxy: First to understand the forward proxy: Need our users, manually set the proxy server IP and port number reverse proxy: Proxy server, the user does not need to set.    Load balancing: The principle is that data traffic is distributed across multiple servers, reducing the pressure on each server, and multiple servers work together to accomplish tasks, thereby increasing the throughput of the data. Dynamic separation: The static resources are placed in the reverse server, saving the user's access time.///////////////////////////////////////////////////////////build a cluster on the window with Nginx1. Create a new two directory on G-Disk TOMCAT1 tomcat22Modify the port of TOMCAT2 on the port of TOMCAT1 +Ten    3. Unzip the Nginx modified nginx.conf file on Locatioin/The reverse proxy proxy_pass proxy Server is added below this is just a proxy server4. The proxy cluster needs to add a upstream servlet_yujia{server on the HTTP node127.0.0.1:8080; Server127.0.0.1:8090; } Modify Location/the reverse proxy under Proxy_pass http://Servlet_yujia    5. Session sharing Problem Resolution 1: Only under window to work with the Web server (broadcast mechanism) Note: Low performance modification in Tomcat two places: 1. Modify Tomcat's Server.xml support share to the Engine tab under the<cluster classname="Org.apache.catalina.ha.tcp.SimpleTcpCluster"/>Note Remove2. Modify the project's configuration file add a node to Web. Workaround 2: You can put the session ID into Redis solution 3:        Ensure an IP address forever access to a Web server, there is no session sharing problem, in Linux in the Nginx configuration file upstream add Ip_hash; ////////////////////////////////////////////build a cluster on Linux1First, upload Nginx to Linux.2. Unzip the Nginx3. First compile Nginx Install Dependency pack yum install GCC-c++Yum Install-Y Pcre pcre-devel Yum Install-Y zlib zlib-devel Yum Install-Y OpenSSL openssl-The Devel performs the compilation first into the Nginx directory execution./Configure4. Install Nginx to perform make make install5launch nginx CD nginx directory configuration file conf start Nginx./Nginx6. Release the port number 80/sbin/iptables-i input-p TCP--dport the-J ACCEPT to add this setting to the firewall's rules/etc/rc.d/init.d/iptables Save7. Modify the Conf file and configure the cluster as Windows

PWD---View your current directory

Linux Common commands

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.