系统:centos6 配置mirror阿里云 https://opsx.alibaba.com/mirror

远程管理首选:ssh 账户密码登录(ssh user@host) 或者 本地私钥连接服务器公钥(推荐)

=>ssh服务本身配置(禁止掉root、只允许密钥):etc/ssh/sshd_config

【SSH初次适用】

密钥对
2. ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
代理
3. eval "$(ssh-agent -s)"
注册私钥
4. ssh-add ~/.ssh/id_rsa
填充公钥
5. cat id_rsa.pub | clip
6. GitHub > profile > SSH keys 添加就好啦。
7. ssh-copy-id 192.168.10.10

1. 【虚拟机上网初始化】编辑 => 虚拟网络编辑器 => 桥接模式(独立虚拟机) => 选择一张已经联网的网卡。

………………………………………………………………【JDK】

【清除自带jdk】

rpm -qa | grep jdk

sudo yum remove 查询结果

【权限全开】

sudo chmod 777 安装包

【安装】默认路径 usr/java/

sudo rpm -ivh 安装包

【环境变量】

sudo vim /etc/profile

export JAVA_HOME=/usr/java/路径

export JRE_HOME=$JAVA_HOME/jre

export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib

export PATH=$JAVA_HOME/bin:$PATH

source /etc/profile

………………………………………………………………【JDK】

………………………………………………………………【Tomcat】

【windows 和 虚拟机共享目录】C:\Users\sunw31\Documents\Virtual Machines\vms

【tar -zvxf 压缩包】z=gz v=verbose x=extract f=force

【环境配置】

export CATALINA_HOME=/developer/apache-tomcat-7.0.73

  【CATALINA_BASE 默认系统盘idea.system下】只能修改 idea.properties 的 idea.system 从而改变路径 CATALINA_BASE。

【配置 UTF-8 字符集】

cd $CATALINA_HOME/conf

vim server.xml

找到配置 <Connector port="8080" 增加属性 URIEncoding="UTF-8"

【验证】bin/startup.sh 看一下。

ifconfig 拿 ip 访问下,访问不了看下防火墙。

………………………………………………………………【Tomcat】

………………………………………………………………【Maven】

tar -zvxf

/etc/profile

export MAVEN_HOME=/developer/apache-maven-xxx

【settings.xml】nexus + mirror

【常用命令】

mvn clean

mvn compile

mvn package

mvn clean package -Dmaven.test.skip=true

………………………………………………………………【Maven】

………………………………………………………………【vsftpd】

【安装】sudo yum -y install vsftpd

【检查】rpm -qa | grep vsftpd

【配置文件位置】/etc/vsftpd/vsftpd.conf

【创建虚拟用户】意思是说 这个用户有权限上传 下载  rwx...

cd /

mkdir ftpfile

useradd ftpuser -d /ftpfile -s /sbin/nologin

chown -R ftpuser.ftpuser /ftpfile

sudo passwd ftpuser

cd ftpfile下 创建一个 index.html 等下访问看到

【配置加入虚拟用户  分离主配置 】

cd /etc/vsftpd

sudo vim chroot_list 写个内容 "ftpuser"

【关闭selinux】sudo vim /etc/selinux/config

SELINUX=disabled

sudo setenforce 0

【如果 505 错误】sudo setsebool -P ftp_home_dir 1 然后重启机器

【参考配置】

本项目要用到的配置项:
1)local_root=/ftpfile(当本地用户登入时,将被更换到定义的目录下,默认值为各用户的家目录)
2)anon_root=/ftpfile(使用匿名登入时,所登入的目录)
3)use_localtime=YES(默认是GMT时间,改成使用本机系统时间)
4)anonymous_enable=NO(不允许匿名用户登录)
5)local_enable=YES(允许本地用户登录)
6)write_enable=YES(本地用户可以在自己家目录中进行读写操作)
7)local_umask=022(本地用户新增档案时的umask值)
8)dirmessage_enable=YES(如果启动这个选项,那么使用者第一次进入一个目录时,会检查该目录下是否有.message这个档案,如果有,则会出现此档案的内容,通常这个档案会放置欢迎话语,或是对该目录的说明。默认值为开启)
9)xferlog_enable=YES(是否启用上传/下载日志记录。如果启用,则上传与下载的信息将被完整纪录在xferlog_file 所定义的档案中。预设为开启。)
10)connect_from_port_20=YES(指定FTP使用20端口进行数据传输,默认值为YES)
11)xferlog_std_format=YES(如果启用,则日志文件将会写成xferlog的标准格式)
12)ftpd_banner=Welcome to mmall FTP Server(这里用来定义欢迎话语的字符串)
13)chroot_local_user=NO(用于指定用户列表文件中的用户是否允许切换到上级目录)
14)chroot_list_enable=YES(设置是否启用chroot_list_file配置项指定的用户列表文件)
15)chroot_list_file=/etc/vsftpd/chroot_list(用于指定用户列表文件)
16)listen=YES(设置vsftpd服务器是否以standalone模式运行,以standalone模式运行是一种较好的方式,此时listen必须设置为YES,此为默认值。建议不要更改,有很多与服务器运行相关的配置命令,需要在此模式下才有效,若设置为NO,则vsftpd不是以独立的服务运行,要受到xinetd服务的管控,功能上会受到限制)
17)pam_service_name=vsftpd(虚拟用户使用PAM认证方式,这里是设置PAM使用的名称,默认即可,与/etc/pam.d/vsftpd对应) userlist_enable=YES(是否启用vsftpd.user_list文件,黑名单,白名单都可以
18)pasv_min_port=61001(被动模式使用端口范围最小值)
19)pasv_max_port=62000(被动模式使用端口范围最大值)
20)pasv_enable=YES(pasv_enable=YES/NO(YES)
若设置为YES,则使用PASV工作模式;若设置为NO,则使用PORT模式。默认值为YES,即使用PASV工作模式。FTP协议有两种工作方式:PORT方式和PASV方式,中文意思为主动式和被动式。一、PORT(主动)方式的连接过程是:客户端向服务器的FTP端口(默认是21)发送连接请求,服务器接受连接,建立一条命令链路。 当需要传送数据时,客户端在命令链路上用 PORT命令告诉服务器:“我打开了****端口,你过来连接我”。于是服务器从20端口向客户端的****端口发送连接请求,建立一条数据链路来传送数据。二、PASV(被动)方式的连接过程是:客户端向服务器的FTP端口(默认是21)发送连接请求,服务器接受连接,建立一条命令链路。 当需要传送数据时,服务器在命令链路上用 PASV命令告诉客户端:“我打开了****端口,你过来连接我”。于是客户端向服务器的****端口发送连接请求,建立一条数据链路来传送数据。 从上面可以看出,两种方式的命令链路连接方法是一样的,而数据链路的建立方法就完全不同。而FTP的复杂性就在于此。
)

sudo vim /etc/vsftpd/vsftpd.conf

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).local_root=/product/ftpfile
#chroot_local_user=YES
anon_root=/product/ftpfile
use_localtime=YES#匿名
#anonymous_enable=YES
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# The target log file can be vsftpd_log_file or xferlog_file.
# This depends on setting xferlog_std_format parameter
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
#
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to mmall FTP Server
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().chroot_local_user=NOchroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YESpam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES#pasv_enable=YES
pasv_min_port=61001
pasv_max_port=62000

【配置防火墙端口范围】 + iptables 起到一个限制的作用

sudo vim /etc/vsftpd/vsftpd.conf

pasv_min_port=61001
pasv_max_port=62000

【防火墙配置】sudo vim /etc/sysconfig/iptables

# Generated by iptables-save v1.4.7 on Fri Jan  6 16:53:09 2017
#*filter
#:INPUT ACCEPT [174:12442]
#:FORWARD ACCEPT [0:0]
#:OUTPUT ACCEPT [96:10704]
#-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
#-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
#-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT#COMMIT
# Completed on Fri Jan  6 16:53:09 2017#------------------------------------# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT#ssh port
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT#vsftpd
-A INPUT -p TCP --dport 61001:62000 -j ACCEPT
-A OUTPUT -p TCP --sport 61001:62000 -j ACCEPT-A INPUT -p TCP --dport 20 -j ACCEPT
-A OUTPUT -p TCP --sport 20 -j ACCEPT
-A INPUT -p TCP --dport 21 -j ACCEPT
-A OUTPUT -p TCP --sport 21 -j ACCEPT#mysql port
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT#tomcat remote debug port
-A INPUT -p tcp -m tcp --dport 5005 -j ACCEPT-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT#nginx
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

sudo service iptables restart

【验证 very secure ftp daemon】

sudo service vsftd restart

=>浏览器 ftp://ifconfig   ftpuser 123456

=>终端 ftp ip 同样输入密码

=> filezilla

………………………………………………………………【vsftpd】

………………………………………………………………【nginx】

反向代理服务器 => 负载均衡服务器 => 邮件代理服务器 => 前端静态和动态分离

【安装依赖】

yum -y install gcc-c++ zlib zlib-devel pcre-devel openssl openssl-devel

【tar -zvxf】

【默认安装】/usr/local/nginx      查 whereis nginx

cd 进入 ./configure (可选指定自己想要的安装路径 --prefix=/developer/nginx )

make

make install

【常用命令】

测试或检查配置文件  nginx/sbin/nginx -t

启动命令 nginx/sbin/nginx       启动后 ps aux | grep nginx 打开浏览器看下

停止命令 nginx/sbin/nginx -s stop

重启命令 nginx/sbin/nginx -s reload

  平滑重启(热) kill -HUP pid

查看进程 ps -ef | grep nginx

【开发防火墙 80端口】

-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

【验证】

启动 ${nginx}/sbin/nginx

重启 ${nginx}/sbin/nginx -s reload    ==========

http://ifconfig 访问 80 端口

………………………………………………………………………………………………………………………………

【配置可维护的 vhost】nginx 虚拟域名的配置

sudo vim /usr/local/nginx/conf/nginx.conf

追加 include vhost/*.conf;

cd /usr/local/nginx/conf

mkdir vhost

【创建域名转发配置文件】

learning.istone.com.conf

istone.com.conf

img.istone.com.conf

s,istone.com.conf

【没有自己的域名 可以先用 Host 需要重启浏览器】

【linux桌面下】sudo vim /etc/hosts

192.168.222 www.izxvf.com

【创建 vhost conf 域名转发】从nginx.conf 分离出来 include部分

cd /usr/local/nginx/conf/vhost/

sudo vim www.izxvf.com.conf

server {listen 80;autoindex on;server_name www.istone.com;access_log /usr/local/nginx/logs/access.log combined;index index.html index.htm index.jsp index.php;#error_page 404 /404.html;if ( $query_string ~* ".*[\;'\<\>].*" ){ return 404; }location / {proxy_pass http://127.0.0.1:8080;add_header Access-Control-Allow-Origin *;}}

【修改完配置重启一下】记住 chrome 强制 https 所以可以删除一下  chrome://net-internals/#hsts

【vhost 图片服务器转发】

cd vhost

sudo vim image.izxvf.com.conf

server {listen 80;autoindex off;server_name image.istone.com;access_log /usr/local/nginx/logs/access.log combined;index index.html index.htm index.jsp index.php;#error_page 404 /404.html;if ( $query_string ~* ".*[\;'\<\>].*" ){return 404;}location ~ /(mmall_fe|mmall_admin_fe)/dist/view/* {deny all;}location / {root /ftpfile/ftpfile/;add_header Access-Control-Allow-Origin *;}
}

【vhost 静态资源服务器 示例】autoindex off 关掉索引

server {listen 80;autoindex off;server_name s.happymmall.com;access_log /usr/local/nginx/logs/access.log combined;index index.html index.htm index.jsp index.php;if ( $query_string ~* ".*[\;'\<\>].*" ){return 404;}location ~ /(mmall_fe|mmall_admin_fe)/dist/view/* {deny all;}location / {root /product/front/;add_header Access-Control-Allow-Origin *;}
}

………………………………………………………………【nginx】

………………………………………………………………【nginx + vsftpd】

通过程序上传文件到 vsftpd

然后 nginx 得到 文件 url。

………………………………………………………………【nginx + vsftpd】

………………………………………………………………【mysql】

【安装】yum -y install mysql-server

【默认配置】/etc/my.cnf

【字符集配置】

sudo vim /etc/my.cnf

[mysqld]

default-character-set=utf8mb4

character-set-server=utf8mb4

【5.1 版本中文乱码】

my.ini 的 [mysql] 和 [mysqld]  【default-character-set=utf8】

【5.5 版本中文乱码】

my.ini 的 [mysqld] 更改为 【character-set-server=utf8】

【自启动配置】

chkconfig mysqld on

chkconfig --list mysqld    查看 on 状态 2到5位。

【防火墙配置】入站 开放 3306

【启动 mysqld 服务】service mysqld start

【查看目前 mysql 用户】select user,host,passwd from mysql.user;

=> 【删除匿名用户 执行下】delete from mysql.user where user='';

  =>【刷薪后生效】flush privileges;

【修改下密码】set passwd for root@localhost=passwd('youpasswd');

【添加一个用户】

insert into mysql.user(Host,User,Password) values ("localhost","yourusername",password("yourpassword"));

  =>【刷薪后生效】flush privileges

【创建新的数据库】create database `mmall` default character set utf8 collate utf8_general_ci;

【查看已经有的全局权限】select * from mysql.user \G  -- 有可能已经赋值了Y 但是 N。

【赋予所有权限】grant all privileges on mmall.* to yourusername@127.0.0.1 identified by 'yourpassword'

【开通外网权限】grant all privileges on mmall.* to yourusername@'%' identified by 'yourpassword'

【赋予部分权限】grant select,update,insert ...

  =>【刷薪后生效】flush privileges

………………………………………………………………【mysql】

………………………………………………………………【git】

【安装依赖】sudo yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

sudo make prefix=/usr/local all

sudo make prefix=/usr/local install

【配置】git config --global user.name "your"

git config --gloabl user.email "@email"

【其他配置】

[kdiff3软件]git config --global merge.tool "kdiff3"

【windows 和 linux 换行符】git config --global core.autocrlf false;

【git gui 乱码】git config --global gui.encoding utf-8

【git status 乱码】git config --global core.quotepath off

【windows 设置一下】git config --global core.ignorecase false

【ssh key pair】

ssh-keygen -t rsa -C "i@email."

ssh-add ~/.ssh/id_rsa

=> 报错 eval `ssh-agent` 再 ssh-add ~... => ssh-add -l

【验证】git --version

【git 常用命令】

git branch -r

git checkout 要切换分支

git branch 当前分支

………………………………………………………………【git】

========================================【数据库设计】

有些设计技巧 => 放到我的 《数据库概要设计》那边总结 https://www.cnblogs.com/chenhui7373/p/9076608.html

========================================【数据库设计】

转载于:https://www.cnblogs.com/chenhui7373/p/9122531.html

DUMP1 企业级电商项目相关推荐

  1. Java从零打造企业级电商项目实战 项目初始化

    1.项目初始化 1.1 新建maven项目 (1)new project -> maven -> maven-archetype-webapp project name:mmall pro ...

  2. DUMP3 企业级电商项目

    [开发模式]controller - service(合法校验问题) - dao   反过来也没问题 用户模块 登录 注册 用户名验证(实时反馈前端) 忘记密码 重置密码 退出登录 更新用户信息 获取 ...

  3. Java从零到企业级电商项目实战: linux环境配置

    阿里云镜像 https://opsx.alibaba.com/mirror https://blog.csdn.net/jameshadoop/article/details/54881295(修改y ...

  4. 项目是采用目前比较流行的 SpringBoot/SpringCloudAlibaba构建新零售微服务电商项目

    简介: 技术架构 项目是采用目前比较流行的 SpringBoot/SpringCloudAlibaba构建新零售微服务电商项目,从项目中台架构技术选型.模块设计.基础设施的构建.分布式解决方 案.互联 ...

  5. 新零售微服务电商项目SpringBoot/SpringCloudAlibaba

    技术架构–项目地址-新零售微服务电商项目 项目是采用目前比较流行的 SpringBoot/SpringCloudAlibaba构建新零售微服务电商项目,从项目中台架构技术选型.模块设计.基础设施的构建 ...

  6. 电商项目相关面试问题及答案

    请描述一下这个系统? [回答技巧] 从3个方面来回答这个问题: |–系统背景及系统概述 |–系统包括的业务模块及主业务流程 |–责任模块 [回答示例] 第一个方面:系统背景及系统概述 优购时尚商城是香 ...

  7. JavaEE大型分布式电商项目 上海淘淘商城 29期

    上海29期_张志君老师_淘淘商城_大型分布式电商项目 JavaEE大型分布式电商项目 淘淘商城 29期 需要的加qq:350226234,备注:程序员学习视频 ==================== ...

  8. 电商项目中的经典问题

    转载自:https://blog.csdn.net/A_BlackMoon/article/details/80094814 请描述一下这个系统? [回答技巧] 从3个方面来回答这个问题: |--系统 ...

  9. 视频教程-企业级电商大数据推荐系统实战-大数据

    企业级电商大数据推荐系统实战 张长志技术全才.擅长领域:区块链.大数据.Java等.10余年软件研发及企业培训经验,曾为多家大型企业提供企业内训如中石化,中国联通,中国移动等知名企业.拥有丰富的企业应 ...

最新文章

  1. 算法----合并两个有序链表
  2. 产品策划系列:洞察需求(四)
  3. 《系统集成项目管理工程师》必背100个知识点-87系统文档验收
  4. 怎么做蒙特卡洛计算npv_计算机一级:这该死的“进制转换”,这种题到底怎么做?...
  5. Linux系统编程(七)消息队列
  6. java i线程安全吗_Java中 i++ 是线程安全的么?为什么?
  7. python response重头开始_你必须学写 Python 装饰器的五个理由
  8. spark数据本地性级别划分
  9. day6常用模块,数据库操作
  10. Atitit 存储方法大总结 目录 1. 存储方式分类 2 1.1. 按照数据分类为 结构化 半结构化 非结构化 2 1.2. 按照内外部可分类 内部存储和外部存储持久化 2 1.3. 按照本地远
  11. 3Dmax2010 的 安装与激活
  12. 吉林大学计算机游戏程序设计,吉林大学在2018年大学生程序设计竞赛中夺得佳绩...
  13. WIN XP自带分区工具的使用方法
  14. 事业单位新税改的个人所得税纳税筹划
  15. 云联惠创业经营者认证_广州公安打掉云联惠涉传销组织 零壹财经曾发文警示...
  16. 芭比波朗品牌的男性市场
  17. 计算机科学方向的会议或期刊,计算机顶会和顶刊_计算机顶会_顶会
  18. 【Android】技术调研:用代码模拟屏幕点击、触摸事件
  19. C语言bool类型定义
  20. Post请求报错405

热门文章

  1. 我的创作纪念日-一入江湖任我行
  2. 绿叶计算机学校,绿叶U盘启动盘制作教程
  3. C++ Qt 实现微信聊天界面、气泡消息、gif斗图、表情包
  4. IDEA 自动补全返回值
  5. 海思HI3518由于sensor对齐方式问题导致视频花屏
  6. 代理记账公司的业务有哪些方面?
  7. vue.js基础入门
  8. ubuntu16.04 有线网络不稳定解决办法
  9. Oracle中删除表
  10. php时间转成毫秒数,PHP中mktime时间转换成毫秒的方法