CentOS 5.6 快速搭建LAMP(3)
来源:未知 责任编辑:责任编辑 发表时间:2014-03-23 22:30 点击:次
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi ← 找到这一行,去掉行首的“#”,并在行尾添加“.pl”
↓
AddHandler cgi-script .cgi .pl ← 允许扩展名为.pl的CGI脚本运行
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None ← 找到这一行,将“None”改为“All”
↓
AllowOverride All ← 变为此状态,允许.htaccess
#
# Specify a default charset for all pages sent out. This is
# always a good idea and opens the door for future internationalisation
# of your web site, should you ever want it. Specifying it as
# a default does little harm; as the standard dictates that a page
# is in iso-8859-1 (latin1) unless specified otherwise i.e. you
# are merely stating the obvious. There are also some security
# reasons in browsers, related to javascript and URL parsing
# which encourage you to always set a default char set.
#
AddDefaultCharset UTF-8 ← 找到这一行,在行首添加“#”
↓
#AddDefaultCharset UTF-8 ← 不使用UTF-8作为网页的默认编码
AddDefaultCharset GB2312 ← 并接着添加这一行(添加GB2312为默认编码)
<Directory "/var/www/icons"> ← 找到这一个标签,并在标签中更改相应选项
Options Indexes MultiViews ← 找到这一行,将“Indexes”删除
↓
Options MultiViews ← 变为此状态(不在浏览器上显示树状目录结构)
AllowOverride None
Order allow,deny
Allow from all
</Directory>
命令行下: chkconfig httpd on ← 设置HTTP服务自启动
chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ← 确认2--5为on的状态就OK
/etc/rc.d/init.d/httpd start ← 启动HTTP服务
Starting httpd: [ OK ] ← 启动成功会出现OK
在浏览器浏览http://127.0.0.1 就可以看到测试页面出现,表示安装成功。3.安装php
命令行下:yum -y install php
Setting up Install Process
相关新闻>>
- 发表评论
-
- 最新评论 更多>>