Ubuntu中的Apache Web服务器状态
我已经在Ubuntu机器中安装了Apache Web服务器,并将端口更改为8080(/etc/apache2/apache2.conf,/etc/apache2/000-default.conf),并能够
使用以下命令在浏览器中成功加载测试页面(也安装了W3M):
sudo apache2ctl start
sudo apache2ctl stop
sudo apache2ctl status
但是,sudo apache2ctl状态在以下错误:
w3m: Can't load http://localhost:80/server-status
我猜Apache2ctl状态正在拾取默认端口而不是8080。任何人都可以指导在哪里更改该
I have installed apache webserver in my Ubuntu machine and changed port to 8080 (/etc/apache2/apache2.conf, /etc/apache2/000-default.conf) and able to successfully load test page in browser
Using below commands for administration (installed w3m as well):
sudo apache2ctl start
sudo apache2ctl stop
sudo apache2ctl status
However, sudo apache2ctl status is giving below error:
w3m: Can't load http://localhost:80/server-status
I guess apache2ctl status is picking up default port instead of 8080. Can anyone please guide where to change that
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您尚未提及您在apache2.conf file和000-default.conf中更改了什么。
您需要在apache2.conf中设置
listing 8080
的值,如果您定义了虚拟主机,则需要将打开的虚拟代码标签设置为< virtualHost *:8080>
You have not mentioned what did you change in apache2.conf file and 000-default.conf.
you need to set the value of
Listen 8080
in apache2.conf and if you have defined virtual host you need to set the opening virtual-code tag as<VirtualHost *:8080>
如果您坚持将其更改为端口8080,则它生活在
/usr/sbin/apache2ctl
文件中。只需编辑并搜索statusurl =
。不过,您是否使用端口8080的原因?
在您的
/etc/sites-enabled/000-default.conf
(希望您已启用它)中,添加以下行上面的&lt; virtialhost *:在顶部附近的80&gt;
线。这将仅为Local-Host创建一个覆盖/短路。确保在
/etc/apache2/ports.conf
中启用端口80。您应该查看:和/或
重新启动服务器:
然后尝试:
sudo apache2ctl status
再次..如果您在VirtualHost内部有一个重定向for&lt;*:80&gt; (我将所有内容都重定向到端口:443/ssl),上面的添加行将拾取Localhost VirtualHost(第一个)AMD允许使用
http:// localhost/code> type urls当然也允许哪个允许
apache2ctl
用于Localhost HTTP调用。If you insist on changing it to port 8080, it lives inside the
/usr/sbin/apache2ctl
file. Just edit and search forSTATUSURL=
.Is there a reason you are using port 8080, though?
In your
/etc/sites-enabled/000-default.conf
(hopefully you have it enabled), add the following lines above the<VirtualHost *:80>
line near the top. This will create an override/short-circuit for localhost ONLY.Make sure port 80 is enabled in
/etc/apache2/ports.conf
. You should see:and/or
and restart server:
then try:
sudo apache2ctl status
again..This also works if you have a redirect inside VirtualHost for <*:80> (mine redirects everything to port :443/SSL), the added lines above will pickup the localhost VirtualHost (first) amd allow the use of
http://localhost/
type urls which of course will also allowapache2ctl
to work for localhost http calls.