apache中的wordpress只能在localhost上工作,而不能在另一台本地计算机上工作

时间:2020-10-03 08:10:35

标签: wordpress apache ubuntu

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

在另一台PC的Chrome中:

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

以及在localhost中: 轻松显示我的wordpress网站

,然后我在html目录中复制文件和目录,它向我显示了类似错误: 在html目录中:enter image description here

在/ 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计算机。

1 个答案:

答案 0 :(得分:0)

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