【问题标题】:VPS OS Debian 6 : how the VPS configuration that can be accessed with a browser IP:PORT [closed]VPS OS Debian 6:如何使用浏览器 IP:PORT 访问 VPS 配置 [关闭]
【发布时间】:2016-05-10 07:37:35
【问题描述】:

我是 VPS(操作系统 Debian 6)的新手。以下是我尝试过的:

  1. 创建文件:var/www/say-hello/index.php
  2. 复制和编辑文件:/etc/apache2/sites-available# cp default say-hello
  3. /etc/apache2/sites-available#a2dissite 默认
  4. /etc/apache2/sites-available# a2ensite say-hello
  5. /etc/init.d/apache2 重新加载

apache 重新加载成功,没有显示错误,但显示 '[warn] NameVirtualHost *:80 has no VirtualHosts'

这是 say-hello 文件,我必须从 默认文件进行更改:

<VirtualHost _default_:10000>
   ServerPath /var/www/say-hello
   # just so apache invokes suexec (fastcgiwrapper) on fastcgi request
   SuexecUserGroup www-data www-data
</VirtualHost>

我想通过浏览器访问:http://xxx.xx.xx.xxx:10000/index.php(xx 是 VPS 的 IP),但无法使用 出现浏览器错误'连接已超时'

我的问题: 是否有其他配置或我做的步骤有问题?

提前致谢

【问题讨论】:

    标签: apache debian vps


    【解决方案1】:

    既然你已经定义为 10000 端口中的页面,你需要在 /etc/apache2/ports.conf 中打开那个端口,添加一行告诉 apache 监听 10000。 像这样:

    # If you just change the port or add more ports here, you will likely also
    # have to change the VirtualHost statement in
    # /etc/apache2/sites-enabled/000-default.conf
    
    Listen 80
    Listen 10000
    
    <IfModule ssl_module>
        Listen 443
    </IfModule>
    
    <IfModule mod_gnutls.c>
        Listen 443
    </IfModule>
    

    然后重启apache。

    /etc/init.d/apache2 重启

    假设您没有对端口进行防火墙处理。 希望这会有所帮助。

    【讨论】:

    • 很好,可以在 debian 的 iptables 中添加规则来打开新端口,谢谢您的帮助... :-)
    猜你喜欢
    • 1970-01-01
    • 2010-10-08
    • 1970-01-01
    • 2013-09-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-17
    相关资源
    最近更新 更多