免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 22388 | 回复: 0
打印 上一主题 下一主题

[其他] Apache 配置子域名问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2018-01-07 12:56 |只看该作者 |倒序浏览
本帖最后由 Samdy_Chan 于 2018-01-07 16:32 编辑

您好!我已经开启了花生壳客户端。并用花生壳客户端映射了主域名 myapps.iego.net 的本地 80 端口,用 myapps.iego.net 访问能打开页面,但打开的页面是我本机的服务器的根目录的页面,不是我在附件压缩文件 apache24.rar 文件中的 apache24/conf/vhost/myapps.conf 中定义的路径页面。。Apache 配置文件 httpd.conf 中开启了 Include conf/vhost/*.conf 的,并且在 apache24/conf/vhost/ 目录下配置了主域名(myapps.iego.net)的配置文件 myapps.conf 和 子域名(api.myapps.iego.net)的配置文件 api-myapps.conf。
具体详见附件,麻烦帮忙看看是不是配置错误了?应该怎样在 Apache 中配置二级子域名呢?
谢谢!


apache24.rar (2.15 KB, 下载次数: 7)
==== httpd.conf 配置内容如下==============


Define SRVROOT "D:/AppServ/Apache24"
ServerRoot "${SRVROOT}"


Listen 80

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule status_module modules/mod_status.so
LoadModule php5_module D:/AppServ/php5/php5apache2_4.dll


<IfModule mod_php5.c>
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps
</IfModule>

<IfModule mod_php7.c>
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps
</IfModule>



PHPIniDir "D:/AppServ/php5/"

<IfModule unixd_module>
User daemon
Group daemon

</IfModule>


ServerAdmin Samdy_Chan@139.com

ServerName 127.0.0.1:80

<Directory />
    AllowOverride none
    Require all denied
</Directory>


DocumentRoot "D:/AppServ/www"
<Directory "D:/AppServ/www">
    Options Indexes FollowSymLinks

    AllowOverride All

    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error.log"

LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access.log" common

</IfModule>

<IfModule alias_module>


    ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"

</IfModule>

<IfModule cgid_module>
</IfModule>

<Directory "${SRVROOT}/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig conf/mime.types

    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz



</IfModule>

Include conf/extra/httpd-autoindex.conf

Include conf/extra/httpd-info.conf

<IfModule proxy_html_module>
Include conf/extra/httpd-proxy-html.conf
</IfModule>


<IfModule ssl_module>
</IfModule>

<IfModule http2_module>
    ProtocolsHonorOrder On
    Protocols h2 h2c http/1.1
</IfModule>


Include conf/vhost/*.conf


Listen 8080
<VirtualHost *:8080>
DocumentRoot "D:/AppServ/www/pigcms"
</VirtualHost>

Listen 8081
<VirtualHost *:8081>
DocumentRoot "D:/AppServ/www/weimi"
</VirtualHost>

Listen 8082
<VirtualHost *:8082>
DocumentRoot "D:/AppServ/www/weiqing"
</VirtualHost>

Listen 8083
<VirtualHost *:8083>
DocumentRoot "D:/AppServ/www/weizan"
</VirtualHost>

Listen 8084
<VirtualHost *:8084>
DocumentRoot "D:/AppServ/www/tpl/homeDesign"
</VirtualHost>




==== conf/vhost/api-myapps.conf 配置内容如下===
<VirtualHost api.myapps.iego.net:80>
DocumentRoot "D:\AppServ\www\ecshop\appserver\public"
ServerName api.myapps.iego.net
<Directory "D:\AppServ\www\ecshop\appserver\public">
    SetOutputFilter DEFLATE
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    DirectoryIndex index.html index.php
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.php [L]
</Directory>
</VirtualHost>



==== conf/vhost/myapps.conf 配置内容如下===
<VirtualHost myapps.iego.net:80>
DocumentRoot "D:\AppServ\www\ecshop\ecshop"
ServerName myapps.iego.net
<Directory "D:\AppServ\www\ecshop\ecshop">
    SetOutputFilter DEFLATE
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    DirectoryIndex index.html index.php
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.php [L]
</Directory>
</VirtualHost>



您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP