iptables
- 开启80端口: iptables -I INPUT -p tcp --dport 80 -j ACCEPT
- 关闭:chkconfig iptables off
- 查看规则:iptables -L -n
mysql
- 安装:yum install mysql mysql-devel mysql-server
- 启动:service mysqld start
- 修改密码:mysqladmin -u root password root // root默认密码为空
- 登录:mysql -u root -p
开启mysql远程连接:grant all privileges on *.* to 'root' @'%' identified by 'root';
flush privileges;
设置编码:
- 解决方法:修改配置文件, vi /etc/my.conf
- 在[mysqld]下加入:default-character-set=utf8
- 在[client]下加入:default-character-set=utf8
jdk
- 卸载openjdk
1. 查看openjdk的包
# rpm -qa | grep openjdk
# rpm -qa | grep java
2. 卸载
#rpm -qa| grep openjdk|xargs rpm -e --nodeps
- 安装:
1. 创建java目录 # mkdir /usr/java
2. 授权执行#chmod 777 jdk-6u37-linux-x64.bin #./jdk-6u37-linux-x64.bin
- 配置环境变量
# vi /etc/profile,文件末尾添加如下配置
export JAVA_HOME=/usr/java/jdk1.6.0_37 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH
# source /ete/profile
重启,java -version查看安装成功
httpd
- 安装部署
# yum install httpd
# service httpd start
- 集成mod_auth_mysql
# yum install mod_auth_mysql
tomcat
- # cd /usr/local
- # tar -zxvf apache-tomcat-7.0.29.tar.gz
- # mv apache-tomcat-7.0.29 tomcat7
- # /usr/local/tomcat7/bin/startup.sh
svn
- 安装部署
# yum install subversion
# svnversion --version
- 集成mod_dav_svn
# yum install mod_dav_svn
安装完成可看到多了/etc/httd/conf.d/subversion.conf文件
- 创建项目、用户
# mkdir /home/svn
# svnadmin create --fs-type fsfs /home/svn/project1
# htpasswd -c /home/svn/passwd admin #第一次加用户名
# htpasswd /home/svn/passwd test
- 验证授权
# cd /home/svn
# vi authz,添加内容
[project1:/]admin=rwtest=rw
- 修改文件权限
# chown -R apache.apache project1
# chown -R apache.apache passwd
# chown -R apache.apache authz
- 配置httpd
# vi /etc/httpd/conf.d/subversion.conf,文件末尾添加
DAV svn SVNParentPath /home/svn AuthType Basic AuthName "Subversion" AuthUserFile /home/svn/passwd AuthzSVNAccessFile /home/svn/authz Require valid-user
重启httpd:service httpd restart
访问http://ip/svn/project1验证
问题1:Permission denied: Could not open password file: /home/svn/passwd
引起的原因是SELinux未关闭,授权是无效的,需要修改SVN目录的权限配置 chcon -R -h -t httpd_sys_content_t /home/svn
selinux
selinux的安全性非常强,号称军用级别。基本上我们的项目不会用到这以强级别的安全控制,我们会选择关闭它
- # vim /etc/selinux/config
- # SELINUX=enforcing修改为SELINUX=disalbed
或者
- # echo 0 > /selinux/enforce #成为permissive模式