我要评分
获取效率
正确性
完整性
易理解

Installing Memcached

  1. Obtain the Memcached source code.
    1. Download the Memcached source code package using the local browser.

      Download address: https://github.com/memcached/memcached/archive/1.5.12.zip

    2. Copy the source code to the /home directory on the server.

      If the server is connected to the Internet, you can run the wget command on the server to download the source code.

      1
      2
      cd /home
      wget https://github.com/memcached/memcached/archive/1.5.12.zip --no-check-certificate
      
  2. Decompress the source code package.
    1
    2
    cd /home
    unzip 1.5.12.zip
    
  3. Switch to the memcached-1.5.12 directory.
    1
    cd memcached-1.5.12
    
  4. Configure Memcached.
    sh autogen.sh
    ./configure --prefix=/opt/memcached

    --prefix indicates the Memcached installation directory, for example, /opt/memcached in this step.

  5. Perform the compilation and installation.
    1
    make -j60 && make install
    

    -j60 leverages multi-core CPUs to speed up the compilation.

  6. View the installation directory.
    1
    2
    ls /opt/memcached
    ls /opt/memcached/bin/
    

  7. Configure environment variables.
    1. Edit the /etc/profile file.
      vim /etc/profile
    2. Add the following command to the file:
      1
      echo export PATH=$PATH:/opt/memcached/bin/ >> /etc/profile
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Make the environment variables take effect.
      1
      source /etc/profile