我很困惑为什么 Apache 在端口 80 上没有响应......
$ wget http://localhost:80
--2014-05-06 15:32:44-- http://localhost/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... failed: Connection refused.
Run Code Online (Sandbox Code Playgroud)
......而是在 8080 后......
$ wget http://localhost:8080
--2014-05-06 15:32:38-- http://localhost:8080/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 177 [text/html]
Saving to: ‘index.html’
100%[=================================================>] 177 --.-K/s in 0s
2014-05-06 15:32:38 (16,4 MB/s) - ‘index.html’ saved [177/177]
Run Code Online (Sandbox Code Playgroud)
在apache2ctl的输出中看不到太多:
$ apache2ctl -t -D DUMP_VHOSTS
VirtualHost configuration:
*:80 is …
Run Code Online (Sandbox Code Playgroud) make
如果不想在我的make
程序(或make
类似)程序中使用制表符缩进,是否有 GNU替代方案?
例如,当我使用 时make
,我需要在make
开场白 ( % :
)之后缩进所有内容。这是在某些情况下解决某些问题的秘诀(例如,我跨平台工作并且我使用 Windows10 AutoHotkey 机制,该机制从我出于不同原因粘贴到 Linux 终端的代码中剥离选项卡,并且它不会传递,make
因此我需要一个非标签包括解决方案)。
对所有内容进行制表符缩进的必要性% :
使我的工作变得make
不流畅。
这是make
我用来创建新的虚拟主机 conf 文件的。我执行它make domain.tld.conf
:
% :
printf '%s\n' \
'<VirtualHost *:80>' \
'DocumentRoot "/var/www/html/$@"' \
'ServerName $@' \
'<Directory "/var/www/html/$@">' \
'Options +SymLinksIfOwnerMatch' \
'Require all granted' \
'</Directory>' \
'ServerAlias www.$@' \
'</VirtualHost>' \
> "$@"
a2ensite "$@"
systemctl restart apache2.service
Run Code Online (Sandbox Code Playgroud)
有没有其他选择,也许是 Unix 本身附带的东西,它提供了类似的功能,但不必在模式文件本身中使用制表符缩进?