在linux系统中搭建测试环境 jdk,tomcat,mysql安装
这里先占个位子 等回公司后再发上来这段时间的总结
安装文件:apache-tomcat-7.0.27.zip
jdk-6u32-linux-x64.bin
mysql-5.5.15.tar
1 安装jdk
执行步奏如下:
cd install
chomd 755 jdk-6u32-linux-x64.bin
./jdk-6u32-linux-x64.bin
vi /etc/profie
在最后添加
export JAVA_HOME = /root/install/jdk1.6.0.32
export PATH=$JAVA_HOME/bin:$PATH
保存后退出
source /etc/profile
查看是否配好JDK
env
2 安装Apache
tar -xvf httpd-2.2.18.tar.gz
cd httpd-2.2.18/srclib/apr
./configure --prefix=/usr/local/apr --enable-threads --enable-other-child
make
make install
cd httpd-2.2.18/srclib/apr-util
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-mysql=/usr/local/mysql
make
make install
cd httpd-2.2.18
./configure -prefix=/usr/local/apache -with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util --enable-module=so -enable-so -enable-mods-shared=all -enable-proxy=shared -enable-proxy-balancer=shared -enable-proxy-http=shared --enable-proxy-connect -enable-proxy-ajp -enable-cache -enable-disk-cache -enable-mem-cache --enable-include --enable-forward --enable-rule=SHARED_CORE --enable-include --enable-rewrite --enable-cache
apache 参数自已配置下
启停apache /usr/local/apache/bin/apachectl -k start
/usr/local/apache/bin/apachectl -k stop
tomcat安装精简版
3 tomcat安装和启动
(1)解压tomcat
(2)进入解压目录 cd apache-tomcat-7.0.27
(3)进入bin
(4)./startup.sh 执行此命令的时候会遇见权限问题,这里需要修改.sh的权限 全部改为-rwxrw-r-- chmod 764 *.sh
(5)启动后查看时候真的启动,进入logs文件夹 查看 具体指令:
cd .. cd logs tail -100f catalina.out 经此三步可查看
4 安装mysql
tar xvf mysql-5.5.15.tar
检查是否安装好了cmake
cmake -i
未安装好则执行
yum install cmake gcc gcc-c++ libaio libaio-devel automake autoconf bzr bison libtool ncurses5-devel ncurses-devel bzip2-devel zlib-devel
cd mysql-5.5.15
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_READLINE=1 -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -LH
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306
make
make install
添加用户组和用户
groupadd mysql
useradd -g mysql mysql
chown -R mysql.mysql /usr/local/mysql
删除用户组和用户(mysql卸载的时候用)
userdel mysql
groupdel mysql
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
vi /etc/my.cnf 增加或修改如下配置
[client]
socket = /usr/local/mysql/mysql.sock
[mysqld]
basedir =/usr/local/mysql #需要加入basedir,和datadir否则会出问题
datadir =/usr/local/mysql/data
max_connections = 500
创建默认数据库
/usr/local/mysql/scripts/mysql_install_db --user=