AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[localhost](ubuntu)

Martin Hope
cryptic
Asked: 2020-12-14 05:34:56 +0800 CST

如果我的所有 PHP 页面在 Apache2 中出现空白,我该怎么办?

  • 0

这是我的问题

最近我清除了所有 LAMP 包,因为我无法让虚拟主机与我的本地 wordpress 安装一起工作。但是即使在安装了所有软件包之后,PHP 页面也根本无法加载。它们都是空白的,如果您要求查看页面源代码,您可以在那里看到 php 源代码。

我附上了我已经尝试过的东西的列表以及我认为您可能需要的日志和配置。请帮助我,让我知道你是否需要更多的东西来解决这个问题。

我已经尝试过的事情:

  1. 更新所有包
  2. 清除并重新安装所有 LAMP 软件包
  3. mpm_event 已被禁用
  4. php 模块在 apache 模块中启用
  5. 尝试设置首选 php 版本
  6. libapache2_mod_php 已经安装
  7. 安装指定版本号的php和其他模块
  8. 开启所有 PHP 错误报告
  9. 将以下代码添加到 apache2.conf 中,这会导致 Apache 在我的情况下崩溃:
AddHandler php5-script .php
AddType text/html .php
  1. 卸载所有包并使用“lamp-server^”包安装灯
  2. 在用户目录中启用 PHP
  3. 在 php.ini 中启用短标签
  4. default_mimetype = "text/html"已在我的 php.ini 中启用

这是我的 Apache 错误日志

[Fri Dec 11 09:46:11.126711 2020] [mpm_prefork:notice] [pid 1447] AH00163: Apache/2.4.46 (Ubuntu) configured -- resuming normal operations
[Fri Dec 11 09:46:11.126805 2020] [core:notice] [pid 1447] AH00094: Command line: '/usr/sbin/apache2'
[Fri Dec 11 10:08:32.375532 2020] [mpm_prefork:notice] [pid 1447] AH00169: caught SIGTERM, shutting down

这是我的 Apache 访问日志显示的请求

::1 - - [10/Dec/2020:10:16:30 +0530] "GET /info.php HTTP/1.1" 200 224 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"

这是我的 PHP 模块 mods-enabled conf:

<FilesMatch ".+\.ph(ar|p|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
    SetHandler application/x-httpd-php-source
    # Deny access to raw php sources by default
    # To re-enable it's recommended to enable access to the files
    # only in specific virtual host or directory
    Require all denied
</FilesMatch>
# Deny access to files without filename (e.g. '.php')
<FilesMatch "^\.ph(ar|p|ps|tml)$">
    Require all denied
</FilesMatch>

# Running PHP scripts in user directories is disabled by default
# 
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
#<IfModule mod_userdir.c>
#    <Directory /home/*/public_html>
#        php_admin_flag engine Off
#    </Directory>
#</IfModule>

附言

  • 我安装了 php 7.4
  • 早些时候我安装了 mariadb 服务器
  • 现在我安装了 mysql-server
server php apache2 lamp localhost
  • 1 个回答
  • 1659 Views
Martin Hope
01AutoMonkey
Asked: 2020-11-21 11:52:06 +0800 CST

Firefox/Chrome,如何将 localhost 和 wikipedia.org 列入白名单?

  • 0

在 Firefox 和 Chrome 上,我如何允许本地网络和Wikipedia(localhost、192.168.1.*、*.wikipedia.org等)但阻止其他所有内容?本质上是一个白名单。但是,我仍然希望系统上的其他工具能够完全访问 Internet,例如git、wget等,因此该解决方案不得影响它们。

本质上是在浏览器级别而不是在系统级别将互联网列入白名单。

networking firefox browser google-chrome localhost
  • 2 个回答
  • 947 Views
Martin Hope
Doug Fir
Asked: 2020-10-05 05:44:45 +0800 CST

如何停止在 localhost:8787 上加载应用程序 rstudio

  • 1

(欢迎标记建议,我不知道如何正确分类或标记我的问题)

Ubuntu 18.04。

我有一个谜。当我访问 localhost:8787 时,我被带到 rstudio 登录屏幕:

在此处输入图像描述

我不知道在 localhost:8787 托管 rstudio 应用程序的进程是什么。几周前,我确实为通过 localhost:8787 访问的 rstudio 运行了一个 docker 容器。但是,该容器已被停止、删除,事实上,我已经删除了所有 docker 镜像:

(这里没有容器)

docker container ls
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

甚至没有要运行的图像:

docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

在搜索“如何判断本地主机上托管的进程”后,我发现了一篇帖子。我不确定在这里使用什么搜索词。

经过一番搜索,我在终端中运行了这个命令:

netstat -aon | grep 8787

哪个返回了这个:

netstat -aon | grep 8787
tcp        0      0 0.0.0.0:8787            0.0.0.0:*               LISTEN      off (0.00/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41490         TIME_WAIT   timewait (47.91/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41212         TIME_WAIT   timewait (16.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41402         TIME_WAIT   timewait (39.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41344         TIME_WAIT   timewait (32.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41144         TIME_WAIT   timewait (7.76/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41340         TIME_WAIT   timewait (31.84/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41090         TIME_WAIT   timewait (0.76/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41096         TIME_WAIT   timewait (1.74/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41200         TIME_WAIT   timewait (14.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41556         TIME_WAIT   timewait (56.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41080         TIME_WAIT   timewait (0.00/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41356         TIME_WAIT   timewait (33.85/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41240         TIME_WAIT   timewait (19.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41492         TIME_WAIT   timewait (48.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41294         TIME_WAIT   timewait (26.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41078         TIME_WAIT   timewait (0.00/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41324         TIME_WAIT   timewait (29.83/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41286         TIME_WAIT   timewait (25.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41436         TIME_WAIT   timewait (41.86/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41388         TIME_WAIT   timewait (37.86/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41282         TIME_WAIT   timewait (24.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41306         TIME_WAIT   timewait (27.83/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41198         TIME_WAIT   timewait (14.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41564         TIME_WAIT   timewait (57.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41170         TIME_WAIT   timewait (10.79/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41548         TIME_WAIT   timewait (55.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41520         TIME_WAIT   timewait (51.92/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41216         TIME_WAIT   timewait (16.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41348         TIME_WAIT   timewait (32.89/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41394         TIME_WAIT   timewait (38.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41118         TIME_WAIT   timewait (4.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41226         TIME_WAIT   timewait (17.81/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41298         TIME_WAIT   timewait (26.83/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41130         TIME_WAIT   timewait (5.81/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41544         TIME_WAIT   timewait (54.92/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41498         TIME_WAIT   timewait (48.91/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41450         TIME_WAIT   timewait (43.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41562         TIME_WAIT   timewait (56.95/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41202         TIME_WAIT   timewait (14.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41092         TIME_WAIT   timewait (1.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41106         TIME_WAIT   timewait (2.76/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41196         TIME_WAIT   timewait (14.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41352         TIME_WAIT   timewait (33.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41574         TIME_WAIT   timewait (58.62/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41554         TIME_WAIT   timewait (55.93/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41272         TIME_WAIT   timewait (23.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41338         TIME_WAIT   timewait (31.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41560         TIME_WAIT   timewait (56.94/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41390         TIME_WAIT   timewait (37.93/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41452         TIME_WAIT   timewait (43.86/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41346         TIME_WAIT   timewait (32.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41570         TIME_WAIT   timewait (57.96/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41254         TIME_WAIT   timewait (21.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41486         TIME_WAIT   timewait (47.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41350         TIME_WAIT   timewait (32.92/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41382         TIME_WAIT   timewait (36.87/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41110         TIME_WAIT   timewait (3.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41374         TIME_WAIT   timewait (35.87/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41274         TIME_WAIT   timewait (23.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41270         TIME_WAIT   timewait (23.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41172         TIME_WAIT   timewait (11.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41244         TIME_WAIT   timewait (20.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41482         TIME_WAIT   timewait (46.89/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41370         TIME_WAIT   timewait (35.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41208         TIME_WAIT   timewait (15.79/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41578         TIME_WAIT   timewait (58.96/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41292         TIME_WAIT   timewait (25.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41114         TIME_WAIT   timewait (3.77/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41156         TIME_WAIT   timewait (9.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41460         TIME_WAIT   timewait (44.89/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41168         TIME_WAIT   timewait (10.78/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41310         TIME_WAIT   timewait (28.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41440         TIME_WAIT   timewait (42.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41160         TIME_WAIT   timewait (9.78/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41552         TIME_WAIT   timewait (55.92/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41584         TIME_WAIT   timewait (59.94/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41234         TIME_WAIT   timewait (18.81/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41132         TIME_WAIT   timewait (6.55/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41366         TIME_WAIT   timewait (34.86/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41458         TIME_WAIT   timewait (44.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41456         TIME_WAIT   timewait (44.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41404         TIME_WAIT   timewait (39.86/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41084         TIME_WAIT   timewait (0.54/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41386         TIME_WAIT   timewait (37.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41210         TIME_WAIT   timewait (15.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41098         TIME_WAIT   timewait (1.74/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41134         TIME_WAIT   timewait (6.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41320         TIME_WAIT   timewait (29.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41514         TIME_WAIT   timewait (50.92/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41312         TIME_WAIT   timewait (28.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41120         TIME_WAIT   timewait (4.76/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41082         TIME_WAIT   timewait (0.00/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41568         TIME_WAIT   timewait (57.94/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41462         TIME_WAIT   timewait (44.89/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41566         TIME_WAIT   timewait (57.62/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41360         TIME_WAIT   timewait (34.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41104         TIME_WAIT   timewait (2.75/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41536         TIME_WAIT   timewait (53.92/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41586         TIME_WAIT   timewait (59.96/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41326         TIME_WAIT   timewait (29.83/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41276         TIME_WAIT   timewait (24.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41378         TIME_WAIT   timewait (36.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41540         TIME_WAIT   timewait (54.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41330         TIME_WAIT   timewait (30.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41392         TIME_WAIT   timewait (38.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41384         TIME_WAIT   timewait (37.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41488         TIME_WAIT   timewait (47.89/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41162         TIME_WAIT   timewait (9.79/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41238         TIME_WAIT   timewait (19.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41504         TIME_WAIT   timewait (49.90/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41194         TIME_WAIT   timewait (13.79/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41300         TIME_WAIT   timewait (26.83/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41242         TIME_WAIT   timewait (19.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41476         TIME_WAIT   timewait (46.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41572         TIME_WAIT   timewait (58.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41204         TIME_WAIT   timewait (15.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41538         TIME_WAIT   timewait (53.92/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41176         TIME_WAIT   timewait (11.78/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41108         TIME_WAIT   timewait (3.55/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41150         TIME_WAIT   timewait (8.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41480         TIME_WAIT   timewait (46.89/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41420         TIME_WAIT   timewait (40.87/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41532         TIME_WAIT   timewait (53.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41534         TIME_WAIT   timewait (53.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41232         TIME_WAIT   timewait (18.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41088         TIME_WAIT   timewait (0.74/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41576         TIME_WAIT   timewait (58.94/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41252         TIME_WAIT   timewait (21.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41124         TIME_WAIT   timewait (5.55/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41398         TIME_WAIT   timewait (38.87/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41526         TIME_WAIT   timewait (52.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41308         TIME_WAIT   timewait (27.83/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41468         TIME_WAIT   timewait (45.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41220         TIME_WAIT   timewait (17.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41102         TIME_WAIT   timewait (2.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41246         TIME_WAIT   timewait (20.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41296         TIME_WAIT   timewait (26.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41542         TIME_WAIT   timewait (54.62/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41218         TIME_WAIT   timewait (16.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41508         TIME_WAIT   timewait (50.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41412         TIME_WAIT   timewait (40.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41258         TIME_WAIT   timewait (21.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41336         TIME_WAIT   timewait (31.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41328         TIME_WAIT   timewait (30.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41512         TIME_WAIT   timewait (50.91/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41380         TIME_WAIT   timewait (36.85/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41364         TIME_WAIT   timewait (34.85/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41288         TIME_WAIT   timewait (25.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41256         TIME_WAIT   timewait (21.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41582         TIME_WAIT   timewait (59.62/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41186         TIME_WAIT   timewait (12.79/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41400         TIME_WAIT   timewait (39.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41302         TIME_WAIT   timewait (27.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41368         TIME_WAIT   timewait (35.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41550         TIME_WAIT   timewait (55.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41182         TIME_WAIT   timewait (12.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41158         TIME_WAIT   timewait (9.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41484         TIME_WAIT   timewait (47.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41112         TIME_WAIT   timewait (3.76/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41332         TIME_WAIT   timewait (30.83/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41580         TIME_WAIT   timewait (59.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41410         TIME_WAIT   timewait (40.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41524         TIME_WAIT   timewait (52.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41206         TIME_WAIT   timewait (15.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41224         TIME_WAIT   timewait (17.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41248         TIME_WAIT   timewait (20.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41448         TIME_WAIT   timewait (43.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41154         TIME_WAIT   timewait (8.78/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41362         TIME_WAIT   timewait (34.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41354         TIME_WAIT   timewait (33.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41230         TIME_WAIT   timewait (18.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41076         TIME_WAIT   timewait (0.00/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41116         TIME_WAIT   timewait (4.55/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41496         TIME_WAIT   timewait (48.90/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41188         TIME_WAIT   timewait (13.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41164         TIME_WAIT   timewait (10.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41446         TIME_WAIT   timewait (42.88/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41236         TIME_WAIT   timewait (19.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41438         TIME_WAIT   timewait (41.86/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41322         TIME_WAIT   timewait (29.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41260         TIME_WAIT   timewait (22.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41268         TIME_WAIT   timewait (23.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41516         TIME_WAIT   timewait (51.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41304         TIME_WAIT   timewait (27.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41192         TIME_WAIT   timewait (13.78/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41406         TIME_WAIT   timewait (39.87/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41316         TIME_WAIT   timewait (28.84/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41278         TIME_WAIT   timewait (24.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41472         TIME_WAIT   timewait (45.89/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41126         TIME_WAIT   timewait (5.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41432         TIME_WAIT   timewait (41.59/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41136         TIME_WAIT   timewait (6.76/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41358         TIME_WAIT   timewait (33.85/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41342         TIME_WAIT   timewait (31.86/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41140         TIME_WAIT   timewait (7.55/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41264         TIME_WAIT   timewait (22.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41222         TIME_WAIT   timewait (17.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41262         TIME_WAIT   timewait (22.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41470         TIME_WAIT   timewait (45.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41454         TIME_WAIT   timewait (43.87/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41152         TIME_WAIT   timewait (8.77/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41558         TIME_WAIT   timewait (56.62/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41138         TIME_WAIT   timewait (6.78/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41122         TIME_WAIT   timewait (4.77/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41334         TIME_WAIT   timewait (30.84/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41142         TIME_WAIT   timewait (7.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41510         TIME_WAIT   timewait (50.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41478         TIME_WAIT   timewait (46.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41502         TIME_WAIT   timewait (49.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41266         TIME_WAIT   timewait (22.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41314         TIME_WAIT   timewait (28.83/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41522         TIME_WAIT   timewait (51.93/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41178         TIME_WAIT   timewait (11.79/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41146         TIME_WAIT   timewait (7.78/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41434         TIME_WAIT   timewait (41.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41280         TIME_WAIT   timewait (24.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41128         TIME_WAIT   timewait (5.80/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41474         TIME_WAIT   timewait (45.89/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41376         TIME_WAIT   timewait (36.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41228         TIME_WAIT   timewait (18.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41418         TIME_WAIT   timewait (40.87/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41442         TIME_WAIT   timewait (42.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41190         TIME_WAIT   timewait (13.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41530         TIME_WAIT   timewait (52.92/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41250         TIME_WAIT   timewait (20.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41396         TIME_WAIT   timewait (38.86/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41372         TIME_WAIT   timewait (35.87/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41546         TIME_WAIT   timewait (54.93/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41528         TIME_WAIT   timewait (52.91/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41500         TIME_WAIT   timewait (49.60/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41180         TIME_WAIT   timewait (12.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41184         TIME_WAIT   timewait (12.78/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41506         TIME_WAIT   timewait (49.91/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41166         TIME_WAIT   timewait (10.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41518         TIME_WAIT   timewait (51.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41494         TIME_WAIT   timewait (48.61/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41214         TIME_WAIT   timewait (16.58/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41094         TIME_WAIT   timewait (1.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41086         TIME_WAIT   timewait (0.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41148         TIME_WAIT   timewait (8.56/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41290         TIME_WAIT   timewait (25.82/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41174         TIME_WAIT   timewait (11.57/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41100         TIME_WAIT   timewait (2.55/0/0)
tcp        0      0 127.0.0.1:8787          127.0.0.1:41444         TIME_WAIT   timewait (42.87/0/0)

这里发生了什么事?!为什么 localhost:8787 服务于 rstudio 应用程序,我该如何阻止它?

编辑:每条评论的输出dpkg -l | grep rstudio和下方:systemctl list-units --type service | grep -i rstudio

dpkg -l | grep rstudio
ii  rstudio                                    1.3.1093                                         amd64        RStudio
ii  rstudio-server                             1.3.1093                                         amd64        RStudio Server

和

systemctl list-units --type service | grep -i rstudio
rstudio-server.service                                loaded active running RStudio Server    
r webserver localhost rstudio
  • 1 个回答
  • 405 Views
Martin Hope
anx
Asked: 2020-06-07 21:37:45 +0800 CST

为什么 Ubuntu 会将 NXDOMAIN 视为解析为 localhost?

  • 0

每次由于域不存在(例如could not resolve host)而应该收到错误时,我都会收到有关连接到环回地址的错误:

$ curl -4 -v https://nonexist.invalid
Trying 127.0.0.1...

该问题仅在建立无线连接约 2 秒后才开始出现。短时间内,一切都按预期工作。

我正在使用systemd-resolved并且 dns 似乎正在工作:

$ readlink /etc/resolv.conf
../run/systemd/resolve/stub-resolve.conf
$ dig +short A example.com
192.0.2.1
$ dig +short A nonexist.invalid
$ systemd-resolve -t A nonexist.invalid
nonexist.invalid: resolve call failed: No appropriate name servers or networks for name found

如果名称解析看起来不错,为什么程序似乎仍将名称解析为127.0.0.1?

dns localhost systemd-resolved 18.04
  • 1 个回答
  • 221 Views
Martin Hope
lalebarde
Asked: 2020-01-06 03:24:30 +0800 CST

使用 wget 访问 Internet 时出现错误消息:Connecting to localhost (localhost)|::1|:8080... failed: Connection refused

  • 0

运行时:

wget https://gitlab.com/marsat/CTparental/uploads/35fd33508a49915869fa43820a7d2c36/ctparental_debian9_lighttpd_4.44.05-1.0_all.deb

结果如下:

converted 'https://gitlab.com/marsat/CTparental/uploads/35fd33508a49915869fa43820a7d2c36/ctparental_debian9_lighttpd_4.44.05-1.0_all.deb' (ANSI_X3.4-1968) -> 'https://gitlab.com/marsat/CTparental/uploads/35fd33508a49915869fa43820a7d2c36/ctparental_debian9_lighttpd_4.44.05-1.0_all.deb' (UTF-8)
--2020-01-05 12:12:22--  https://gitlab.com/marsat/CTparental/uploads/35fd33508a49915869fa43820a7d2c36/ctparental_debian9_lighttpd_4.44.05-1.0_all.deb
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:8080... failed: Connection refused.

这里有几个与服务器使用有关的问题,但我还没有找到一个供客户端使用的问题。想要的文件存在于 gitlab.com 上,我可以通过浏览器毫无问题地下载它。

我没有阻止任何事情的 iptables 规则:

iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

这是我的网络配置:

ifconfig 
eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          inet adr:192.168.0.xxx  Bcast:192.168.0.255  Masque:255.255.255.0
          adr inet6: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Lien
          adr inet6: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Global
          adr inet6: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:419919 errors:0 dropped:0 overruns:0 frame:0
          TX packets:238886 errors:19 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          RX bytes:519444509 (495.3 MiB)  TX bytes:27771976 (26.4 MiB)
          Interruption:17 

lo        Link encap:Boucle locale  
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1333 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1333 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1 
          RX bytes:150478 (146.9 KiB)  TX bytes:150478 (146.9 KiB)

如果我查看本地可用于测试的服务器:

netstat -an | grep "LISTEN "
tcp        0      0 0.0.0.0:54729           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:42711           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6463          0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:36479           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:53953           0.0.0.0:*               LISTEN     
tcp6       0      0 :::49801                :::*                    LISTEN     
tcp6       0      0 :::5355                 :::*                    LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::45331                :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 :::3128                 :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
tcp6       0      0 ::1:6010                :::*                    LISTEN     
tcp6       0      0 ::1:6011                :::*                    LISTEN     
tcp6       0      0 :::56891                :::*                    LISTEN     
tcp6       0      0 :::2049                 :::*                    LISTEN     
tcp6       0      0 :::33665                :::*                    LISTEN 

然后尝试(不确定这是一个相关的测试):

wget localhost:6010
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:8080... failed: Connection refused.

请问有什么想法吗?

internet localhost connection
  • 1 个回答
  • 8195 Views
Martin Hope
Iheb Saad
Asked: 2019-09-20 08:15:56 +0800 CST

允许访问本地网络上的 Apache 2 服务器

  • 1

04.3 长期版本。

我想允许访问我的本地主机的其他设备。我的 IP 是 192.168.1.249 并且 apache 服务器正在为这些地址工作:

localhost/myapp
esolutions/myapp
192.168.1.249/myapp

这是我的默认配置:/etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
    ServerName esolutions

    ServerAdmin iheb@localhost
    DocumentRoot /var/www/html
    <Directory /var/www/html>
    Options FollowSymLinks
    Order deny,allow
    AllowOverride All
    allow from all
    Require all granted
    </Directory>

    <Directory />
    Options FollowSymLinks
    AllowOverride None
    allow from all
    Order deny,allow
    Require all granted
    </Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

和我的主机文件:

127.0.0.1       localhost
127.0.1.1       najda-PowerEdge-R430

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

192.168.1.249         esolutions

请帮忙。

networking server apache2 localhost
  • 1 个回答
  • 6762 Views
Martin Hope
Maxime Dupré
Asked: 2019-08-04 11:42:13 +0800 CST

virtualbox - 如何使“localhost”指向主机的“localhost”?

  • 2

我知道我可以使用10.0.2.2. 但是,我需要的是能够在我的 VirtualBox Edge 浏览器中键入“localhost”,并让它指向我计算机的 localhost。

我已经对文件尝试了几件事host,但还没有成功。甚至可以做我想做的事吗?

干杯!

networking virtualbox hosts localhost
  • 2 个回答
  • 2379 Views
Martin Hope
abbas ataei
Asked: 2019-06-04 23:31:44 +0800 CST

无法从 Android 设备访问 localhost 以进行测试 API

  • 1

我在 Django 中编写我的 Web 服务,当我在 postman 中测试我的 API 时一切正常(on http://127.0.0.1:8000/)。但是当我尝试使用 Retrofit 连接时,http://192.168.43.115:8000我不能。这是错误:

消息:java.net.ConnectException:在 10000 毫秒后无法从 /192.168.232.2(端口 50628)连接到 /192.168.43.115(端口 8000):isConnected 失败:ECONNREFUSED(连接被拒绝

android apache2 localhost
  • 2 个回答
  • 4937 Views
Martin Hope
foobar
Asked: 2019-03-12 23:10:24 +0800 CST

本地主机子域的 DNS 解析在 resolvconf 更新后停止工作

  • 1

多年来,我一直在使用 Ubuntu(目前在 18.10)在域上开发 PHP 应用程序,例如foo.bar.localhost用于本地测试。这些域被解析为 127.0.0.1 并由 Apache 2.4 处理。这总是有效的。这条线127.0.0.1 localhost就像/etc/hosts往常一样。

今天早上我打开我的设备,这不再工作了。ping localhost仍在工作,但ping foo.bar.localhost不是(昨天仍在工作)。令人惊讶的是 Chromium 仍在解析foo.bar.localhost,我认为它没有使用操作系统进行 DNS 解析。但我主要使用 Firefox,它也停止解析 localhost 子域。

昨天我没有更改任何与系统相关的设置,但我记得昨天的一些软件包更新,所以我假设一些与网络相关的东西发生了一些变化。有没有办法dpgk列出安装/更新日期,以便我可以找出更新的确切软件包?

我可以检查哪些设置以使解析子域在系统范围内再次工作?是否有任何已知的错误?

附加信息:在我发现了一个听起来相关/var/log/dpkg.log的最近条目。upgrade resolvconf:all 1.79ubuntu10 1.79ubuntu10.18.10.1此行和以下后续行是唯一包含术语“resolv”的行(与 一起找到cat /var/log/dpkg.log | grep resolv)。因此,在最后几个小时内,这个与 DNS 相关的包被更新了。

另一个信息:手册man systemd-resolved有以下行:

主机名“localhost”和“localhost.localdomain”(以及任何以“.localhost”或“.localhost.localdomain”结尾的主机名)被解析为 IP 地址 127.0.0.1 和 ::1。

因此,这种定义明确的行为停止工作。我也不记得自己更改了与此低级 DNS 相关的任何内容。

执行时的确切消息ping foo.bar.localhost是

ping: foo.bar.localhost: Name or service not known

显然,在新版本的 resolvconf 中“修复”的唯一错误是: https ://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1817903 ,它与本地解析有关。

networking browser localhost resolvconf web-development
  • 1 个回答
  • 713 Views
Martin Hope
ellen
Asked: 2019-03-06 13:30:03 +0800 CST

设置 Apache2 VirtualHost 以在本地运行多个站点 Ubuntu 16.04

  • 1

我有一个在 /var/www/html 中运行一段时间的网站。我正在开始一个新项目,并想在本地运行另一个站点。

经过一番谷歌搜索,我正在查看上一个问题:https ://ubuntuforums.org/showthread.php?t=1423044

我在/var/www调用中创建了一个文件夹,my-site并克隆了我暂时将在其中使用的 git repo。

my-site.com.conf然后我添加了一个名为/etc/apache2/sites-enabled. 这是它的样子:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
    ServerName www.my-site.com
DocumentRoot /var/www/my-site/
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/my-site/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

我将以下内容添加到/etc/hosts:

127.0.0.1       www.my-site.com

我还在 内运行了以下命令/etc/apache2/sites-enabled:

ln -sf /etc/apache2/sites-available/my-site.com /etc/apache2/sites-enabled/my-site.com

问题是当我进入浏览器时my-site.com,我被重定向到我之前在 localhost 上运行的旧站点。我的旧网站在用户登录之前不允许用户去任何地方,而且似乎我一直被重定向到登录页面。

如何访问我的新站点并设置一个可以在这两个项目上工作的环境?

如果我需要提供更多信息,请告诉我。

谢谢!

server apache2 hosting localhost
  • 1 个回答
  • 952 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve