1.买云主机(亿速云xxx)
2.用putty连接服务器
3.安装环境
(1)jdk查看JDK是否安装 java -version
查看jdk安装包 rpm -qa | grep java
删除jdk rpm -e xxx
rpm -qa | grep jdk | xargs rpm -e --nodeps
rpm -qa | grep java | xargs rpm -e --nodeps
mkdir /usr/java
cp jdk-7u79-linux-x64.gz /usr/java
tar xvf jdk-7u79-linux-x64.gz
设置环境变量
vi /etc/profile
#set java environment
1.export JAVA_HOME=/usr/java/jdk1.8.0_171
2.export JRE_HOME=$JAVA_HOME/jre
3.export PATH=$PATH:$JAVA_HOME/bin
4.export CLASSPATH=./:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
只配置这个即可
export PATH="/usr/local/src/java/bin:$PATH"
使配置文件生效
source /etc/profile
(2)安装Mysql,并且启动
检查是否安装MySQL rpm -qa | grep mysql
查看可安装的MySQL版本 yum list | grep mysql
安装MySQL yum install -y mysql-server mysql mysql-devel
Mysql首次启动 service mysqld start
设置新密码 mysqladmin -u root password
重启mysql service mysqld restart
进入mysql mysql -u root -p
设置mysql允许远程连接 GRANT ALL PRIVILEGES ON . TO root@'%' IDENTIFIED BY 'xxxxxxx' WITH GRANT OPTION;
自启动
chkconfig mysql on
数据库的不区别大小写设置
/etc/my.cnf中的[mysqld]后添加添加lower_case_table_names=1,重启MYSQL服务
发现中文查询数据库有问题,数据库设置没配好
修改my.cnf
#/etc/my.cnf
2.
3.[client]
4.default-character-set=utf8
5.
6.[mysqld]
7.datadir=/var/lib/mysql
8.socket=/var/lib/mysql/mysql.sock
9.user=mysql
10.# Disabling symbolic-links is recommended to prevent assorted security risks
11.symbolic-links=0
12.#default-character-set=utf8
13.character-set-server=utf8
14.init_connect='SET NAMES utf8'
15.
16.[mysql]
17.no-auto-rehash
18.default-character-set=utf8
19.
20.[mysqld_safe]
21.log-error=/var/log/mysqld.log
22.pid-file=/var/run/mysqld/mysqld.pid
(3)利用putty的pspc上传文件
下载pscp.exe https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
cmd运行:pscp C:\Users\lenovo\Downloads\Compressed\apache-tomcat-7.0.86.tar.gzroot@xxxx:/
chkconfig: 345 80 20 # description: start the tomcat deamon # # Source function library . /etc/rc.d/init.d/functions prog=tomcat CATALANA_HOME=/usr/local/tomcat/apache-tomcat-7.0.86/
export CATALINA_HOME case "$1" in start) echo "Starting Tomcat..." $CATALANA_HOME/bin/startup.sh ;; stop) echo "Stopping Tomcat..." $CATALANA_HOME/bin/shutdown.sh ;; restart) echo "Stopping Tomcat..." $CATALANA_HOME/bin/shutdown.sh sleep 2 echo echo "Starting Tomcat..." $CATALANA_HOME/bin/startup.sh ;; *) echo "Usage: $prog {start|stop|restart}" ;; esac exit 0
chkconfig --add tomcat
chkconfig tomcat on
root@xxxx:/<br/" rel="nofollow">
共同学习,写下你的评论
评论加载中...
作者其他优质文章