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
# 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
?
轉載于:https://blog.51cto.com/jerrymin/1029813
總結
以上是生活随笔為你收集整理的CentOS6.3 x86_64 mininstall 安装 apahce2.23+jdk1.7+tomecat7+mysql5.1.58的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 虚拟化系列-VMware vSphere
- 下一篇: 单机杀毒软件仅是企业信息安全的时尚毛衣