CentOS Installation memcache and Telnet

Source: Internet
Author: User
Tags imagemagick install openssl nameserver ssl connection telnet program

################### #linux下安装memcache过程 ######################
Http://www.cnblogs.com/zgx/archive/2011/08/10/2134097.html
Install the Memcahe process under Linux:
1. Download the Memcache file:
Memcache Official website: http://memcached.org/downloads
wget http://memcached.org/files/memcached-1.4.22.tar.gz
If the following exception occurs:
--2015-02-11 17:32:25--http://memcached.org/files/memcached-1.4.22.tar.gz
Resolving memcached.org Failed:no address associated with hostname.
Wget:unable to resolve host address "memcached.org"
The
Wget: Unable to resolve host address. This can be seen as a problem with DNS resolution.
Workaround:

Log in to root (VPS).
Enter the/etc/resolv.conf.
For example, the contents are as follows:
NameServer 192.168.10.1
A set of resolution servers to OpenDNS can:
NameServer 8.8.8.8 #google域名服务器
NameServer 8.8.4.4 #google域名服务器

Download libevent:
Because Memcache relies on the libevent package, download the libevent:
Libevent Official website: http://libevent.org/
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
If the following exception occurs:
OPENSSL:ERROR:14077410:SSL Routines:SSL23_GET_SERVER_HELLO:sslv3 Alert Handshake failure
Unable to establish SSL connection.
Here's how to solve the problem:
Method One, you can install OpenSSL to the server
Method Two, you can manually download https://cloud.github.com/downloads/libevent/libevent/libevent-1.4.14b-stable.tar.gz to this machine, and then upload to the server/ In the TMP directory
Method three, with Curl Download: Curl-o-L http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz

2. Install Libevent First:
# tar ZXVF libevent-1.2.tar.gz
# CD libevent-1.2
#./CONFIGURE-PREFIX=/USR
# make
# make Install

3. Test whether the Libevent is installed successfully:
# Ls-al/usr/lib | grep libevent
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
Good, all installed.

4. Install the memcached and require the installation location of the specified libevent in the installation:
# cd/tmp
# tar ZXVF memcached-1.2.0.tar.gz
# CD memcached-1.2.0
#./CONFIGURE-WITH-LIBEVENT=/USR
# make
# make Install
If there is an error in the middle, please carefully check the errors, follow the error message to configure or add the appropriate library or path.
When the installation is complete, the memcached will be put into/usr/local/bin/memcached,

5. Test whether the memcached is installed successfully:
# ls-al/usr/local/bin/mem*
-rwxr-xr-x 1 root root 137986 11?? 17:39/usr/local/bin/memcached
-rwxr-xr-x 1 root root 140179 11?? 17:39/usr/local/bin/memcached-debug


To start the memcached service:
1. Start the server side of the memcache:
#/usr/local/bin/memcached-d-M 20-u root-l 192.168.137.1-p 11211-c 256-p/usr/local/memcached.pid

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 multiple addresses, I specify the server IP address 192.168.0.200,
-P is to set the Memcache listening port, the default is 11211, so you can also not set this parameter, I set the 12000 here, 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,

2. If you want to end the memcache process, execute:

# Kill ' Cat/tmp/memcached.pid '

You can also start multiple daemons, but the ports cannot be duplicated.



Test memcached:


Copy Code
[[Email protected]/]# telnet 192.168.141.64 11211
Trying 192.168.141.64 ...
Connected to 192.168.141.64 (192.168.141.64).
Escape character is ' ^] '.
Set Key1 0 60 4
Zhou
STORED
Get Key1
VALUE Key1 0 4
Zhou
END
Copy Code


This memcached installation is successful!



Problems:

1. If you encounter a memcached service when you start the

/usr/local/bin/memcached:error while loading shared libraries:libevent-1.2.so.1:cannot open shared object File:no such file or directory;

Solution:
[Email protected] bin]# ld_debug=libs memcached-v
[Email protected] bin]# ln-s/usr/lib/libevent-1.2.so.1/usr/lib64/libevent-1.2.so.1
[Email protected] bin]#/usr/local/bin/memcached-d-M 100-u root-p 12000-c 1000-p/tmp/memcached.pid
[Email protected] bin]# Ps-aux

You can see the memcached service started.



2. Load the memcached service into the Linux startup item. In case the machine loses power, 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 12000-c 256-p/tmp/memcached.pid capacity from 17jquery

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 12000-u apache-c 256
There are some things to refer to: That is, IP is not specified when the default is the local, users: the best choice is: Apache or Deamon
This is the service that belongs to which user and which user starts it.


Download Memcache Expansion pack:
Http://pecl.php.net/package/memcache/3.0.8/windows
http://museum.php.net/php5/
Http://pecl.php.net/package/mongo
http://blog.csdn.net/jovenlu/article/details/16986357

################### #Imagick扩展 ############################
#windows下 PHP5.5.6 + imagick Extension
1, first install Imagemagick-6.8.7-7-q16-x64-dll.exe. : Http://www.imagemagick.org/script/binary-releases.php#windows can choose a different version.
2, decompression Php_imagick-3.1.2-5.5-ts-vc11-x64.zip, the Php_imagick.dll into the PHP ext directory.
Can be downloaded according to Imagick version,: Http://pecl.php.net/package/imagick Click DLL, you can go to select the appropriate PHP version.
When downloading, be aware of Non-thread-safe and Thread-safe, which apply to IIS and the latter for Apache.
3, open php.ini, add Extension=php_imagick.dll, restart Apache.


################ #linux Installation telnet##################
See if you have Telnet installed on this machine (CentOS5 has Telnet installed by default)

# Rpm-qa |grep Telnet

If you see the result as:

Telnet-0.17-39.el5

Telnet-server-0.17-39.el5

Congratulations, Telnet is already installed on the machine. If it is not installed, see the next step.



Special Note:

Telnet is divided into telnet-client (telnet) and telnet-server. Telnet-client system, which is usually installed by default. Telnet-server need to be installed separately.
See if the Telnet service is installed
Rpm–qa|grep Telnet

To install the Telnet client:
Just install it with the command "yum-y install Telnet".
Install Telnet Server side:

--Installing the Telnet program via yum install
You can view it first:
[email protected] xinetd.d]# Yum list telnet-server
Then install:
[email protected] xinetd.d]# Yum install Telnet-server


-----------------------
Install Telnet

First method (online installation):

You can use the command:

#yum Install xinetd (Note the installation under root)

#yum Install Telnet-server (Note the installation under root)


The second method (CD-ROM installation method):

CD/CD/centos

RPM-IVH xinetd-2.3.14-10.el5.i386.rpm

RPM-IVH telnet-server-0.17-39.el5.i386.rpm


Special Note:

1, Telnet service to rely on XINETD services to start, so first install the XINETD service. So we need to install XINETD First, then install Telnet-server. CentOS 5.5 does not have Telnet and xinetd services installed by default.

2, Centos-5.5-i386-bin-dvd inside has xinetd and Telnet-server and installs the package!! No need to download the internet!!

Three. Configure Telnet

Method One: Use Ntsysv, in the window that appears, the Telnet is selected, and then press OK!



Method Two: Use the Chkconfig command to open directly

#chkconfig Telnet on



Method Three: Directly modify the configuration file

Vi/etc/xinetd.d/telnet



This is usually the case:

# Default:yes

# description:the Telnet Server servestelnet sessions; It uses \

# unencrypted Username/password pairs for authentication.

Service Telnet

{

Flags = Reuse

Socket_type = Stream

wait = no

user = root

Server =/usr/sbin/in.telnetd

Log_on_failure + = USERID

Disable = yes

}



Just change "disable= yes" to "Disable=no"



Iv. Activation of services

Telnet is hung under the xinetd, so naturally just reactivate xinetd will be able to re-read the xinetd inside the settings, so just set the telnet nature

can be activated as well.

# Service XINETD Restart

or #/etc/rc.d/init.d/xinetd restart.



Five. Iptables firewall will block Telnet, so you need to allow iptables, use the following command



When you start the Telnet service, you can use the NETSTAT–TUNLP command to see the port used by the Telnet service, and you can find 23. Use the following command to turn on these ports:



Iptables-i input-p TCP--dport 23-jaccept



Iptables-i input-p UDP--dport 23-jaccept



Service Iptables save//Save



Service iptables restart//restart firewall



Or a little ruthless!! Shut down the firewall!



Service Iptables Stop





Vi. Possible issues:

Let's look at two types of errors:

The first type:

[[Email protected] ~]# Telnet 192.168.1.87

Trying 192.168.1.87 ...

Telnet:connect to address 192.168.1.87:noroute to host

Telnet:unable to connect-to-remote host:no route to host



Workaround: The firewall does not allow the Telnet service, the connection is blocked, the default CentOS only allows SSH, so go to its custom options, before Telnet tick!



The second Kind

[[Email protected] xinetd.d]# Telnet 172.25.1.3

Trying 172.25.1.3 ...

Connected to 172.25.1.3 (172.25.1.3).

Escape character is ' ^] '.

Getnameinfo:localhost:Success

Temporary failure in name Resolution:illegal seek

Connection closed by foreign host.



This one is the/etc/hosts file configuration problem

Workaround: I add two IP address in it, the content is as follows:



[Email protected] ~]$ more/etc/hosts

# don't remove the following line, orvarious programs

# that require network functionality Willfail.

127.0.0.1localhost.localdomainlocalhost

:: 1localhost6.localdomain6localhost6

192.168.1.88

192.168.1.86

Description: Because the client's name is not written in the letter, the content format should be 127.0.0.1 Pcname

CentOS Installation memcache and Telnet

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.