加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_丽江站长网 (http://www.0888zz.com/)- 科技、建站、数据工具、云上网络、机器学习!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Linux+Apache+MySQL+PHP5的安装配置

发布时间:2016-05-28 00:23:54 所属栏目:Linux 来源:网络整理
导读:服务器系统环境:CentOS 6.3 客户端系统环境:Windows 7 ultimate(x86)sp1 简体中文旗舰版 ※本文档描述了如何在Linux服务器配置Apache、Mysql、PHP5 LAMP(L

重启MySql

[root@server ~]# service mysqld restart
停止 mysqld: [确定]
正在启动 mysqld: [确定]
重启Apche
[root@server ~]# service httpd restart
停止 httpd: [确定]
正在启动 httpd:httpd: apr_sockaddr_info_get() failed for server
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[确定]

配置编辑文件:

7、Apache配置

个人习惯,修改配置文件首先要备份。

[root@server ~]# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.confbak  #备份

[root@server ~]# vim /etc/httpd/conf/httpd.conf   #编辑文件

小提示:

:set nu    #显示行号

:set nonu  #取消行号

pgUp        #上一页

pgDn        #下一页

44 ServerTokens OS  #在44行 修改为:ServerTokens Prod (在出现错误页的时候不显示服务器操作系统的名称)

536 ServerSignature On  #在536行 修改为:ServerSignature Off (在错误页中不显示Apache的版本)

331 Options Indexes FollowSymLinks  #在331行 修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录)

796 #AddHandler cgi-script .cgi #在796行 取消“#” 修改为:AddHandler cgi-script .cgi .pl (允许扩展名为.pl的CGI脚本运行)

338 AllowOverride None  #在338行 修改为:AllowOverride All (允许.htaccess)

759 AddDefaultCharset UTF-8 #在759行 修改为:AddDefaultCharset GB2312 (添加GB2312为默认编码)

554 Options Indexes MultiViews FollowSymLinks #在554行 修改为 Options MultiViews FollowSymLinks(不在浏览器上显示树状目录结构)

402 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)

76 KeepAlive Off #在76行 修改为:KeepAlive On (允许程序性联机)

83 MaxKeepAliveRequests 100  #在83行 修改为:MaxKeepAliveRequests 1000 (增加同时连接数)

:wq   #保存退出

重启

[root@server ~]# service httpd restart

停止 httpd:[确定]

正在启动 httpd:httpd: apr_sockaddr_info_get() failed for server

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

[确定]

[root@server ~]# cp /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.confbak    #备份

[root@server ~]# cp /var/www/error/noindex.html /var/www/error/noindex.htmlbak       #备份

[root@server ~]# rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html     #删除默认2个测试页

重启

[root@server ~]# service httpd restart

停止 httpd: [确定]

正在启动 httpd:httpd: apr_sockaddr_info_get() failed for server

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

[确定]

(编辑:应用网_丽江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读