macos 什么是“/etc/apache2/sites-available”的mac等价物?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2121159/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:41:50  来源:igfitidea点击:

What is the mac equivalent of "/etc/apache2/sites-available"?

macosapache-config

提问by John Breedlove

I am installing Koha from source. Generic unix directions indicate the following step after sudo make install

我正在从源代码安装 Koha。通用的 unix 方向指示在 sudo make install 之后的以下步骤

sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha

huh?

嗯?

My apache2 directory contains no sites-available, only /private/etc/apache2/extra /private/etc/apache2/httpd.conf /private/etc/apache2/magic /private/etc/apache2/mime.types /private/etc/apache2/original /private/etc/apache2/other /private/etc/apache2/users

我的 apache2 目录不包含可用站点,只有 /private/etc/apache2/extra /private/etc/apache2/httpd.conf /private/etc/apache2/magic /private/etc/apache2/mime.types /private/etc /apache2/original /private/etc/apache2/other /private/etc/apache2/users

I am supposed to be able to Browse to http://servername:8080/to run Koha, where I take it "servername" is specified in koha-httpd.conf as follows:

我应该能够通过浏览来http://servername:8080/运行 Koha,我认为在 koha-httpd.conf 中指定了“servername”,如下所示:

## Intranet
<VirtualHost 192.168.1.4:8080>
   ServerAdmin webmaster@local
   DocumentRoot /usr/share/koha/intranet/htdocs
   ServerName John-Breedloves-Mac-mini.local:8080
#  ServerAlias intranet.mydomain.com
   ScriptAlias /cgi-bin/koha/ "/usr/share/koha/intranet/cgi-bin/"
   ScriptAlias /index.html "/usr/share/koha/intranet/cgi-bin/mainpage.pl"
   ScriptAlias /search "/usr/share/koha/intranet/cgi-bin/search.pl"
   ErrorLog /var/log/koha/koha-error_log
#  TransferLog /var/log/koha/koha-access_log
   SetEnv KOHA_CONF "/etc/koha/koha-conf.xml"
   SetEnv PERL5LIB "/usr/share/koha/lib"
   Options +FollowSymLinks

   ErrorDocument 400 /cgi-bin/koha/errors/400.pl
   ErrorDocument 401 /cgi-bin/koha/errors/401.pl
   ErrorDocument 403 /cgi-bin/koha/errors/403.pl
   ErrorDocument 404 /cgi-bin/koha/errors/404.pl
   ErrorDocument 500 /cgi-bin/koha/errors/500.pl

   RewriteEngine On 

However when I go to http://john-breedloves-mac-mini.local:8080/, I get:

但是,当我去时http://john-breedloves-mac-mini.local:8080/,我得到:

It works!

有用!

Which,is, like ironical or something.

这是,像讽刺什么的。

Help a noob out.

帮助一个菜鸟。

回答by nobody

It looks like /private/etc/apache2/other/would be the approximately corresponding folder. /etc/apache2/httpd.confcontains a directive Include /private/etc/apache2/other/*.confthat includes all files in that folder, much like the sites-available folder common on Linux installations of Apache.

看起来/private/etc/apache2/other/应该是大致对应的文件夹。/etc/apache2/httpd.conf包含一个指令Include /private/etc/apache2/other/*.conf,该指令包含该文件夹中的所有文件,很像 Apache 的 Linux 安装上常见的站点可用文件夹。

回答by Lewy

Run apachectl -Swhich is shorthand for apachectl -t -D DUMP_VHOSTS

Runapachectl -S的简写apachectl -t -D DUMP_VHOSTS

According to the apachectl man file, this will show parsed settings (currently only vhost settings). Incidentally, it also checks your config file for errors.

根据 apachectl man 文件,这将显示解析的设置(目前只有 vhost 设置)。顺便说一句,它还会检查您的配置文件是否有错误。

回答by josh.fremer

Andrew's answer is correct. On my install, I additionally had to change

安德鲁的回答是正确的。在我的安装中,我还必须更改

Order allow,deny
Deny from all

to

Order allow,deny
Allow from all

in /etc/apache2/httpd.conf.

在 /etc/apache2/httpd.conf 中。

The fact that you're getting a server at :8080 indicates that you may be running a different apache config from the base system install, such as MAMP; I don't believe that apache by default listens on :8080.

您在 :8080 处获得服务器这一事实表明您可能正在运行与基本系统安装不同的 apache 配置,例如MAMP;我不相信默认情况下 apache 会监听 :8080。

回答by scruffian

I had this problem too. It seems to occour because the default version of apache that is installed on osx over-rides other versions. to disable it go to "System Preferences > Sharing" and untick "web sharing".

我也有这个问题。这似乎是因为安装在 osx 上的默认 apache 版本覆盖了其他版本。要禁用它,请转到“系统偏好设置 > 共享”并取消勾选“网络共享”。

good luck!

祝你好运!

回答by Imme22009

Please note that ServerRoot specifies where the subdirectories conf and logs can be found.

请注意,ServerRoot 指定可以找到子目录 conf 和 logs 的位置。

In my httpd.conf, it is set to /usr

在我的 httpd.conf 中,它被设置为 /usr