Board logo

标题: [求助] nginx+apache 同一公网IP不同端口访问站点配置文件的问题 [打印本页]

作者: oldband    时间: 2016-4-15 13:20     标题: nginx+apache 同一公网IP不同端口访问站点配置文件的问题

aliyun centos6.5 64bit
V3完整系统编译安装
想要做 ip:80  ip:9999  这么两个站点

刚装好V3后默认是nginx+apache模式,在[系统设置]中[web服务端口]设置了:80,9999
防火墙中设置了tcp 9999端口通行

新建站点:
[域名]设置:localhost
[目录]设置:/www/web/goodhappy
[使用端口]选择9999

创建完站点发现ip:9999不能访问,[端口管理]中并未发现9999这个端口被监听,就去看站点配置文件

nginx的conf文件:

server {
        listen       9999;
        root /www/web/goodhappy/public_html;
        server_name localhost;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
        }
        location ~ /\.ht {
                deny  all;
        }
        location / {
                try_files $uri @apache;
        }
        location @apache {
                 proxy_pass http://127.0.0.1:88;
                 include naproxy.conf;
        }
}

apache的conf文件:

<VirtualHost *:88>
DocumentRoot /www/web/goodhappy/public_html
ServerName localhost
ErrorDocument 400 /errpage/400.html
ErrorDocument 403 /errpage/403.html
ErrorDocument 404 /errpage/404.html
php_admin_value open_basedir /www/web/goodhappy:/tmp
<IfModule mod_deflate.c>
    DeflateCompressionLevel 7
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
    AddOutputFilter DEFLATE css js html htm gif jpg png bmp php
</IfModule>
</VirtualHost>
<Directory /www/web/goodhappy>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

如果设置成单一的nginx模式,端口就没有问题,设置成单一apache模式也不能访问。重启web服务也试过依然不能访问。

apache单一模式下的conf文件:

<VirtualHost *:9999>
DocumentRoot /www/web/goodhappy/public_html
ServerName localhost
ErrorDocument 400 /errpage/400.html
ErrorDocument 403 /errpage/403.html
ErrorDocument 404 /errpage/404.html
php_admin_value open_basedir /www/web/goodhappy:/tmp
<IfModule mod_deflate.c>
    DeflateCompressionLevel 7
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
    AddOutputFilter DEFLATE css js html htm gif jpg png bmp php
</IfModule>
</VirtualHost>
<Directory /www/web/goodhappy>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

发现文件中没有配置 listen 9999 所以系统根本没有监听9999
现在问题来了:

1、wdcp在nginx+apache模式时是不是不能设置同一个IP加上不同端口来分别访问不同的站点?
2、apache模式、nginx+apache模式在系统中设置了[web服务端口]但依然没有监听这些端口,这是不是一个bug?(nginx模式下没有问题)
作者: admin    时间: 2016-4-15 17:09

N+A模式,显示88是正常的
单A模式,我们检查下
作者: oldband    时间: 2016-4-15 18:26

回复 2# admin


    单A模式是有88端口的,N+A和单A总感觉那里不对,之前一直没搞定所以一直只用了单N模式。




欢迎光临 WDlinux官方论坛 (http://www.wdlinux.cn/bbs/) Powered by Discuz! 7.2