apache2 web服务器在localhost上运行但无法上线

时间:2018-03-07 22:22:44

标签: webserver apache2 ubuntu-16.04

我的网站无法上线!


The following is my web server setup.
1. Rogers modem – Hitron CODA-4582
2. Port Forwarding Application Name Public Private Protocol Local IP Address HTTP 80 – 80 800 – 800 TCP 192.168.0.201 HTTPS 443 – 443 883 – 883 TCP 192.168.0.201
3. Operating System - ubuntu 16.0.4 Apache2 Sever /etc/apache2.conf file. I modified two things. a. Uncommented the line ServerRoot “/etc/apache2” b. Appended one line at the end of the file: ServerName my_rogers_IP_address. I executed a command: sudo app info “Apache Full” The output is Profile: Apache Full Title: Web Server (HTTP,HTTPS) Description: Apache v2 is the next generation of the omnipresent Apache web server. Ports: 80,443/tcp Then, I executed another command: sudo ufw allow in “Apache Full”

我以为自己做了我需要做的事。所以,我打开浏览器进行测试。它仅适用于127.0.0.1或localhost。如果我输入http://my_rogers_IP_address,它将无效。 有人可以给我指针吗? 提前谢谢!

2 个答案:

答案 0 :(得分:0)

您需要将apacheserver指向可以实际托管您网站的主机。 Localhost只是计算机和服务器之间的本地循环。我建议使用免费的Heroku或Cloud9。此外,您可以为您的站点购买静态IP,但这不符合成本效益。无论您是拥有资金还是只是为了好玩,都取决于您。

答案 1 :(得分:0)

I got my problem solved!!
It is my bad! Everything is fine except the private port setting.
The private port must be within the public port range.
Everything is working fine now. Hope this can help someone else.
Good day!
相关问题