CentOS 下 Apache 配置多域名或者多端口映射
CentOS 下 Apache 默认网站根目录为/var/www/html,假如我默认存了一个 CI 项目在 html 文件夹里,同时
服务器的外网 IP 为 ExampleIp,因为使用的是 MVC 框架,Apache 需开启重定向功能。
/etc/httpd/conf/httpd.conf 文件配置如下:
DocumentRoot "/var/www/html/CI"
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "/var/www/html/CI">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI
MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess 5les.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthCon5g Limit
#
AllowOverride All
#
# Controls who can get stu6 from this server.
#
Order allow,deny
Allow from all
</Directory>
评论0