1. 打开云服务器防火墙中所有需要的常用端口(3306,8080,80等)
apt-get update
apt-get upgrade
apt-get install wget
2. 安装JDK8
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz
tar -zxvf jdk-8u112-linux-x64.tar.gz
mv jdk1.8.0_131 /usr/local
nano ~/.profile
export JAVA_HOME=/usr/local/jdk1.8.0_131
export PATH=$PATH:$JAVA_HOME/bin
source ~/.profile
java -version
3. 安装MySQL
wgethttps://dev.mysql.com/get/mysql-apt-config_0.8.6-1_all.deb
dpkg -i mysql-apt-config_0.8.6-1_all.deb
apt-get update
apt-get install mysql-server
service mysql status
nano /etc/mysql/mysql.conf.d/mysqld.cnf
#bind-address = 127.0.0.1(注解掉)
character-set-server = utf8
collation-server = utf8_unicode_ci
skip-character-set-client-handshake
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;
systemctl stop mysql
systemctl start mysql
4. 安装Tomcat
tar -zxvf apache-tomcat-9.0.0.M22.tar.gz
mv apache-tomcat-9.0.0.M22 tomcat
mv tomcat /usr/local
nano ~/.profile
export CATALINA_HOME=/usr/local/tomcat
nano /usr/local/tomcat/conf/tomcat-users.xml
nano /usr/local/tomcat/webapps/manager/META-INF/context.xml
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-->
5. 安装Nginx
安装PCRE
apt-get install libpcre3 libpcre3-dev
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
tar -zxf pcre-8.40.tar.gz
cd pcre-8.40
./configure; make; sudo make install
安装zlib
wgethttp://zlib.net/zlib-1.2.11.tar.gz
tar -zxf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure; make; sudo make install
安装OpenSSL
wgethttp://www.openssl.org/source/openssl-1.0.2f.tar.gz
tar -zxf openssl-1.0.2f.tar.gz
cd openssl-1.0.2f
./config; make; sudo make install
安装本体
wgethttp://nginx.org/download/nginx-1.12.0.tar.gz
tar -zxf nginx-1.12.0.tar.gz
cd nginx-1.12.0
./configure
--sbin-path=/usr/local/nginx/nginx
--conf-path=/usr/local/nginx/nginx.conf
--pid-path=/usr/local/nginx/nginx.pid
make; make install
配置反向代理
location{} 内加入proxy_passhttp://myservers;
配置负载均衡
server{}上面加入upstream myservers { server 139.199.105.238:8080;}
./nginx; ./nginx -s reload; ./nginx -s stop
6. 安装Maven
tar -zxvf apache-maven-3.5.0-bin.tar.gz
mv apache-maven-3.5.0 /usr/local
nano ~/.profile
export PATH=$PATH:/usr/local/apache-maven-3.5.0/bin
source ~/.profile
mvn -v
7. 安装GitHub
用源码安装
sudo apt-get install libcurl4-openssl-dev
wgethttps://www.kernel.org/pub/software/scm/git/git-2.9.4.tar.gz
tar -zxvf git-2.9.4.tar.gz
cd git-2.9.4; make; make install
git --version
生成SSH秘钥,加入ssh-agent,在GitHub导入SSH秘钥
ssh-keygen -t rsa -b 4096 -C "your_email@example.com”
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter](三次回车)
eval "$(ssh-agent -s)”
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub
git clone
8. 安装Jetty
nano ~/.profile
JETTY_HOME=/usr/local/jetty-distribution-9.4.6.v20170531
source ~/.profile
java -jar $JETTY_HOME/start.jar
9. 安装Resin
wgethttp://caucho.com/download/resin-4.0.53.tar.gz
tar -zxvf resin-4.0.53.tar.gz
./configure; make; make install
resinctl generate-password my-user my-password >> /etc/resin/resin.properties
nano /etc/resin/resin.properties
remote_admin_enable : true
resinctl start
resinctl deploy hello.war
10. 安装Memcached
先安装依赖包libevent
tar -zxvf libevent-2.1.8-stable.tar.gz
./configure; make; make install
sudo ldconfig -v
安装本体
wgethttp://www.memcached.org/files/memcached-1.4.39.tar.gz
tar -zxvf memcached-1.4.39.tar.gz
./configure; make; make install
11. 安装Redis
(Mac) sudo xcode-select —install
wgethttp://download.redis.io/releases/redis-3.2.9.tar.gz
make/make install
echo 511 > /proc/sys/net/core/somaxconn
sysctl -w vm.overcommit_memory=1
echo never > /sys/kernel/mm/transparent_hugepage/enabled
redis-server
redis-cli