Zhangdragonfly 2014-03-26
1.安装JDK的步骤:
1.sh jdk_6u10_rpm.bin
2.配置环境变量:
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.6.0_10
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib
3.注销
4.java -version
5.测试 1.编写一个java文件(Hello.java)
2.编译 javac Hello.java
3.执行 java Hello
2.安装Tomcat的步骤:
1.先解压:
tar -zxvf Tomcat.......tar.gz
2.启动Tomcat
cd /usr/java/tomcat/bin
./startup.sh
./shutdown.sh
3.安装Eclipse的步骤:
1.解压: tar -zxvf eclipse.......tar.gz
2.mv eclipse /usr/java/eclipse
3.右击桌面空白处,选创建启动器
4.安装MyEclipse的步骤:
1.sh myecli.....bin
2.如果打开时报错,解决的方法:
rpm -q -a libX11*
rpm -e 文件名 --nodeps(强制卸载文件)
cd libxcb
rpm -ivh 文件名.rpm(有2个文件)
3.sh myecli....bin
5.安装mysql的步骤:
1.解压 tar -zxvf mysql.tar.gz
2.创建目录 /usr/local/mysql
3.在系统中建MYSQL帐号:
groupadd mysql(创建组)
useradd mysql -g mysql(创建帐号放到组中)
4.分配用户权限:
cd /usr/local/mysql
chown -R root .
chown -R mysql data
chown -R mysql data/.
chown -R mysql .
ls
ls support-files(配置模板文件)
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql.server
vi /etc/init.d/mysql.server
5.mysql的连接目录:
basedir=/usr/local/mysql
datadir=/usr/local/mysql
6.配置环境变量:
vi /etc/profile
export PATH=$PATH:/usr/local/mysql
vi /etc/man.config
MANPATH /usr/local/mysql/man
7.数据库初始化:
ls scripts
scripts/mysql_install_db --user=mysql
bin/mysqld_safe --user=mysql(启动数据库)
8.另起终端:
cd /usr/local/mysql
9.添加管理员:
bin/mysqladmin -u root password '123'
10.登陆数据库:
mysql -h 主机名 -u 用户名 -p
show databases;
use mysql;
show tables;
quit/exit(退出)
11.停止服务:
bin/mysqladmin -u root -p shutdown
12.启动时就开启mysql的方法:在/etc/rc.d/rc.local后加一行代码为/usr/local/mysql/bin/mysqld_safe --user=mysql &
13.netstat -nvl(证明启动成功)
14.测试时需禁用防火墙 系统-管理-防火墙
6.Apache和Tomcat的整和:
1.解压 tar -zxvf httpd.tar.gz
2. ./configure --prefix=/usr/local/apache --enable-so --enable-mods-share=all
3.make
4.make install
5.
cd /usr/local/apache
cd conf
vi httpd.conf
6.
将virtual hosts下一行的"#"去掉
在最下面添加:#ProxyPass / ajp://127.0.0.1:8009/和#ProxyPassReverse / ajp://127.0.0.1:8009/
7.vi /conf/extre/httpd-vhosts.conf修改其中的内容为:
ServerAdmin root@localhost
DocumentRoot "/usr/java/tomcat/webapps/myjsp"
serverName localhost
serverAlias localhost
8.打开Tomcat中的webapps将下面的web-INF和index.jsp拷贝到myjsp
9.启动apache
cd /usr/local/apache
./apachectl start
7.安装ftp的步骤:
1.
packages-vsftpd
rpm -ivh vsftpd.rpm
cd /etc/vsftpd
service vsftpd start