Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
Run Code Online (Sandbox Code Playgroud)
我的项目工作正常,今天早上我重新安装了 apache 和 php7.0。我在我的项目中使用了 ssl。当我从虚拟主机中删除 ssl 时,它工作正常。但是当我再次添加 ssl 时,它会出现上述错误。我已经尝试过针对上述错误给出的建议。非然后工作。谁能帮我。Thnak 你提前输出sudo systemctl status apache2.service
? apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
??apache2-systemd.conf
Active: failed (Result: exit-code) since ?? 2017-04-21 08:35:19 +0530; 26s ago
Docs: man:systemd-sysv-generator(8)
Process: 3776 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 3114 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
Process: 3802 ExecStart=/etc/init.d/apache2 …Run Code Online (Sandbox Code Playgroud) 安装 mu LAMP 堆栈后。默认情况下,我在 http://127.0.1.1/ 运行端口 80
现在我想添加新端口,例如 8000、8888。
如何将它们添加到我的 Ubuntu 17.04 的 /etc/apache2/apache2.conf 中?
这就是我在Arch Linux 中的做法:
2.2 在/etc/httpd/conf/httpd.conf中,取消对以下两行Proxy的注释:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
Run Code Online (Sandbox Code Playgroud)
2.3 不要忘记在 /etc/httpd/conf/httpd.conf 中将端口 443 添加到您的监听端口:
Listen 443
Listen 8888
Run Code Online (Sandbox Code Playgroud)
2.3 添加这些块:
<VirtualHost *:8888>
ProxyPreserveHost On
ProxyRequests Off
ServerName www.xxxx.co.uk
ServerAlias xxxx.co.uk
ProxyPass / http://127.0.0.1:3838/
ProxyPassReverse / http://127.0.0.1:3838/
SSLEngine on
SSLCertificateFile "/etc/letsencrypt/live/xxxx.co.uk/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/xxxx.co.uk/privkey.pem"
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
Ubuntu 中的 Apache 怎么样?
我什至没有看到:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
Run Code Online (Sandbox Code Playgroud)
在我的 Ubuntu 17.04 中的 apache2.conf 中。
每次重启apache2,终端输出如下:
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
Segmentation fault (core dumped)
Action 'configtest' failed.
The Apache error log may have more information.
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题呢?
当我尝试安装mod_ssl 时,它说无法找到包 mod_ssl
$ sudo apt-get 更新 Ign http://archive.ubuntu.com 可信赖的 InRelease 点击 http://archive.ubuntu.com trusty-security InRelease 点击 http://archive.ubuntu.com trusty-updates InRelease 点击 http://archive.ubuntu.com trusty Release.gpg 点击 http://archive.ubuntu.com trusty-security/main amd64 Packages 点击 http://archive.ubuntu.com trusty-security/restricted amd64 Packages 点击 http://archive.ubuntu.com trusty-security/universe amd64 Packages 点击 http://archive.ubuntu.com trusty-security/multiverse amd64 Packages 点击 http://archive.ubuntu.com trusty-security/main Translation-en 点击 http://archive.ubuntu.com trusty-security/multiverse Translation-en 点击 http://archive.ubuntu.com trusty-security/restricted Translation-en 点击 http://archive.ubuntu.com trusty-security/universe Translation-en 点击 http://archive.ubuntu.com trusty-updates/main amd64 Packages 点击 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages 点击 http://archive.ubuntu.com trusty-updates/universe amd64 Packages 点击 http://archive.ubuntu.com trusty-updates/multiverse …
我已经安装了 Apache 2.4、PHP7,并使用以下命令安装了 SimpleXML:
apt-get install php-simplexml
Run Code Online (Sandbox Code Playgroud)
然后我取消注释php.inifor行extension=php_xmlrpc.dll并重新启动 Apache。
我的apache.log告诉我这个:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_xmlrpc.dll' - /usr/lib/php/20151012/php_xmlrpc.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Run Code Online (Sandbox Code Playgroud)
我怎样才能让它消失?
我刚刚使用厨师在 Ubuntu (aws) 上安装了 apache2。
Ubuntu 服务器上的 Apache2:10.1.1.1
客户端:10.1.1.200
我还验证了 tcp 22 (sshd) 和 tcp 80 (apache2) 都在监听
root@Ubuntu:/var/www# netstat -anp | egrep '22|80'
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1469/sshd
tcp6 0 0 :::80 :::* LISTEN 16950/apache2
tcp6 0 0 :::22 :::* LISTEN 1469/sshd
root@Ubuntu:/var/www#
Run Code Online (Sandbox Code Playgroud)
流程看起来也不错
root@Ubuntu:/var/www# ps -ef | egrep 'apache2|sshd'
root 1469 1 0 Sep29 ? 00:00:00 /usr/sbin/sshd -D
root 16950 1 0 Sep29 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 16953 16950 0 Sep29 ? 00:00:02 /usr/sbin/apache2 …Run Code Online (Sandbox Code Playgroud) 以前的标题是“在 sudo apt-get install apache2 之后找不到 httpd(在 Windows 上运行的 Ubuntu 仿真)”
因此,我在安装了适用于 Linux 的 Windows Subsytem以模拟在 Windows 10 上运行的 Ubuntu后,安装了适用于 Windows 10 的 Canonical Group Limited Ubuntu 应用程序。
跑步 lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
Run Code Online (Sandbox Code Playgroud)
所以我跑了sudo apt-get install apache2,我可以看到一些安装的证据,因为现在存在/etc/apache2目录,并且有一个默认的 Apache index.html 页面/var/www/html/index/html。
但是没有httpdinusr/bin或usr/sbin。
那么 httpd 在哪里?
我无法用sudo systemctl restart apache2它来启动 Apache报告
Failed to connect …Run Code Online (Sandbox Code Playgroud) sudo apt install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache2 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 'apache2' has no installation candidate
Run Code Online (Sandbox Code Playgroud) 我通过 SSH 隧道登录到我的 VPS 并在服务器上安装了 Apache。Apache 看起来很健康并且正在运行。
sudo systemctl status apache2
? apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
??apache2-systemd.conf
Active: active (running) since Thu 2018-02-08 20:20:51 UTC; 1 day 16h ago
Docs: man:systemd-sysv-generator(8)
Process: 34352 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
CGroup: /system.slice/apache2.service
??20407 /usr/sbin/apache2 -k start
??34370 /usr/sbin/apache2 -k start
??34371 /usr/sbin/apache2 -k start
Run Code Online (Sandbox Code Playgroud)
我想在 shell 中做一个简单的测试,以便明显地看到It Works!默认消息。
我跑
/var/www/html$ http://6.5.4.2
只收到:
-bash: http://6.5.4.2: No such file or directory
Run Code Online (Sandbox Code Playgroud)
有任何想法吗? …
我已经将我的 ubuntu 升级到 18.04,现在我想念我的 curl.so。
通常它会在这里 /usr/lib/php/20160501/curl.so 但它不见了。
在命令行上,我可以使用 curl,但不能在我的 php 代码中使用。
php -m | grep curl 导致
PHP警告:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/curl.so' - /usr/lib/php/20160303/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
Run Code Online (Sandbox Code Playgroud)
一个快速的解决方法是将“a” curl.so 放在该文件夹中,但我从哪里获得 curl.so?
我试图用 apt install php-curl 重新安装它,但这给了我
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an …Run Code Online (Sandbox Code Playgroud)