1、使用nginx,查看是否安装了Apache服务器,如果系统自带可以卸载了
httpd -v
2、阿里云添加安全组规则,开放80/3306端口,Linux系统是否开启防火墙,开启了也要开放相应端口
3、搭建Nginx
yum install nginx -y
vim /etc/nginx/nginx.conf
nginx -t
mkdir -p /data/www echo helloWorld! > index.html nginx -s reload
4、安装jdk
yum list java*
yum install java-1.8.0-openjdk* -y
java -version
vim /etc/profile
JAVA_HOME=/usr/lib/java
JRE_HOME=$JAVA_HOME/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
source /etc/profile
5、安装Tomcat
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.41/bin/apache-tomcat-8.5.41.tar.gz
tar -zxf apache-tomcat-8.5.41.tar.gz mv apache-tomcat-8.5.41 /usr/local/tomcat8
cd tomcat8/bin/ chmod 777 *.sh
./startup.sh
6、安装mysql
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum -y localinstall mysql80-community-release-el7-3.noarch.rpm
yum -y install mysql-community-server
systemctl enable mysqld systemctl daemon-reload
vim /var/log/mysqld.log
mysql -uroot -pk+aJiR6Nu,Xc ALTER USER 'root'@'localhost' IDENTIFIED BY 'password****';
vim /etc/my.cnf
// 默认MEDIUM
set global validate_password.policy=LOW;
// 默认8
set global validate_password.length=6;
create user 'user'@'%' identified by '123456'; grant all privileges on *.* to 'user'@'%'; flush privileges;
alter user 'user'@'%' identified with mysql_native_password by '123456
7、activeMQ安装
wget http://mirror.bit.edu.cn/apache//activemq/5.15.9/apache-activemq-5.15.9-bin.tar.gz tar -zxvf apache-activemq-5.15.9-bin.tar.gz
./activemq start
8、redis安装
cd /opt/
wget http://download.redis.io/releases/redis-5.0.4.tar.gz
tar -xvf redis-5.0.4.tar.gz cd /redis-5.0.4 make install PREFIX=/usr/local/redis
cd /usr/local/redis/ cp /opt/redis-5.0.4/redis.conf redis.conf
vim redis.conf
# 查找/daemon,修改daemon no 为daemon yes
# :wq 保存退出
bin/redis-server redis.conf
ps aux|grep redis
或 ps -ef|grep redis
或 netstat -anp|grep 6379
bin/redis-cli
或 bin/redis-cli -h 127.0.0.1 -p 6379
set key value
get key