CentOS 5.3上yum安装Apache+php+Mysql+phpMyAdmin

<p>CentOS 5.3上yum安装Apache+php+Mysql+phpMyAdmin<br /> linux @ 02 七月 2009,<br /> Centos 里的 yum 在线安装很慢.以下是替换为中国CentOS镜像服务器!<br /> 中国官方镜像网站: <a href="http://centos.ustc.edu.cn/">http://centos.ustc.edu.cn/</a><br /> /* 使用说明 */<br /> cd /etc/yum.repos.d[进入yum.repos.d目录]<br /> mv CentOS-Base.repo CentOS-Base.repo.save[修改源文件名称备份]<br /> wget <a href="http://centos.ustc.edu.cn/CentOS-Base.repo.5">http://centos.ustc.edu.cn/CentOS-Base.repo.5</a>[下载]<br /> mv CentOS-Base.repo.5 CentOS-Base.repo[下载后的文件更名]</p> <p>1. 更新系统内核到最新.<br /> yum -y update<br /> 系统更新后,如果yum安装时提示错误信息,请执行以下命令修复.<br /> rpm &ndash;import /etc/pki/rpm-gpg/RPM-GPG-KEY*</p> <p>2. 安装Apahce, PHP, Mysql, 以及php连接mysql库组件</p> <p>yum -y install httpd php mysql mysql-server php-mysql</p> <p>//安装mysql扩展<br /> yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql<br /> //安装php的扩展<br /> yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc<br /> //安装apache扩展<br /> yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql</p> <p>一次性粘贴安装:<br /> yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql</p> <p>3. 启动服务配置</p> <p>/sbin/chkconfig httpd on [设置apache为自启动]<br /> /sbin/chkconfig &ndash;-add mysqld [mysql服务]<br /> /sbin/chkconfig mysqld on [mysqld服务]</p> <p>/sbin/service httpd start [自启动 httpd 服务]<br /> /sbin/service mysqld start [自启动mysqld服务]</p> <p>4.设置mysql数据库root帐号密码。<br /> mysqladmin -u root password &lsquo;新密码&rsquo; [引号内填密码]</p> <p>让mysql数据库更安全</p> <p>复制内容到剪贴板</p> <p>代码:</p> <p>mysql -u root -p [此时会要求你输入刚刚设置的密码,输入后回车即可</p> <p>mysql&gt; DROP DATABASE test; [删除test数据库]</p> <p>mysql&gt; DELETE FROM mysql.user WHERE user = &rdquo;; [删除匿名帐户]</p> <p>mysql&gt; FLUSH PRIVILEGES; [重载权限]</p> <p>5. 防火墙配置<br /> a.添加.允许访问端口{21: ftp, 80: http}.<br /> iptables -I RH-Firewall-1-INPUT -m state &ndash;state NEW -m tcp -p tcp &ndash;dport 21 -j ACCEPT<br /> iptables -I RH-Firewall-1-INPUT -m state &ndash;state NEW -m tcp -p tcp &ndash;dport 80 -j ACCEPT<br /> 郁闷.请把上面复制到记事本里,然后把&ndash;state这段&ndash;改成小写的,再操作.否则粘贴时会出现乱码.<br /> b.关闭防火墙{不推荐}.<br /> service iptables stop<br /> c.重置加载防火墙<br /> service iptables restart</p> <p>6. 安装phpMyAdmin<br /> 进入phpMyAdmin官方下载最新版本后,上传到你的网站目录下,然后进行配置。只需几步即可搞定。<br /> a. config.sample.inc.php更名为config.inc.php;<br /> b. 打开config.inc.php文件,进行以下修改;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;controluser&#39;] = &lsquo;pma&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;controlpass&#39;] = &lsquo;pmapass&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;pmadb&#39;] = &lsquo;phpmyadmin&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;bookmarktable&#39;] = &lsquo;pma_bookmark&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;relation&#39;] = &lsquo;pma_relation&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;table_info&#39;] = &lsquo;pma_table_info&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;table_coords&#39;] = &lsquo;pma_table_coords&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;pdf_pages&#39;] = &lsquo;pma_pdf_pages&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;column_info&#39;] = &lsquo;pma_column_info&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;history&#39;] = &lsquo;pma_history&rsquo;;<br /> // $cfg[&#39;Servers&#39;][$i][&#39;designer_coords&#39;] = &lsquo;pma_designer_coords&rsquo;;</p> <p>去掉每行前面的//;<br /> c.$cfg[&#39;blowfish_secret&#39;] = &rdquo;; |修改为| $cfg[&#39;blowfish_secret&#39;] = &lsquo;http&rsquo;;<br /> d.$cfg[&#39;Servers&#39;][$i][&#39;controluser&#39;] = &lsquo;pma&rsquo;; |把&rsquo;pma&rsquo;修改为你的帐号|<br /> e.$cfg[&#39;Servers&#39;][$i][&#39;controlpass&#39;] = &lsquo;pmapass&rsquo;; |把&rsquo;pmapass设置为你的mysql登录密码|<br /> f. $cfg[&#39;blowfish_secret&#39;] = &rdquo;; | 添加短语密码例如:$cfg[&#39;blowfish_secret&#39;] = &lsquo;onohot&rsquo;|<br /> </p>
RangeTime:0.007264s
RangeMem:211.63 KB
返回顶部 留言