VPS OS Debian 6 : 如何 VPS 配置可以用浏览器访问 IP:PORT
VPS OS Debian 6 : how the VPS configuration that can be accessed with a browser IP:PORT
我是 VPS (OS Debian 6) 的新手。以下是我试过的:
- 创建文件:var/www/say-hello/index.php
- 复制并编辑文件:/etc/apache2/sites-available# cp default say-hello
- /etc/apache2/sites-available# a2dissite 默认值
- /etc/apache2/sites-available#a2ensite 打招呼
- /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),但不起作用
浏览器错误 'The connection has timed out'
我的问题:
是不是还有其他配置或者我做的步骤有问题?
提前致谢
因为你定义的是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 重启
假设您没有防火墙。
希望这有帮助。
我是 VPS (OS Debian 6) 的新手。以下是我试过的:
- 创建文件:var/www/say-hello/index.php
- 复制并编辑文件:/etc/apache2/sites-available# cp default say-hello
- /etc/apache2/sites-available# a2dissite 默认值
- /etc/apache2/sites-available#a2ensite 打招呼
- /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),但不起作用 浏览器错误 'The connection has timed out'
我的问题: 是不是还有其他配置或者我做的步骤有问题?
提前致谢
因为你定义的是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 重启
假设您没有防火墙。 希望这有帮助。