服务器环境配置:
服务器:
CPU:Intel至强双核2.40GHz
MEM:2G
DISK:100G
NET:Intel 82540EM
OS:Red Hat Enterprise Linux Server release 5.1 (Tikanga)
Kernel:2.6.18-53.el5
JAVA:
版本:jdk 1.6
安装文件:jdk-6u5-linux-i586-rpm.bin
安装路径:默认
Tomcat:
版本:6.0.16
安装文件:apache-tomcat-6.0.16.tar.gz
安装路径:/usr/local/tomcat6/
Mysql:
版本:5.1.34 Community Server (Red Hat Enterprise Linux 5 RPM (x86))
安装文件:MySQL-server-community-5.1.34-0.rhel5.i386.rpm
安装路径:默认
安装过程:
Java
1) 使jdk-6u5-linux-i586-rpm.bin变为可执行文件
chmod a+x jdk-6u5-linux-i586-rpm.bin
2) 解压jdk-6u5-linux-i586-rpm.bin
./jdk-6u5-linux-i586-rpm.bin
3) 安装*.rpm
rpm -ivh jdk-6u5-linux-i586.rpm
4) 注意问题:
a) 配置/etc/profile文件增加环境变量(配置内容视具体情况而定)
export JAVA_HOME=/usr/java/jdk1.6.0_05
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
export PATH=$PATH:$JAVA_HOME/jre/bin
b) Red hat操作系统自带了java代码编译器(GIJ),需要使用sun jdk取代系统默认编译器。
具体操作,删除 /usr/bin/java文件,建立文件软链接 ln –s /usr/java/jdk1.6.0_05/jre/bin/java /usr/bin/java
Tomcat
1) 解压压缩包
tar -zxvf apache-tomcat-6.0.16.tar.gz
2) 移动至安装目录
mv /usr/tomcat6/apache-tomcat-6.0.16/* /usr/tomcat6
3) 修改配置文件
a) 修改默认端口
b) 修改默认http路径指向(默认页面为Tomcat的欢迎页面)
如:Host元素增加:<Context path="" docBase="at" debug="0" reloadable="true" />
4) 启动与停止
启动:/usr/local/tomcat6/bin/startup.sh 后台模式
/usr/local/tomcat6/bin/catalina.sh run 命令行模式
停止:/usr/local/tomcat6/bin/shutdown.sh
Mysql
1) 安装服务器端
Rpm –ivh MySQL-server-community-5.1.34-0.rhel5.i386.rpm MySQL-client-community-5.1.34-0.rhel5.i386.rpm
2) 安装客户端
rpm -ivh MySQL-client-community-5.1.34-0.rhel5.i386.rpm
3) 修改默认的root用户密码(默认为空)
mysqladmin -uroot password newpassword
4) 启动与停止
启动:/etc/rc.d/init.d/mysql start
停止:/etc/rc.d/init.d/mysql stop
其他参数:
[root@localhost ~]# /etc/rc.d/init.d/mysql
Usage: /etc/rc.d/init.d/mysql {start|stop|restart|reload|force-reload|status} [ MySQL server options ]
5) 选择配置文件
a) 查看所有的配置文件
[root@localhost mysql]# find /usr/share/mysql/ -name 'my-*' -print
/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-small.cnf
/usr/share/mysql/my-large.cnf
b) 配置文件说明
i. my-innodb-heavy-4G.cnf
This is a MySQL example config file for systems with 4GB of memory
running mostly MySQL using InnoDB only tables and performing complex
queries with few connections.
ii. my-medium.cnf
Example MySQL config file for medium systems.
This is for a system with little memory (32M - 64M) where MySQL plays
an important part, or systems up to 128M where MySQL is used together with
other programs (such as a web server)
iii. my-huge.cnf
Example MySQL config file for very large systems.
This is for a large system with memory of 1G-2G where the system runs mainly
MySQL.
iv. my-small.cnf
Example MySQL config file for small systems.
This is for a system with little memory (<= 64M) where MySQL is only used
from time to time and it's important that the mysqld daemon
doesn't use much resources.
v. my-large.cnf
Example MySQL config file for large systems.
This is for a large system with memory = 512M where the system runs mainly
MySQL.
c) 配置文件使用
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.
set global options 全局
set server-specific options 指定数据库服务器
set user-specific options 指定用户
一般拷贝至 /etc/my.cnf 即可(全局有效)。
6) 安装目录介绍
a) /var/lib/mysql/ 数据库文件,日志文件,mysql.sock
atapp atest ib_logfile0 localhost.localdomain.err mysql mysql-bin.000002 mysql-bin.000004 mysql.sock
atbase ibdata1 ib_logfile1 localhost.localdomain.pid mysql-bin.000001 mysql-bin.000003 mysql-bin.index test
b) /usr/share/mysql/ 可选配置文件,mysql.server,语言,字符集
binary-configure czech fill_help_tables.sql japanese my-large.cnf mysql.server norwegian-ny serbian
ChangeLog danish french korean my-medium.cnf mysql_system_tables_data.sql polish slovak
charsets dutch german mi_test_all my-small.cnf mysql_system_tables.sql portuguese spanish
config.huge.ini english greek mi_test_all.res mysqld_multi.server mysql_test_data_timezone.sql romanian swedish
config.medium.ini errmsg.txt hungarian my-huge.cnf mysql_fix_privilege_tables.sql ndb-config-2-node.ini russian ukrainian
config.small.ini estonian italian my-innodb-heavy-4G.cnf mysql-log-rotate norwegian SELinux
c) /usr/bin/ mysql客户端和实用工具程序
[root@localhost mysql]# find /usr/bin/ -name 'mysql*' -print
/usr/bin/mysql_install_db
/usr/bin/mysql_fix_privilege_tables
/usr/bin/mysqlimport
/usr/bin/mysql_fix_extensions
/usr/bin/mysql_waitpid
/usr/bin/mysql_find_rows
/usr/bin/mysql_zap
/usr/bin/mysqlhotcopy
/usr/bin/mysql_setpermission
/usr/bin/mysql_upgrade
/usr/bin/mysql_secure_installation
/usr/bin/mysqld_multi
/usr/bin/mysqlslap
/usr/bin/mysqldumpslow
/usr/bin/mysqlcheck
/usr/bin/mysqltest
/usr/bin/mysqlbinlog
/usr/bin/mysqlaccess
/usr/bin/mysql_tzinfo_to_sql
/usr/bin/mysqldump
/usr/bin/mysql
/usr/bin/mysql_convert_table_format
/usr/bin/mysqladmin
/usr/bin/mysqld_safe
/usr/bin/mysqlshow
/usr/bin/mysqlbug
7) 其他
a) 字符集设定
my.cnf文件 [client],[mysqld]下分别添加 default-character-set=utf8
b) 默认存储引擎设定
my.cnf文件 [mysqld]下添加 default-storage-engine=InnoDB
c) 添加公网访问用户(不限IP)
grant all privileges on *.* to yourname@"%" identified by 'yourpassword';
d) 常用命令
i. show variables;
显示mysql配置信息(修改my.cnf后使用该命令检查配置更新)
ii. show variables like '%character%';
显示字符集信息
iii. show create table tablename;
显示建表脚本
iv. show index from tablename;
显示表索引
v. mysql.server
Usage: ./mysql.server {start|stop|restart|reload|force-reload|status} [ MySQL server options ]
vi. mysqladmin
ping Check if mysqld is alive
processlist Show list of active threads in server
reload Reload grant tables
refresh Flush all tables and close and open logfiles
shutdown Take server down
status Gives a short status message from the server
start-slave Start slave
stop-slave Stop slave
variables Prints variables available
version Get version info from server
分享到:
相关推荐
Red Hat于2010年11月11日发布... RHEL 5将是Red Hat的商业服务器操作系统版本的第四次重要版本发布, Red Hat酝酿发布RHEL 5已经超过了两年, 主要变化包括Linux内核由2.6.9升级为2.6.18, 支持Xen虚拟化技术, 集群存储等.
详细介绍Linux(Red Hat Enterprise 6)下Jsp环境搭建的部署细节。涉及JDK、Eclipse、Tomcat、 MySQL的安装调试过程
CentOS Linux发行版是一个稳定的,可预测的,可管理的和可复现的平台,源于Red Hat Enterprise Linux(RHEL)依照开放源代码(大部分是GPL开源协议 [2])规定释出的源码所编译而成。 Nginx是一个高性能的开源Web...
网络配置_安装appache_mysql_php_zend_jdk_tomcat
到mysql官网下载red hat enterprise linux / oracle linux版本到本地,解压后上传到服务器目录 查看mysql相关的文件是否存在 find / -name mysql 删除mysql相关的文件 find / -name mysql|xar
* 操作系统:Windows 2003 Server/64Edition、Windows 2008 Server/64Edition、Linux Red Hat Enterprise edition 3.0(vmlinuz-2.6.9)以上、SUSE Linux Enterprise 10(vmlinuz-2.6.16)以上 * 数据库管理系统:...
CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v2.2.0.pdf CIS_Red_Hat_Enterprise_Linux_8_Benchmark_v1.0.0.pdf CIS_Security_Metrics-Quick_Start_Guide_v1.0.0.pdf CIS_Security_Metrics_v1.1.0.pdf CIS_SUSE_Linux...
* 操作系统:Windows 2003 Server/64Edition、Linux Red Hat Enterprise edition 3.0以上、SUSE Linux Enterprise 10以上。 * 中间件:Apache Tomcat 5.5.27。 * 数据库服务器:MySQL 5.0、SQL Server 2005、SQL ...
centOS7是Red Hat Enterprise Linux的一个版本,用于服务器操作系统。安装Docker需要安装需要的软件包,添加下载源,然后安装指定版本的Docker。 十一、Linux查看端口号 在Linux系统中,可以使用netstat命令查看...
linux服务器环境搭建详细步骤,jdk、mysql、tomcat、httpd、等安装。
1.2.7 功能强大的flv流媒体服务器red5 24 1.3 门户网站开发指导思想 26 1.4 ssh 2组合框架—门户网站开发之首选 28 1.4.1 mvc混血宠儿struts 2 28 1.4.2 幕后的财政部长spring 2.5 30 1.4.3 orm中间件香馍馍...