首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >apache中的wordpress只能在本地主机上运行,不能在另一台本地计算机上运行

问apache中的wordpress只能在本地主机上运行,不能在另一台本地计算机上运行
EN

Stack Overflow用户
提问于 2020-10-03 16:10:36
回答 1查看 99关注 0票数 0

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

在另一台pc的chrome中:

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

在localhost中:轻松显示我的wordpress站点

然后我复制html目录中的文件和目录,结果显示类似的错误:在html目录中:

​

在/etc/apache2/sites enabled中:

代码语言:javascript
复制
<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中:

代码语言:javascript
复制
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:

代码语言:javascript
复制
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计算机。

EN

回答 1

Stack Overflow用户

发布于 2020-10-04 16:19:46

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64182086

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档