tomcat 安装html
进到/usr/local/apache执行命令 java
wget http://mirrors.cnnic.cn/apache/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gzmysql
而后解压linux
tar
-
zxvf
apache-tomcat-7.0.57.tar.gzweb
查看sql
[root@iZ94l1n0y28Z apache]# ls数据库
apache-tomcat-7.0.57 apache-tomcat-7.0.57.tar.gzapache
[root@iZ94l1n0y28Z apache]# cd apache-tomcat-7.0.57centos
[root@iZ94l1n0y28Z apache-tomcat-7.0.57]# lstomcat
bin lib logs RELEASE-NOTES temp work
conf LICENSE NOTICE RUNNING.txt webapps
[root@iZ94l1n0y28Z apache-tomcat-7.0.57]#
tomcat 启动
切换到tomcat 的bin路径下执行 ./startup.sh
tomcat 关闭
./shutdown.sh
查看tomcat运行实时日记
切换到tomcat的logs目录下
运行
tail -f catalina.out
jdk安装
[root@iZ94l1n0y28Z local]# mkdir java
[root@iZ94l1n0y28Z local]# ls
aegis bin games java lib64 sbin src
apache etc include lib libexec share
[root@iZ94l1n0y28Z local]# cd java
[root@iZ94l1n0y28Z java]# wget http://download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-x64.tar.gz
解压jdk
而后一直不行。
最后直接在window下,下载好文件 而后经过ssh传到阿里云服务器
下载地址
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
如图
此次终于解压成功!
解压后
配置环境变量
vi /etc/profile
export JAVA_HOME = /usr/local/java/jdk1.7xxx
export PATH = $JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
注意这里:
export JAVA_HOME=/usr/local/java/jdk1.7.0_71
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
=号左右2边不要有空格否则启动时候报这个错:-bash: export: `=': not a valid identifier
mysql安装
mysql安装花了我比较多的时间
要安装的有3个
MySQL-server-5.0.96-1.glibc23.x86_64.rpm
MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm
MySQL-client-5.0.96-1.glibc23.x86_64.rpm
一开始执行# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm的时候抛下面的错误
MySQL conflicts with mysql-5.1.73-3.el6_5.x86_64
[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm
error: Failed dependencies:
libmysqlclient.so.15()(64bit) is needed by MySQL-server-5.0.96-1.glibc23.x86_64
libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by MySQL-server-5.0.96-
1.glibc23.x86_64
解决方案:
要装这个
http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm
安装server的时候遇到这个问题:
[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm
error: Failed dependencies:
libmysqlclient.so.15()(64bit) is needed by MySQL-server-5.0.96-1.glibc23.x86_64
libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by MySQL-server-5.0.96-
1.glibc23.x86_64
MySQL conflicts with mysql-5.1.73-3.el6_5.x86_64
[root@iZ94l1n0y28Z mysql]# rpm -qa | grep -i libs | grep -i mysql
mysql-libs-5.1.73-3.el6_5.x86_64
[root@iZ94l1n0y28Z mysql]# rpm -e mysql-libs-5.1.73-3.el6_5.x86_64
error: Failed dependencies:
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
libmysqlclient.so.16()(64bit) is needed by (installed) mysql-5.1.73-3.el6_5.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-
6.el6_5.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-
3.el6_5.x86_64
libmysqlclient_r.so.16()(64bit) is needed by (installed) mysql-5.1.73-3.el6_5.x86_64
libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-
3.el6_5.x86_64
mysql-libs is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
mysql-libs = 5.1.73-3.el6_5 is needed by (installed) mysql-5.1.73-3.el6_5.x86_64
[root@iZ94l1n0y28Z mysql]# rpm -e mysql-libs
error: Failed dependencies:
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
libmysqlclient.so.16()(64bit) is needed by (installed) mysql-5.1.73-3.el6_5.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-
6.el6_5.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-
3.el6_5.x86_64
libmysqlclient_r.so.16()(64bit) is needed by (installed) mysql-5.1.73-3.el6_5.x86_64
libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-
3.el6_5.x86_64
mysql-libs is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
mysql-libs = 5.1.73-3.el6_5 is needed by (installed) mysql-5.1.73-3.el6_5.x86_64
[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm
error: Failed dependencies:
libmysqlclient.so.15()(64bit) is needed by MySQL-server-5.0.96-1.glibc23.x86_64
libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by MySQL-server-5.0.96-
1.glibc23.x86_64
MySQL conflicts with mysql-5.1.73-3.el6_5.x86_64
后来找到方法就是:将系统预装的删除掉
[root@iZ94l1n0y28Z mysql]# yum -y remove mysql-libs-5.1.73-3.el6_5.x86_64
删除掉以后遇到了下面的问题
[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm
error: Failed dependencies:
libmysqlclient.so.15()(64bit) is needed by MySQL-server-5.0.96-1.glibc23.x86_64
libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by MySQL-server-5.0.96-
1.glibc23.x86_64
找到解决方法就是以下安装这个:
[root@iZ94l1n0y28Z mysql]# wget http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-shared-
compat-5.0.96-1.glibc23.x86_64.rpm
[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-shared-compat ########################################### [100%]
[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h iZ94l1n0y28Z password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Starting MySQL. SUCCESS!
[root@iZ94l1n0y28Z mysql
这个时候还不能够用MySQL命令行
还得安装MySQL-client-5.0.96-1.glibc23.x86_64.rpm
总而言之要将原来系统自带的干掉
而后按照这个顺序分别安装,至于其余顺序我没试过
MySQL-server-5.0.96-1.glibc23.x86_64.rpm
MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm
MySQL-client-5.0.96-1.glibc23.x86_64.rpm
上面3个资源路径以下:
路径分别是
http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-server-5.0.96-1.glibc23.x86_64.rpm
http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm
http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-client-5.0.96-1.glibc23.x86_64.rpm
链接数据库
[root@iZ94l1n0y28Z mysql]# mysql -u root
设置数据库编码
/usr/share/doc/mysql-server-xxxx中的my-large.cnf复制到/etc/my.cnf
先经过vi 打开 my-large.cnf(i进入编辑模式,按esc退出编辑模式,按:wq退出而且保存该文件)
# Example MySQL config file for large systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
2. 打开my.cnf,修改编码(注意:my.cnf是为了设置全局变量?能够将上面的内容复制到这个文件以后再改下面的)
在[client]下,增长default-character-set=utf8
在[mysqld]下增长default-character-set=utf8 和 init_connect='SET NAMES utf8'
参考文章: