微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

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

我在一台计算机上安装了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计算机。

解决方法

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。