1.安装jdk1.8
open-jdk #安装之前先检查一下系统有没有自带
rpm -qa | grep java | xargs rpm -e --nodeps #批量卸载所有带有Java的文件(若有)
wget --no-check-certificate --no-cookie --header "Cookie: oraclelicense=accept-securebackup-cookie;"http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm
#下载jdk
rpm -ivh jdk-8u45-linux-x64.rpm #安装jdk
java -version #检查是否安装成功
----end
2.安装mysql
yum -y install mysql-server #使用yum命令安装mysql
chkconfig mysqld on #设置开机启动
service mysqld start #启动MySQL服务
mysql -u root #登录mysql
select user,host,password from mysql.user; #查询用户
set password for root@localhost=password('root'); #设置root密码
mysql -u root -p #新用户登录
service mysqld stop #关闭mysql
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #修改/etc/sysconfig/iptables(添加这条语句)
service iptables restart #重启防火墙
service mysqld start #启动mysql
----end
3.安装tomcat(启动远程debug模式)
下载 apache-tomcat-7.0.69.tar.gz #下载tomcat安装文件夹
tar -zxvf apache-tomcat-7.0.69.tar.gz #解压tomcat安装文件
./catalina.sh jpda start #以远程调试方式启动tomcat
eclipse添加new remoteApp #eclipse启动远程调试即可
----end
4.安装svn
----end
5.安装httpd
rpm -qa httpd #首先在系统上面查询一下是否已经安装了apache 软件
yum install httpd -y #直接安装
chkconfig httpd on #设置开启自启动
service httpd start #启动软件
----end
6.安装nexus
----end
7.maven实现tomcat热部署
1.配置服务器tomcat/conf/tomcat-user.xml(例如:admin123-admin123) #授权
2.maven的setting.xml 添加:<server> #maven注册授权用户
<id>tomcat7-maven-plugin</id>
<username>admin123</username>
<password>admin123</password>
</server>
3.pom.xml添加:<plugin> #添加maven插件
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<!-- 注意此处的url为服务器url -->
<url>http://121.40.179.179:8080/manager/text</url>
<server>tomcat7-maven-plugin</server> <!-- 此处的名字必须和setting.xml中配置的ID一致-->
<path>/AutoCreate-web</path> <!-- 此处的名字是项目发布的工程名-->
</configuration>
</plugin>
4../startup.sh #启动tomcat容器
5.mvn debug tomcat7:deploy #部署项目war
----end
8.服务器配置一个ip多个域名
1.cd /etc/httpd/conf
2.vim httpd.conf
3.添加:<VirtualHost 121.40.179.179:8080> #配置域名1
ServerAdmin admin@www.vlipay.com
DocumentRoot /var/www/html
ServerName www.vliPay.com
</VirtualHost>
<VirtualHost 121.40.179.179:8081> #配置域名2
ServerAdmin admin@www.vliapp.com
DocumentRoot /var/www/html
ServerName www.vliapp.com
</VirtualHost>
NameVirtualHost 121.40.179.179 #服务器ip
4.host添加: #配置映射
121.40.179.179:8080 www.vlipay.com
121.40.179.179:8081 www.vliapp.com
--------------------------------------------------------------------------------------
9.SVN强制添加注释
1.在VisualSVN Server界面右键仓库。
2.查看properties
3.查看hocks
4.编辑pre-commit文件
5.添加如下脚本:
@echo off
setlocal
set REPOS=%1
set TXN=%2
rem check that logmessage contains at least 10 characters
rem .....代表5个字符
svnlook log "%REPOS%" -t "%TXN%" | findstr "....." > nul
if %errorlevel% gtr 0 goto err
exit 0
:err
echo 上传失败!请添加注释. 注释长度至少为5个字符. Commit aborted! 1>&2
exit 1
open-jdk #安装之前先检查一下系统有没有自带
rpm -qa | grep java | xargs rpm -e --nodeps #批量卸载所有带有Java的文件(若有)
wget --no-check-certificate --no-cookie --header "Cookie: oraclelicense=accept-securebackup-cookie;"http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm
#下载jdk
rpm -ivh jdk-8u45-linux-x64.rpm #安装jdk
java -version #检查是否安装成功
----end
2.安装mysql
yum -y install mysql-server #使用yum命令安装mysql
chkconfig mysqld on #设置开机启动
service mysqld start #启动MySQL服务
mysql -u root #登录mysql
select user,host,password from mysql.user; #查询用户
set password for root@localhost=password('root'); #设置root密码
mysql -u root -p #新用户登录
service mysqld stop #关闭mysql
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #修改/etc/sysconfig/iptables(添加这条语句)
service iptables restart #重启防火墙
service mysqld start #启动mysql
----end
3.安装tomcat(启动远程debug模式)
下载 apache-tomcat-7.0.69.tar.gz #下载tomcat安装文件夹
tar -zxvf apache-tomcat-7.0.69.tar.gz #解压tomcat安装文件
./catalina.sh jpda start #以远程调试方式启动tomcat
eclipse添加new remoteApp #eclipse启动远程调试即可
----end
4.安装svn
----end
5.安装httpd
rpm -qa httpd #首先在系统上面查询一下是否已经安装了apache 软件
yum install httpd -y #直接安装
chkconfig httpd on #设置开启自启动
service httpd start #启动软件
----end
6.安装nexus
----end
7.maven实现tomcat热部署
1.配置服务器tomcat/conf/tomcat-user.xml(例如:admin123-admin123) #授权
2.maven的setting.xml 添加:<server> #maven注册授权用户
<id>tomcat7-maven-plugin</id>
<username>admin123</username>
<password>admin123</password>
</server>
3.pom.xml添加:<plugin> #添加maven插件
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<!-- 注意此处的url为服务器url -->
<url>http://121.40.179.179:8080/manager/text</url>
<server>tomcat7-maven-plugin</server> <!-- 此处的名字必须和setting.xml中配置的ID一致-->
<path>/AutoCreate-web</path> <!-- 此处的名字是项目发布的工程名-->
</configuration>
</plugin>
4../startup.sh #启动tomcat容器
5.mvn debug tomcat7:deploy #部署项目war
----end
8.服务器配置一个ip多个域名
1.cd /etc/httpd/conf
2.vim httpd.conf
3.添加:<VirtualHost 121.40.179.179:8080> #配置域名1
ServerAdmin admin@www.vlipay.com
DocumentRoot /var/www/html
ServerName www.vliPay.com
</VirtualHost>
<VirtualHost 121.40.179.179:8081> #配置域名2
ServerAdmin admin@www.vliapp.com
DocumentRoot /var/www/html
ServerName www.vliapp.com
</VirtualHost>
NameVirtualHost 121.40.179.179 #服务器ip
4.host添加: #配置映射
121.40.179.179:8080 www.vlipay.com
121.40.179.179:8081 www.vliapp.com
--------------------------------------------------------------------------------------
9.SVN强制添加注释
1.在VisualSVN Server界面右键仓库。
2.查看properties
3.查看hocks
4.编辑pre-commit文件
5.添加如下脚本:
@echo off
setlocal
set REPOS=%1
set TXN=%2
rem check that logmessage contains at least 10 characters
rem .....代表5个字符
svnlook log "%REPOS%" -t "%TXN%" | findstr "....." > nul
if %errorlevel% gtr 0 goto err
exit 0
:err
echo 上传失败!请添加注释. 注释长度至少为5个字符. Commit aborted! 1>&2
exit 1