前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOS6.3 x86_64 mininstall 安装 apahce2.23+jdk1.7+tomecat7+mysql5.1.58

CentOS6.3 x86_64 mininstall 安装 apahce2.23+jdk1.7+tomecat7+mysql5.1.58

作者头像
三杯水Plus
发布2018-11-14 15:24:09
4830
发布2018-11-14 15:24:09
举报
文章被收录于专栏:运维运维运维

CentOS6.3 x86_64 mininstall 安装 apahce2.23+jdk1.7+tomecat7+mysql5.1.58

# uname -a

Linux localhost 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/redhat-release

CentOS release 6.3 (Final)

# rpm -qa |wc -l

244

一,安装apache

#yum –y install gcc

#tar –zxvf httpd-2.2.23.tar.gz

#cd httpd-2.2.23

#./configure –-prefix=/usr/local/apahce2

#make

#make install

#ln –s /usr/local/apache2/bin/apachectl /etc/init.d/apache

#vim /etc/init.d/apache

#apache

#chkconfig: 2345 85 15

#description: apache is a web server

#chkconfig --add apache

# chkconfig apache on

#service apache start

#yum –y install elinks

#elinks localhost测试

二,安装jdk

#tar –zxvf jdk-7u7-linux-x64.tar.gz –C /usr/java

#vim /etc/profile

JAVA_HOME=/usr/java/jdk1.7.0_07

PATH=$JAVA_HOME/bin:$PATH

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export JAVA_HOME

export PATH

export CLASSPATH

# source /etc/profile

# java -version

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

三,安装tomcat

#tar –zxvf apache-tomcat-7.0.32.tar.gz –C /usr/local

#mv /usr/local/tomcat-7.0.32 /usr/local/tomcat7

#vim /etc/profile

export TOMCAT_HOME=/usr/local/tomcat7

export CATALINA_HOME=/usr/local/tomcat7

# /usr/local/tomcat7/bin/startup.sh

Using CATALINA_BASE: /usr/local/tomcat7

Using CATALINA_HOME: /usr/local/tomcat7

Using CATALINA_TMPDIR: /usr/local/tomcat7/temp

Using JRE_HOME: /usr/java/jdk1.7.0_07

Using CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar

# netstat -an | grep :8

tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN

tcp 0 0 :::8009 :::* LISTEN

tcp 0 0 :::8080 :::* LISTEN

tcp 0 0 :::80 :::* LISTEN

#elinks localhsot:8080测试

设置tomcat自动启动

我觉得有好几种办法,比如写个自动启动脚本,或者把bin下某个文件copy到

/etc/init.d下再改改,但是我发现用这个同样可以自动启动

echo "/usr/local/tomcat7/bin/catalina.sh start" >>/etc/proflie

不过这个需要有用户登录才生效

后来发现放在/etc/rc.local这个文件下面同样可以,但是要加上

export JAVA_HOME=/usr/java/jkd1.7.0_07

这行才行

四,安装mysql

#groupadd  mysql

#useradd -g mysql  mysql

#tar –zxvf mysql-5.1.58.tar.gz

#cd mysql-5.1.58

#./configure --prefix=/usr/local/mysql --without-debug --enable-thread-safe-client --enable-assembler --enable-profiling --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-charset=latin1 --with-extra-charsets=utf8,gbk --with-mysqld-user=mysql --without-embedded-server --with-server-suffix=community --with-unix-socket-path=/usr/local/mysql/sock/mysql.sock --with-plugins=innobase

编译时会报错

错误点

1,checking for termcap functions library... configure: error: No curses/termca

解决

#yum -y install ncurses-devel

2,../depcomp: line 571: exec: g++: not found

make[1]: *** [my_new.o] Error 127

make[1]: Leaving directory `/home/mysql-5.1.58/mysys'

解决

#yum intall gcc-c++

3,/bin/rm: cannot remove `libtoolT': No such file or directory

config.status: executing default commands

安装libtool 依赖autoconf和automake

下面三条可以不用执行

#autoreconf --force --install

#libtoolize --automake --force

#automake --force --add-missing

不过安装libtool并按照这个方法做后,还会出现上面那个报错,但不影响结果

#make

#make install

# cp support-files/my-medium.cnf /etc/my.cnf

# cd /usr/local/mysql/bin/

# ./mysql_install_db --user=mysql

Installing MySQL system tables...

121016 15:04:30 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.

OK

Filling help tables...

121016 15:04:30 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.

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:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'

/usr/local/mysql/bin/mysqladmin -u root -h localhost password 'new-password'

Alternatively you can run:

/usr/local/mysql/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 /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

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

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

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

[root@localhost mysql]# chown -R root .

[root@localhost mysql]# chown -R mysql var

[root@localhost mysql]# chgrp -R mysql .

[root@localhost mysql]# ls -l

total 36

drwxr-xr-x. 2 root mysql 4096 Oct 16 14:57 bin

drwxr-xr-x. 2 root mysql 4096 Oct 16 14:57 docs

drwxr-xr-x. 3 root mysql 4096 Oct 16 13:56 include

drwxr-xr-x. 3 root mysql 4096 Oct 16 13:56 lib

drwxr-xr-x. 2 root mysql 4096 Oct 16 15:01 libexec

drwxr-xr-x. 10 root mysql 4096 Oct 16 15:01 mysql-test

drwxr-xr-x. 5 root mysql 4096 Oct 16 15:01 share

drwxr-xr-x. 5 root mysql 4096 Oct 16 15:01 sql-bench

drwx------. 4 mysql mysql 4096 Oct 16 15:04 var

# /usr/local/mysql/bin/mysqld_safe --user=mysql &

[1] 31365

121016 15:13:13 mysqld_safe Logging to '/usr/local/mysql/var/localhost.err'.

121016 15:13:13 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var

自动启动

#cp support-files/mysql.server /etc/init.d/mysql

#chmod +x /etc/init.d/mysql

#chkconfig --add mysql

#chkconfig mysql on

五,设置防火墙

cat /etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall

# Manual customization of this file is not recommended.

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

-A INPUT -p icmp -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

COMMIT

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2012-10-17 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档