【问题标题】:wordpress in apache just work on localhost and not working in another local computersapache 中的 wordpress 只能在 localhost 上工作,而不能在另一台本地计算机上工作
【发布时间】:2021-01-18 18:04:06
【问题描述】:

我在我的一台计算机上安装了 Apache,这样我就可以通过键入任何系统的 IP 轻松访问我的站点,但是 Apache 很容易显示 index.hml 文件和 phpmyadmin 子域,但是当我复制 WordPress 时,它会显示以下错误给出:

在另一台电脑上的 chrome 中:

(无法访问此站点 找不到 www.risemisse.com 的服务器 IP 地址。 DNS_PROBE_FINISHED_NXDOMAIN)

在本地主机中: 轻松显示我的 wordpress 网站

然后我将文件和目录复制到 html 目录中,它显示了类似的错误: 在html目录中:

在 /etc/apache2/sites-enabled:

<VirtualHost *:8080>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

我在 ports.cnf 中添加了:LISTEN 8080

在 /etc/hosts 中:

127.0.0.1       localhost
127.0.1.1       mohamamdjavad-pc

# I aded this
127.0.0.1 risemisse.com
127.0.0.1 www.risemisse.com

# 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

ufw:

Status: active

To                         Action      From
--                         ------      ----
Apache Full                ALLOW       Anywhere                  
8080                       ALLOW       Anywhere                  
22/tcp                     ALLOW       Anywhere                  
OpenSSH                    ALLOW       Anywhere                  
80 on enp1s0               ALLOW       Anywhere                  
24800                      ALLOW       Anywhere                  
443/tcp                    ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
Apache Full (v6)           ALLOW       Anywhere (v6)             
8080 (v6)                  ALLOW       Anywhere (v6)             
22/tcp (v6)                ALLOW       Anywhere (v6)             
OpenSSH (v6)               ALLOW       Anywhere (v6)             
80 (v6) on enp1s0          ALLOW       Anywhere (v6)             
24800 (v6)                 ALLOW       Anywhere (v6)             
443/tcp (v6)               ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6)  
                    

感谢您帮助我在另一台计算机上使用 Apache 计算机。

【问题讨论】:

    标签: wordpress apache ubuntu


    【解决方案1】:

    当我将 我的 IP 输入到这些 ( 设置 > 常规 > WordPress 地址 (URL) 和站点地址 (URL) ) 中时是正确的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多