CentOS 6.5系统安装配置Apache+PHP5+MySQL
这是主要讲用yum install来安装Apache+PHP5+MySQL
工具/原料
CentOS 6.5
需要网络
安装
1、安装Apacheyum install -y httpd # 静默安装httpd,会从yum源中自动下载httpd/etc/init.d/httpd start#启动Apachechkconfig httpd on #设为开机启动/etc/init.d/httpd restart #重启Apache

3、为root账户设置密码mysql_secure_installation原始密码为空,直接回车,根据提示输入y,然后输入2次密码

5、安装PHP5yum install -y php

配置
1、Apache配置vim /etc/httpd/conf/httpd.conf #编辑文件(下面选项自己选择修改配置)ServerTokens OS #在44行 修改为:ServerTokens Prod (在出现错误页的时候不显示服务器操作系统的名称)ServerSignature On #在536行 修改为:ServerSignature Off (在错误页中不显示Apache的版本)Options Indexes FollowSymLinks #在331行 修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录)#AddHandler cgi-script .cgi #在796行 修改为:AddHandler cgi-script .cgi .pl (允许扩展名为.pl的CGI脚本运行)AllowOverride None #在338行 修改为:AllowOverride All (允许.htaccess)AddDefaultCharset UTF-8 #在759行 修改为:AddDefaultCharset GB2312 (添加GB2312为默认编码) Options Indexes MultiViews FollowSymLinks #在554行 修改为 Options MultiViews FollowSymLinks(不在浏览器上显示树状目录结构)DirectoryIndex index.html index.html.var #在402行 修改为:DirectoryIndex index.html index.htm Default.html Default.htm index.php Default.php index.html.var (设置默认首页文件,增加index.php)KeepAlive Off #在76行 修改为:KeepAlive On (允许程序性联机)MaxKeepAliveRequests 100 #在83行 修改为:MaxKeepAliveRequests 1000 (增加同时连接数):wq! #保存退出/etc/init.d/httpd restart#重启rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html #删除默认测试页

3、MySQL 允许远程登录mysql -u root -pEnter Password: <your new password>mysql>GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;

5、重启防火墙service iptables restart

2、然后,在浏览器中打开
