摘要:查询java版本 java -version 如果版本不对则配置java-home
----------------------------------------------------------------------------------------------------------------------
重启系统reboot
----------------------------------------------------------------------------------------------------------------------
JDK 下载地址http://www.oracle.com/technetwork/java/javase/downloads/index.html
获取真实地址
http://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-linux-x64.rpm?AuthParam=1402828126_1f9972f80e53983d3e83b549d51fb394
用wget下载
wget-Ojdk-7u60-linux-x64.rpmhttp://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-linux-x64.rpm?AuthParam=1402828126_1f9972f80e53983d3e83b549d51fb394
修改文件名称
mvjdk-7u60-linux-x64.rpmjdk-7-linux-x64.rpm
更改文件权限
chmod755jdk-7u60-linux-x64.rpm
安装
rpm-ivhjdk-7u60-linux-x64.rpm
删除文件
rmjdk-7u60-linux-x64.rpm
配置java-home
查询java版本 java -version 如果版本不对则配置java-home
打开文件/etc/profile
在profile文件末尾加入:
exportJAVA_HOME=/usr/java/jdk1.7.0_60 exportPATH=$JAVA_HOME/bin:$PATH exportCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
重启登录
------------------------------------------------------------------------------------------------------------------------
Mysql 安装mysqlyuminstallmysqlmysql-servermysql-devel
启动mysql
servicemysqldstart
设置mysql密码
mysql mysql>;USEmysql; mysql>;UPDATEuserSETPassword=PASSWORD(\'123456\')WHEREuser=\'root\'; mysql>;FLUSHPRIVILEGES;
设置允许远程登录
mysql-uroot-p EnterPassword:<yournewpassword> mysql>GRANTALLPRIVILEGESON*.*TO\'root\'@\'%\'IDENTIFIEDBY\'123456\'WITHGRANTOPTION; mysql>FLUSHPRIVILEGES;
设为开机启动
chkconfigmysqldon
------------------------------------------------------------------------------------------------------------------------
Apache 安装Apacheyuminstallhttpdhttpd-devel
卸载
yum-yremovehttpd*
启动apache
servicehttpdstart
设为开机启动
chkconfighttpdon
配置 文件位置/etc/httpd/conf/httpd.conf
设置虚拟主机目录在文件的最后添加
Listen9999 NameVirtualHost*:9999 <VirtualHost*:9999> ServerNamelocalhost:9999 DocumentRoot"/data/staticFile" </VirtualHost>
------------------------------------------------------------------------------------------------------------------------------
Tomcat 安装tomcatyum-yinstalltomcat6
启动tomcat
servicetomcat6start
设为开机启动
chkconfigtomcat6on
默认的tomcat文件夹路径
/usr/share/tomcat6
配置(tomcat/conf/server.xml)
<Hostname="localhost"appBase="webapps"unpackWARs="true"autoDeploy="true"> </Host> <Hostname="www.aa.com"appBase="webapps"unpackWARs="true"autoDeploy="true"> <Alias>www.aa.com</Alias> <Contextpath=""docBase="/data/webapps/aa"debug="0"/> </Host> <Hostname="www.bb.com"appBase="webapps"unpackWARs="true"autoDeploy="true"> <Alias>www.bb.com</Alias> <Contextpath=""docBase="/data/webapps/bb"debug="0"/> </Host>
----------------------------------------------------------------------------------------------------------------------
防火墙文件路径/etc/sysconfig/iptables(可能不存在,自己新建个就行)
我的配置#Generatedbyiptables-savev1.4.7onFriJun2715:46:012014 *filter :INPUTACCEPT[0:0] :FORWARDACCEPT[0:0] :OUTPUTACCEPT[5:748] -AINPUT-mstate--stateRELATED,ESTABLISHED-jACCEPT -AINPUT-picmp-jACCEPT -AINPUT-ilo-jACCEPT -AINPUT-ptcp-mstate--stateNEW-mtcp--dport22-jACCEPT -AINPUT-ptcp-mstate--stateNEW-mtcp--dport80-jACCEPT -AINPUT-ptcp-mstate--stateNEW-mtcp--dport8080-jACCEPT -AINPUT-ptcp-mstate--stateNEW-mtcp--dport3306-jACCEPT -AINPUT-ptcp-mstate--stateNEW-mtcp--dport9999-jACCEPT -AFORWARD-jREJECT--reject-withicmp-host-prohibited COMMIT #CompletedonFriJun2715:46:012014 #Generatedbyiptables-savev1.4.7onFriJun2715:46:012014 *nat :PREROUTINGACCEPT[35:1782] :POSTROUTINGACCEPT[107:8216] :OUTPUTACCEPT[107:8216] -APREROUTING-ptcp-mtcp--dport80-jREDIRECT--to-ports8080 COMMIT #CompletedonFriJun2715:46:012014
端口允许
iptables-AINPUT-ptcp-mstate--stateNEW-mtcp--dport22-jACCEPT iptables-AINPUT-ptcp-mstate--stateNEW-mtcp--dport80-jACCEPT iptables-AINPUT-ptcp-mstate--stateNEW-mtcp--dport8080-jACCEPT iptables-AINPUT-ptcp-mstate--stateNEW-mtcp--dport3306-jACCEPT
端口转发
iptables-tnat-APREROUTING-ptcp--dport80-jREDIRECT--to-port8080
配置保存
serviceiptablessave
防火墙启动
serviceiptablesstart
防火墙开机启动
chkconfigiptableson
相关文章推荐
虚拟主机的专业参数,分别都是什么意思?2022-09-09
中非域名注册规则是怎样的?注册域名有什么用处? 2022-01-10
HostEase新年活动促销 美国/香港主机全场低至五折2021-12-28
HostGator下载完整备份教程分享2021-12-28
Flink中有界数据与无界数据的示例分析2021-12-28