Ubuntu 在:81 端口上定义正确的虚拟主机

Ubuntu 在:81 端口上定义正确的虚拟主机

processmaker我正在尝试在本地机器上安装,我创建/opt目录并将这个 php 脚本粘贴到其中,而不是在我的 ubuntu 操作系统上定义虚拟主机,为了执行此操作,我将这个 apache 配置命名/etc/apache2/sites-available/为 pmos.conf,我想用它127.0.0.1:81来打开/opt/processmaker/workflow/public_html路径

<VirtualHost *:81>
    ServerAdmin [email protected]
    ServerName processmaker.dev
    ServerAlias www.processmaker.dev

    DocumentRoot /opt/processmaker/workflow/public_html
    DirectoryIndex index.html index.php

    <Directory "/opt/processmaker/workflow/public_html">
       AddDefaultCharset UTF-8
       AllowOverRide none
       Options FollowSymlinks
       Order allow,deny
       Allow from all
       RewriteEngine on
       RewriteRule ^.*/(.*)$ sysGeneric.php [NC,L]
       AddOutputFilterByType DEFLATE text/html
    </Directory>
</VirtualHost>

内容/etc/hosts如下:

127.0.0.1          localhost
127.0.1.1          pishguy
127.0.0.1          processmaker.dev
# 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

重新启动 apache 后

sudo systemctl reload apache2

我在 shell 上没有收到任何错误,但是127.0.0.1:81在 FireFox 上输入时收到此错误:

Unable to connect
Firefox can’t establish a connection to the server at 127.0.0.1:81.

答案1

看起来 Apache 没有监听端口 81。

尝试,而不是reload处理restart apache2

`systemctl restart apache2`

根据评论进行编辑

您应该添加指令

Listen 81

/etc/apache2/ports.conf, 也 (或者将它添加到pmos.conf之前 <VirtualHost *:81>)。

相关内容