- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我一直在使用 this tutorial在我的 Ubuntu 电脑上设置 Apache 虚拟主机。我创建了一个 no-ip 域
,我将使用它作为我的虚拟主机的主机名。我已经按照教程的每一步进行操作,但它不起作用。这是虚拟主机文件,它被命名为 crm2plus.ddns.net.conf
:
<VirtualHost *:80>
# 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@crm2plus.ddns.net
ServerName crm2plus.ddns.net
ServerAlias crm2plus.ddns.net
DocumentRoot /var/www/crm2plus.ddns.net/public_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>
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
我还将 ip 和域名对添加到我的本地主机文件中,如下所示:
23.253.21.201 shhasan.ddns.net
127.0.1.1 Ubuntu-Dev
127.0.0.1 localhost
99.250.71.177 crm2plus.ddns.net
# 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
当我通过 chrome 导航到 crm2plus.ddns.net
时,我得到了 web page not available page
。 shhasan.ddns.net
运行良好。当我在终端中键入 ssh-keygen -H -F crm2plus.ddns.net
时,没有任何显示,但是当我键入 ssh-keygen -H -F shhasan.ddns.net
这是显示的内容:
# Host shhasan.ddns.net found: line 14 type RSA
后跟 RSA key 。
我还查看了 Apache 错误和访问日志。错误日志中有很多重复这样的代码行:
[Fri Nov 14 17:44:50.304782 2014] [mpm_prefork:notice] [pid 21927] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations
[Fri Nov 14 17:44:50.304801 2014] [core:notice] [pid 21927] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 14 17:44:54.979832 2014] [mpm_prefork:notice] [pid 21927] AH00169: caught SIGTERM, shutting down
我搜索了 caught SIGTERM, shutting down
我发现这是正常操作的一部分。我不知道我哪里出错了。它以前适用于 shhasan.ddns.net
但不适用于 crm2plus.ddns.net
。
非常感谢所有帮助和建议。
更新:
developer@Ubuntu-Dev:/etc/apache2$ ls
apache2.conf apache2.conf.dpkg-dist conf-enabled httpd.conf magic mods-enabled ports.conf~ sites-enabled
apache2.conf~conf-available envvars httpd.conf~mods-available ports.conf sites-available
developer@Ubuntu-Dev:/etc/apache2/sites-available$ ls
000-default.conf 000-default.conf~ 000-default.conf.dpkg-dist crm2plus.ddns.net.conf crm2plus.ddns.net.conf~ default.save default-ssl.conf shhasan.ddns.net.conf
developer@Ubuntu-Dev:/etc/apache2/sites-enabled$ ls
crm2plus.ddns.net.conf shhasan.ddns.net.conf
apache2.conf
简化版:
Include /etc/phpmyadmin/apache.conf
ServerName localhost
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride All
# Order deny,allow
# Deny from all
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
最佳答案
您可以尝试在虚拟主机定义文件中使用 Apache2.4 语法进行访问控制,因为您使用的是 Apache2.4,那么如果您没有激活 mod_access_compat.so
它应该可以工作或者如果有,您可以将其停用。
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
我必须承认我更喜欢在 VH 定义本身中添加对虚拟主机的访问控制。然后你只需看一眼就知道实际发生了什么。所以你可以考虑这样做。
<VirtualHost *:80>
ServerAdmin webmaster@crm2plus.ddns.net
ServerName crm2plus.ddns.net
ServerAlias www.crm2plus.ddns.net
DocumentRoot /var/www/crm2plus.ddns.net/public_html
<Directory /var/www/crm2plus.ddns.net/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
另外,在 httpd.conf 文件中乱用这个参数时要小心
<Directory />
Options FollowSymLinks
AllowOverride All
# Order deny,allow
# Deny from all
</Directory>
这控制了 Apache 对根文件夹的访问权限,当然您不希望 Apache 或您的 Apache 上的黑客访问整个宇宙。
所以我建议你把这个改回
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
当然是再次使用 Apache2.4 语法。
更新:上述 VH 定义的略微编辑版本适用于 crm2plus.ddns.net
<VirtualHost *:80>
ServerName crm2plus.ddns.net
ServerAlias crm2plus.ddns.net
ServerRoot /var/www/crm2plus.ddns.net/
DocumentRoot /var/www/crm2plus.ddns.net/public_html
<Directory "/var/www/crm2plus.ddns.net/public_html">
Options +Indexes +FollowSymLinks
Order allow,deny
Allow from all
AllowOverride All
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/crm2plus.ddns.net_error.log
CustomLog ${APACHE_LOG_DIR}/crm2plus.ddns.net_access.log combined
</VirtualHost>
关于linux - Apache 虚拟主机无法在 Ubuntu 14.04 LTS 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26940475/
在流处理方面,Apache Beam和Apache Kafka之间有什么区别? 我也试图掌握技术和程序上的差异。 请通过您的经验报告来帮助我理解。 最佳答案 Beam是一种API,它以一种统一的方式使
有点n00b的问题。 如果我使用 Apache Ignite 进行消息传递和事件处理,是否还需要使用 Kafka? 与 Ignite 相比,Kafka 基本上会给我哪些(如果有的话)额外功能? 提前致
Apache MetaModel 是一个数据访问框架,它为发现、探索和查询不同类型的数据源提供了一个通用接口(interface)。 Apache Drill 是一种无架构的 SQL 查询引擎,它通过
Tomcat是一个广泛使用的java web服务器,而Apache也是一个web服务器,它们在实际项目使用中有什么不同? 经过一些研究,我有了一个简单的想法,比如, Apache Tomcat Ja
既然简单地使用 Apache 就足以运行许多 Web 应用程序,那么人们何时以及为什么除了 Apache 之外还使用 Tomcat? 最佳答案 Apache Tomcat是一个网络服务器和 Java
我在某个 VPS( friend 的带 cPanel 的 apache 服务器)上有一个帐户,我在那里有一个 public_html 目录。我们有大约 5-6 个网站: /home/myusernam
我目前正在尝试将模块加载到 Apache,使用 cmake 构建。该模块称为 mod_mapcache。它已成功构建并正确安装在/usr/lib/apache2/modules directroy 中
我对 url 中的问号有疑问。 例如:我有 url test.com/controller/action/part_1%3Fpart_2 (其中 %3F 是 url 编码的问号),并使用此重写规则:R
在同一台机器上,Apache 在端口 80 上运行,Tomcat 在端口 8080 上运行。 Apache 包括 html;css;js;文件并调用 tomcat 服务。 基本上 exampledom
Apache 1 和 Apache 2 的分支有什么区别? 使用一种或另一种的优点和缺点? 似乎 Apache 2 的缺点之一是使用大量内存,但也许它处理请求的速度更快? 最有趣的是 Apache 作
实际上,我们正在使用 Apache 网络服务器来托管我们的 REST-API。 脚本是用 Lua 编写的,并使用 mod-lua 映射。 例如来自 httpd.conf 的实际片段: [...] Lu
我在 apache 上的 ubuntu 中有一个虚拟主机,这不是我的主要配置,我有另一个网页作为我的主要网页,所以我想使用虚拟主机在同一个 IP 上设置这个。 urologyexpert.mx 是我的
我使用 Apache camel 已经很长时间了,发现它是满足各种系统集成相关业务需求的绝佳解决方案。但是几年前我遇到了 Apache Nifi 解决方案。经过一番谷歌搜索后,我发现虽然 Nifi 可
由于两者都是一次处理事件的流框架,这两种技术/流框架之间的核心架构差异是什么? 此外,在哪些特定用例中,一个比另一个更合适? 最佳答案 正如您所提到的,两者都是实时内存计算的流式平台。但是当您仔细观察
apache 文件(如 httpd.conf 和虚拟主机)中使用的语言名称是什么,例如 # Ensure that Apache listens on port 80 Listen 80 D
作为我学习过程的一部分,我认为如果我扩展更多关于 apache 的知识会很好。我有几个问题,虽然我知道有些内容可能需要相当冗长的解释,但我希望您能提供一个概述,以便我知道去哪里寻找。 (最好引用 mo
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 4 个月前关闭。 Improve
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
这个问题在这里已经有了答案: Difference Between Apache Kafka and Camel (Broker vs Integration) (4 个回答) 3年前关闭。 据我所知
我有 2 个使用相同规则的子域,如下所示: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond
我是一名优秀的程序员,十分优秀!