Mall platform construction (1) Topology diagram, JDK, service list, tomcat, nginx, redis

The content comes from what Mr. Chen Huai said. For self-study review, infringement deletion

1. Topological structure diagram of platform server

Insert picture description here

电商平台
管理后台
买家平台
卖家平台
计划要多少台服务器,服务器的配置要求
数据库服务器数据库用的是msyql  备份服务器
Redis  服务器
Nginx 服务器  负载均衡、反向代理、动静分离(为了处理图片资源)
Tomcat 容器  admin  front  seller 
交易系统OTC 

Insert picture description here

Two, Linux build jdk1.8

JDK download link:
https://www.oracle.com/technetwork/java/javase/downloads/index.html

1. Upload and unzip

unzip 05-jdk1.8.0_72.zip -d /usr/local/java

Insert picture description here

2. Add permissions to the bin and jre directories of jdk

cd /usr/local/java/jdk1.8.0_72/
chmod -R 755 bin/
chmod -R 755 jre/

Insert picture description here

Three, configure jdk environment variables

#在最后写上:
vim /etc/profile

export JAVA_HOME=/usr/local/java/jdk1.8.0_72
export JRE_HOME=/usr/local/java/jdk1.8.0_72/jre
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

#保存退出,让其生效
source /etc/profile

Command test instructions:
Use javac command, there will be no command not found error;
use java -version, the version appears as java version "1.8.0_72";
use echo $JAVA_HOME, echo $CLASSPATH, echo $PATH to check whether the configuration is correct .

java -version
javac

Insert picture description here

Fourth, deploy tomcat

1. Upload the tomcat installation package. Tar file. Unzip the installation package to the current directory

Insert picture description here

tar -xvf 06-apache-tomcat-8.0.33.tar.gz

2. Modify the server.xml configuration file under /soft/apache-tomcat-8.0.33/conf

Insert picture description here
Change the original port 8080 to port 9088
Insert picture description here
Insert picture description here

3. Switch to the bin path in the middle of tomcat to start with the following command:

#远程连接工具关闭之后 tomcat 进程还会在后台运行
setsid ./startup.sh & 

4. Access method: IP+port-------------- ps -ef | grep java View the command of the tomcat process

Insert picture description here

重启tomcat 操作步骤:
1、ps -ef | grep java  
2、Kill -9 ID 
3、重新启动这个容器: setsid ./startup.sh &


注意事项:
如果启动tomcat   无法正常访问需要关闭防火墙
查看防火墙运行状态命令为:systemctl status firewalld
关闭防火墙命令为:systemctl stop firewalld
如果修改tomcat 配置文件 需要重启tomcat

Five, nginx deployment

1. Download and install (the way of rpm package)

wget  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install nginx -y 
#启动:
systemctl start nginx
#查看nginx 进程
 ps -ef | grep nginx
#杀nginx 进程
Kill -9 nignx

Insert picture description here

2. Modify the configuration file of nginx

Switch to cd /etc/nginx && cd conf.d, modify default.conf and change to port 9008
(Note: If it is tar.gz make&&make install binary installation, the name and location of the configuration file will be different at this time)
Insert picture description here
(Tutorial The middle is to put listen 80 —> 9008)
Insert picture description here

Visit:
Insert picture description here
(In the following blog, directly put the source document deployment, nginx content, a little bit different from here. Also modify the location)

=split line=====

Nginx deployment method two (requires gcc related software):

1. Upload and decompress nginx.tar.gz

yum -y install pcre-devel
yum -y install openssl openssl-devel

mkdir /usr/local/nginx-1.4.2
tar -xvf nginx-1.4.2.tar.gz 
cd /usr/local/nginx-1.4.2

2、执行安装命令./configure --prefix=/usr/local/nginx-1.4.2/ --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre

Insert picture description here

3、make && make install

Insert picture description here

4. Start and switch to the installation directory cd /usr/local/nginx-1.4.2/sbin to execute setsid ./nginx &

setsid ./nginx & 

Insert picture description here

5. To modify the configuration, switch to the cd /usr/local/nginx-1.4.2/conf directory to modify the vi nginx.conf file, and to modify the configuration file, you need to restart nginx

Insert picture description here

Six deployment redis

(1) Copy the redis-3.0.7.tar.gz installation package to the specified directory in the linux environment. Such as: /home/soft

(2) Use the command tar -xvf redis-3.0.7.tar to decompress the tar package and get the redis-3.0.7 directory.

tar -xvf redis-3.0.7.tar

Insert picture description here

(3) Enter the redis-3.0.7 directory and execute the make && make install command to compile.

Insert picture description here

(4) Modify the redis.conf configuration. as follows:

Insert picture description here

(5) Use the setsid ./src/redis-server redis.conf & command to start the redis service.

Insert picture description here
Insert picture description here
Insert picture description here

Use ./src/redis-cli shutdown to stop the service:

Insert picture description here

part 1 END

Guess you like

Origin blog.csdn.net/Nightwish5/article/details/110727398