标签: apache2

为什么我仍然在 Nginx 上看到一个 Apache 站点?

我安装了 nginx 然后我安装了 apache2,过了一会儿我删除了 apache2。几周后,我在访问时发现了一些奇怪的事情http://localhost:nginx 处理了请求,但是当我输入我的 IP 地址或网络中的任何人输入我的 IP 时,它会导致 apache2 页面加载,表明它可以正常工作。

我清除并删除了 Apache 但我仍然无法摆脱这个问题,尝试重新安装并再次清除然后重新启动。关于可能是什么问题的任何想法?

PS我的计算机无论如何都无法识别apache2,即使我手动搜索它们也找不到所有Apache文件和二进制文件。

root@elite-HP-Pro3500-G2-MT-PC:/home/elite# whereis apache2
apache2:
root@elite-HP-Pro3500-G2-MT-PC:/home/elite# sudo service apache2 start
Failed to start apache2.service: Unit apache2.service failed to load: No such file or directory.
root@elite-HP-Pro3500-G2-MT-PC:/home/elite# sudo apt-get purge apache2 apache2-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'apache2' is not installed, so not removed
Package 'apache2-utils' is not installed, so not removed
0 upgraded, 0 newly installed, 0 …
Run Code Online (Sandbox Code Playgroud)

uninstall apache2 purge

31
推荐指数
2
解决办法
3万
查看次数

如何为 Ubuntu 11.04 启用 mod_rewrite Apache 模块?

在 CentOS 等其他 linux 中,它可以工作,但我无法在 Ubuntu 11.04 中运行它。

/var/www/html/folder/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Run Code Online (Sandbox Code Playgroud)

10.04 mysql php 11.04 apache2

30
推荐指数
1
解决办法
9万
查看次数

参数文件中的互斥目录无效:${APACHE_LOCK_DIR}

嗨,在全新安装 ubuntu 16.04 和 tasksel 灯 apache2 后,每个人都收到此错误:

[Mon Jul 18 22:42:00.114578 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Mon Jul 18 22:42:00.114623 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Mon Jul 18 22:42:00.114641 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Mon Jul 18 22:42:00.114645 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Mon Jul 18 22:42:00.114657 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_LOG_DIR} …
Run Code Online (Sandbox Code Playgroud)

lamp apache2

30
推荐指数
3
解决办法
6万
查看次数

无法为 PHP5 获取 mcrypt

我已经做过很多次了:

sudo aptitude install php5-mcrypt

sudo apache2ctl restart
Run Code Online (Sandbox Code Playgroud)

aptitude 说 mcrypt 已安装。我已经重新安装了3次了。自从安装 apache 以来,我已经重新启动了大约 20 次。当我查看 phpInfo 时,我没有看到 mcrypt 列出。当我尝试执行我的代码时,它说 mcrypt 函数(选择一个 - 任意一个)不存在。mcrypt 显然没有启用。

有谁知道可能有什么问题?我不知道哪些部分应该放在什么地方以及所有这些应该如何组合在一起。

我安装了 PHP 5.5.3

php aptitude apache2

29
推荐指数
3
解决办法
8万
查看次数

当我遇到pid冲突时如何重新启动apache2?

当我尝试重新启动 apache2 时,我收到与本线程中解释的消息相同的消息:

 * Restarting web server apache2 [fail]
 * There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand.
Run Code Online (Sandbox Code Playgroud)

但问题是我在 /var/run/apache2 中没有任何文件。命令 pidof apache2 返回:

1274
Run Code Online (Sandbox Code Playgroud)

我不知道它是否会有所帮助,但这是 apache2.conf 中的行:

PidFile ${APACHE_PID_FILE}
Run Code Online (Sandbox Code Playgroud)

而 envvars 中的一个:

export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
Run Code Online (Sandbox Code Playgroud)

我应该在 /var/run/apache2 中手动创建一个 .pid 文件吗?

非常感谢 !

server apache2

29
推荐指数
1
解决办法
4万
查看次数

为什么我在启动 Apache2 时收到“权限被拒绝:make_sock:无法绑定到地址”?

我可以停止使用

/etc/init.d/apache2 stop
Run Code Online (Sandbox Code Playgroud)

但是当我想使用以下方法再次启动它时:

/etc/init.d/apache2 start
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

Starting web server apache2                                                  /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
                                                                         [fail]
Run Code Online (Sandbox Code Playgroud)

server permissions apache2

28
推荐指数
3
解决办法
17万
查看次数

Ubuntu Apache2 DefaultRuntimeDir 必须是有效目录,绝对或相对于 ServerRoot

我有一个运行 Ubuntu 17.04 的网络服务器,我试图用Apache. 一切都运行良好,直到我决定通过 virtualHosts 在一台机器上托管两个网站。现在apache即使启用单个主机也拒绝启动。每次我尝试启动时Apache都会收到此错误:

apache2: Syntax error on line 80 of /etc/apache2/apache2.conf:
DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot.
Run Code Online (Sandbox Code Playgroud)

我试图解决这个问题的任何尝试都没有取得任何成果,包括:

apt purge apache2 && rm -r /etc/apache2 
Run Code Online (Sandbox Code Playgroud)

错误消息的所有第 80 行都告诉我是DefaultRuntimeDir ${APACHE_RUN_DIR}.

我在任何时候都看不到APACHE_RUN_DIR声明的位置或内容。

有人可以帮我吗?

server directory apache2

28
推荐指数
3
解决办法
8万
查看次数

cgi-bin 不工作

我重新安装了 kubuntu 13.10,cgi-bin 不起作用。Apache 下载 cgi 而不是执行它!

我有启用了 cgi mod 的最新 apache。在 000-default.conf 中,我添加了以下选项:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
  Options +ExecCGI
  AddHandler cgi-script .cgi .pl
  Options FollowSymLinks
  Require all granted
</Directory>
Action application/x-httpd-php /cgi-bin/php5
Run Code Online (Sandbox Code Playgroud)

并重新启动Apache,但问题仍然存在。

这是我当前的 apache2.conf 设置:

# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary …
Run Code Online (Sandbox Code Playgroud)

apache2

27
推荐指数
2
解决办法
15万
查看次数

如何使用线程安全的 PHP 在 Ubuntu 14.04 上启用事件 MPM Apache 2.4?

我升级到 Ubuntu Server 14.04,希望默认的 apache 安装会使用新的事件 MPM,但我找到了旧的占用内存的 prefork。

我已经在 Arch Linux 中成功设置了事件 MPM,但在 Ubuntu 上却没有这样做。我不断得到:

Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP
Run Code Online (Sandbox Code Playgroud)

我已经安装php-fpm并配置了 apache2 以使用它,但是由于 apache2 的配置文件在 Ubuntu 上有所不同,我不太确定我是否在正确的地方进行了操作。

关于如何使 PHP 线程安全以便我可以使用 apache2 event-mpm 的任何想法?(当然不必手动重新编译php)

server php apache2 14.04

26
推荐指数
3
解决办法
6万
查看次数

Ubuntu Server 18.04 LTS 中缺少 php-mcrypt 包

php-mcryptUbuntu Server 18.04 LTS 中是否缺少该软件包?

apt install php-mcrypt
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php-mcrypt is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php-mcrypt' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

server php package-management apt apache2

26
推荐指数
3
解决办法
11万
查看次数