Linux environment Deployment (i)

Source: Internet
Author: User
Tags memcached

Recently, the boss has arranged a task to solve the installation problem of Linux, make the following notes so that the next installation configuration:


--------------------deployment project on Linux-------------------

1. Unzip the appropriate software

Gunzip xxx.gz//Decompression file.gz

TAR-XZVF file.tar.gz//Decompression file.tar.gz

Package all files in the/etc directory into/tmp/etc.tar

[[email protected] ~]# TAR-CVF/TMP/ETC.TAR/ETC <== package only, do not compress!

[[email protected] ~]# tar-zcvf/tmp/etc.tar.gz/etc <== packaged, compressed with gzip

[[email protected] ~]# tar-jcvf/tmp/etc.tar.bz2/etc <== packaged, bzip2 compressed

Copy to the appropriate directory

CP Xxx.txt/home/wzl/desktop

2. Installing the JDK

Rpm-qa | grep Java//view locally installed JDK

Rpm-e--nodeps java_1.8_121 ... Remove the appropriate JDK

If this appears permission denies permissions problem, enter Su, and then enter the root account password, with root operation can be

Vi/etc/profile//Press I to enter the edit page, copy the address as below, and change it to the address of your JDK.

Export java_home=/home/wzl/documents/jdk1.8.0_121

Export path= $JAVA _home/bin: $PATH

Export JRE_HOME=/HOME/WZL/DOCUMENTS/JDK1.8.0_121/JRE

Export classpath= $JAVA _home/jre/lib/ext: $JAVA _home/lib/tools.jar

Export PATH java_home CLASSPATH jre_home

Press ESC to exit the edit state: Wq exit the edit page

Source/etc/profile//Let the edited content take effect

Java-version//View Java version

3. Install Tomcat

In the catalina.sh of the bin directory of the Tomcat directory, the modifications are added as follows:

Export java_home=/home/wzl/documents/jdk1.8.0_121
Export classpath=.: $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/lib
Export path= $PATH: $JAVA _home/bin: $JAVA _home/jre/bin

/home/wzl/desktop/apache-tomcat-7.0.75/bin/startup.sh//Start Tomcat

/home/wzl/desktop/apache-tomcat-7.0.75/bin/shutdown.sh//Turn Tomcat off, but there is a tomcat started on when it is turned off, it is not displayed and is displayed as follows:

[Email protected] desktop]$/home/wzl/desktop/apache-tomcat-7.0.75/bin/startup.sh
Using catalina_base:/home/wzl/desktop/apache-tomcat-7.0.75
Using Catalina_home:/home/wzl/desktop/apache-tomcat-7.0.75
Using Catalina_tmpdir:/home/wzl/desktop/apache-tomcat-7.0.75/temp
Using Jre_home:/home/wzl/documents/jdk1.8.0_121/jre
Using CLASSPATH:/home/wzl/desktop/apache-tomcat-7.0.75/bin/bootstrap.jar:/home/wzl/desktop/apache-tomcat-7.0.75 /bin/tomcat-juli.jar
Tomcat started.
[Email protected] desktop]$/home/wzl/desktop/apache-tomcat-7.0.75/bin/shutdown.sh
Using catalina_base:/home/wzl/desktop/apache-tomcat-7.0.75
Using Catalina_home:/home/wzl/desktop/apache-tomcat-7.0.75
Using Catalina_tmpdir:/home/wzl/desktop/apache-tomcat-7.0.75/temp
Using Jre_home:/home/wzl/documents/jdk1.8.0_121/jre
Using CLASSPATH:/home/wzl/desktop/apache-tomcat-7.0.75/bin/bootstrap.jar:/home/wzl/desktop/apache-tomcat-7.0.75 /bin/tomcat-juli.jar
[Email protected] desktop]$

A permissions issue was encountered during execution and could not be performed on this file, and would be modified using the chmod command

chmod u+x hello.sh indicates that the user has been added to the file to perform the operation,
U user R Read Only
G Groud same group user W write only
o Others other user x execution
A All Users

Gates himself said in this period: "For me, work with a bunch of smart engineers, develop products, and then you go out and see people actually using them, and that's a lot more fun." ”

4. Installing memcached

Refer to the Novice tutorial: http://www.runoob.com/memcached/memcached-install.html

Install memcached to install Libevent First, and then you need to specify the Libevent installation path in the installation

Install Libevent First:

TAR-ZXVF libevent-2.0.22-stable.tar.gz-c/home/soft//Unzip and copy to/home/soft path

CD/USR//Enter/usr path, general installation software is installed in this folder

mkdir libevent//Create Libevent folder for installing Libevent

cd/home/soft/libevent-2.0.22//Enter Libevent directory

./configure-prefix=/usr/libevent//install libevent on/usr/libevent

make//Compile Libevent

Make install//install Libevent

Ls-al/usr/lib | grep libevent//test libevent is installed successfully, the following is the installation success

lrwxrwxrwx 1 root root 21 11?? 17:38 Libevent-1.2.so.1-libevent-1.2.so.1.0.3
-rwxr-xr-x 1 root root 263546 11?? 17:38 libevent-1.2.so.1.0.3
-rw-r–r–1 root root 454156 11?? 17:38 LIBEVENT.A
-rwxr-xr-x 1 root root 811 11?? 17:38 libevent.la
lrwxrwxrwx 1 root root 21 11?? 17:38 libevent.so-libevent-1.2.so.1.0.3

Install memcached:

TAR-ZXVF memcached-1.2.0.tar.gz-c/home/soft//Unzip and copy to/home/soft path

CD memcached-1.2.0.tar.gz

./configure-with-libevent=/usr/libevent

Make

Make install

ls-al/usr/local/bin/mem*//test whether the installation was successful

/usr/local/bin/memcached-d-M 10-u root-l 192.168.141.64-p 11211-c 256-p/tmp/memcached.pid//Start the memcached service, the parameters mean the following:

The-D option is to start a daemon,
-M is the amount of memory allocated to Memcache, in megabytes, I'm 10MB,
-U is the user running memcache, I am root here,
-L is the server IP address of the listener, if there are more than one address, I specify the server IP address 192.168.0.200, (if it is inside and outside the network to connect the intranet),
-P is the port that sets Memcache listening, I set here 11211, preferably more than 1024 ports,
The-c option is the maximum number of concurrent connections to run, the default is 1024, I set the 256 here, according to the load of your server to set,
-P is set to save memcache PID file, I am here to save in/tmp/memcached.pid

Load the memcached service into the Linux startup item. In case the machine is powered down, the system restarts. Then memcached will start automatically.

If the server-side command to start Memcache is:
/usr/local/bin/memcached-d-M 10-u root-l 192.168.141.64-p 11211-c 256-p/tmp/memcached.pid
If you want to start the boot automatically, just add a line in the/etc/rc.d/rc.local, the following command
/usr/local/memcached/bin/memcached-d-M 10-p 11211-u apache-c 256

NETSTAT–APN | grep 8080//View the segment number 8080 occupancy, you can also use this method to test memcached, MongoDB boot situation


5. Installing MongoDB

Refer to the Novice tutorial: http://www.runoob.com/mongodb/mongodb-linux-install.html

Unzip, move to the installation path

Create a three folder
mkdir/home/mongodb/
Mkdir/home/mongodb/data
Mkdir/home/mongodb/logs

Add path path in/etc/profile file
Export Path=/usr/local/mongodb3.0.6/bin: $PATH
Export PATH

Cd/usr/local/mongodb3.0.6/bin//cd to Bin path start execution start statement

./mongod--dbpath=/home/mongodb/data--logpath=/home/mongodb/logs/mongodb.log//Reception start

./mongod--dbpath=/home/mongodb/data--logpath=/home/mongodb/logs/mongodb.log--logappend--port=27017--fork//Background start

。 /mongod--dbpath=/home/mongodb/data--logpath=/home/mongodb/logs/mongodb.log--logappend--auth--port=27017--fork/ /Start with permission mode

Linux environment Deployment (i)

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.