博威---云架构决胜云计算

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 6292|回复: 9

Solaris+MySQL+JAVA+GlassFish+JSPRun环境搭建

[复制链接]
发表于 2010-4-18 15:26:44 | 显示全部楼层 |阅读模式
SMGJ环境搭建。( 自己起了个名)



一、Solaris安装

二、Solaris中安装MySQL

三、Solaris中安装JDK6.0

四、Solaris中安装GlassFish

五、GlassFish中部署JSPrun论坛

 楼主| 发表于 2010-4-18 15:30:56 | 显示全部楼层

一、Solaris安装过程

Solaris安装

版本:Solaris 5.10

image1.png

image2.png

image3.png

image4.png

image5.png

image7.png

image6.png

image8.png

image9.png

image10.png

image11.png

image12.png

image13.png

image14.png

image15.png

image16.png

image17.png

image18.png

image19.png

image20.png

image21.png

image22.png

image23.png

image24.png

image25.png

image26.png

image27.png

image28.png

image29.png

image30.png

image31.png

image32.png

image33.png

image34.png

image35.png

image36.png

image37.png

image38.png

image39.png

image40.png

image41.png

image42.png

image43.png

image44.png

image46.png

image45.png

image47.png

image48.png

image49.png

image50.png

image51.png


 楼主| 发表于 2010-4-18 15:37:51 | 显示全部楼层

Solaris安装完成后的一些问题

1、
Solaris ssh允许root远程连接


image52.png

image53.png

image54.png

image55.png

image56.png

2Solaris使用bash


http://bbs.boway.net/viewthread.php?tid=7011&extra=page%3D1

3、无法解析域名的解决方法

image57.png


这是由于Solaris系统默认不会更改系统域名,我们要手动更改,编辑/etc/hosts文件,添加域名即可


image58.png


image59.png


将上图改为下图


image60.png

重新启动,即可。


 楼主| 发表于 2010-4-18 15:40:53 | 显示全部楼层

二、Solaris中安装MySQL

版本:mysql-5.1.45-solaris10-i386.tar.gz

下载地址:http://mysql.mirrors.adc.am/Downloads/MySQL-5.1/mysql-5.1.45-solaris10-i386.tar.gz

先将MySQL包传到solaris/usr/local目录下


image61.png

下面开始安装:

[root@boway:/]# groupadd mysql

[root@boway:/]# useradd -d /opt/mysql -g mysql -m mysql

[root@boway:/]# cd /usr/local

[root@boway:/usr/local]# gunzip < mysql-5.1.45-solaris10-i386.tar.gz | tar -xvf -

[root@boway:/usr/local]#ln -s mysql-5.1.45-solaris10-i386 mysql

[root@boway:/usr/local]#cd mysql

[root@boway:/usr/local/mysql]#./scripts/mysql_install_db --user=mysql

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'

./bin/mysqladmin -u root -h boway password 'new-password'

Alternatively you can run:

./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.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

[root@boway:/usr/local/mysql]#

安装完成以后,设置目录权限,否则mysql将无法启动

[root@boway:/usr/local/mysql]#chown -R root .

[root@boway:/usr/local/mysql]#chown -R mysql data

[root@boway:/usr/local/mysql]#chgrp -R mysql .

启动数据库服务

[root@boway:/usr/local/mysql]#./bin/mysqld_safe --user=mysql &

[1] 964

[root@boway:/usr/local/mysql]#100418 13:42:28 mysqld_safe Logging to '/usr/local/mysql-5.1.45-solaris10-i386/data/boway.err'.

100418 13:42:28 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.1.45-solaris10-i386/data

设置mysql root用户的密码

[root@boway:/usr/local/mysql]#./bin/mysqladmin -u root password 'root'

进入mysql数据库

[root@boway:/usr/local/mysql]#./bin/mysql -uroot -proot

Welcome to the MySQL monitor.
Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.1.45 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

mysql/bin目录添加进系统PATH变量中,这样随处都可以运行mysql命令

[root@boway:/usr/local/mysql]#vi /etc/profile

/etc/profile文件末尾加入

PATH=/usr/local/mysql/bin:$PATH

export PATH

再执行一次上面两条命令即可

查看mysql运行状态

[root@boway:/]#mysqladmin -uroot -proot version

mysqladmin
Ver 8.42 Distrib 5.1.45, for pc-solaris2.10 on i386

Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.

This software comes with ABSOLUTELY NO WARRANTY. This is free software,

and you are welcome to modify and redistribute it under the GPL license

Server version

5.1.45

Protocol version
10

Connection
Localhost via UNIX socket

UNIX socket
/tmp/mysql.sock

Uptime:
5 min 27 sec

Threads: 1
Questions: 7
Slow queries: 0
Opens: 15
Flush tables: 1
Open tables: 8
Queries per second avg: 0.21

[root@boway:/]#

关闭mysql服务

[root@boway:/]#mysqladmin -uroot -proot shutdown

100418 13:48:39 mysqld_safe mysqld from pid file /usr/local/mysql-5.1.45-solaris10-i386/data/boway.pid ended

[1]+
Done
./bin/mysqld_safe --user=mysql
(wd: /usr/local/mysql)

(wd now: /)

[root@boway:/]#

重启mysql服务

[root@boway:/]#mysqld_safe --user=mysql &

 楼主| 发表于 2010-4-18 15:45:11 | 显示全部楼层

三、Solaris中安装JDK6.0

版本:jdk-6u19-solaris-i586.sh

下载地址:http://download.java.net/jdk6/binaries/

image62.png

查看当前jdk版本信息

[root@boway:/]#java -version

java version "1.5.0_20"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_20-b02)

Java HotSpot(TM) Server VM (build 1.5.0_20-b02, mixed mode)

[root@boway:/]#

安装jdk1.6

[root@boway:/]#cd /usr/local

[root@boway:/usr/local]#ls

jdk-6u19-solaris-i586.sh
mysql-5.1.45-solaris10-i386

mysql
mysql-5.1.45-solaris10-i386.tar.gz

[root@boway:/usr/local]#chmod +x jdk-6u19-solaris-i586.sh

[root@boway:/usr/local]#./jdk-6u19-solaris-i586.sh


image63.png


image64.png


image65.png

[root@boway:/usr/local]#rm -rf /usr/java

[root@boway:/usr/local]#cp -r jdk1.6.0_19 /usr/java

[root@boway:/usr/local]#java -version

java version "1.6.0_19"

Java(TM) SE Runtime Environment (build 1.6.0_19-b04)

Java HotSpot(TM) Server VM (build 16.2-b04, mixed mode)

[root@boway:/usr/local]#

[root@boway:/usr/local]#rm -rf jdk1.6.0_19/

[root@boway:/usr/local]#rm -rf jdk-6u19-solaris-i586.sh

[root@boway:/usr/local]#

 楼主| 发表于 2010-4-18 15:49:09 | 显示全部楼层

四、Solaris 中安装GlassFish

Solaris 中安装GlassFish

版本:glassfish-v3-unix.sh

下载地址:http://download.java.net/glassfish/v3/release/glassfish-v3-unix.sh


image66.png


Glassfish需要在图形界面下安装

image67.png

image68.png

image69.png

image70.png

image71.png

image72.png

image73.png

image74.png

image75.png

image76.png

image77.png

image78.png

image79.png

Glassfish安装完成

启动glassfish服务

[root@boway:/]#/glassfishv3/bin/asadmin start-domain domain1

Waiting for DAS to start ...

Started domain: domain1

Domain location: /glassfishv3/glassfish/domains/domain1

Log file: /glassfishv3/glassfish/domains/domain1/logs/server.log

Admin port for the domain: 4848

Command start-domain executed successfully.

[root@boway:/]#

默认glassfish有一个域名为domain1的域名

默认首页地址

http://localhost:8080

默认管理地址

http://localhost:4848

image80.png

首页

image81.png

管理页

 楼主| 发表于 2010-4-18 15:55:24 | 显示全部楼层

五、GlassFish中部署JSPRun

版本:JspRun!_6.0.0_Source_UTF8.tar

下载地址:http://www.jsprun.net/thread-13442-1-1.html

将下载的压缩包解压,将并其中的upload.war改名为 jsprun.war上传至solaris/usr/local目录中


image82.png


然后我们就可以直接在glassfish的控制台部署jsprun了(方便啊)


image83.png


image84.png


image85.png


image86.png


image87.png


image88.png


image89.png


image90.png


image91.png


image92.png


image93.png


image94.png


至此,SMGJ 环境搭建完成!


 楼主| 发表于 2010-4-18 15:57:16 | 显示全部楼层
本帖最后由 bbl164 于 2010-4-18 16:28 编辑

忽。。。终于完了。。。

SMGJ环境搭建.doc (2.52 MB, 下载次数: 7)
发表于 2010-4-19 06:34:38 | 显示全部楼层
不错。相当不错。小伙。继续
发表于 2010-4-19 08:50:12 | 显示全部楼层
好,学习!关注!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|boway Inc. ( 冀ICP备10011147号 )

GMT+8, 2024-11-24 13:38 , Processed in 0.133037 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表