apache not working, shows a "404 page not found" error - apache

i have been trying to set up apache2 on my ubuntu 16.04 but after successful install i get a 404 page not found error whenever i type localhost in the browser. I have uninstalled and installed apache2 several times but the problem still persists.
This is the output of my /var/log/apache2/error.log file..
[Tue Jun 26 02:20:52.809104 2018] [mpm_event:notice] [pid 1010:tid 139925306578816] AH00491: caught SIGTERM, shutting down
[Tue Jun 26 02:20:58.753357 2018] [mpm_event:notice] [pid 1359:tid 139843231913856] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Tue Jun 26 02:20:58.753554 2018] [core:notice] [pid 1359:tid 139843231913856] AH00094: Command line: '/usr/sbin/apache2'

Related

Apache2 not working after SSL certificate remove

im using vesta cp i remove the keys on the settings of the domain and the apache is not working how can i make it work again
Restarting web server apache2
...fail!
The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 83 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/conf.d/vesta.conf: Syntax error on line 1 of /home/admin/conf/web/sapache2.conf: without matching section
Action 'configtest' failed.
The Apache error log may have more information.
Error log
[Sun Dec 04 06:43:37.530259 2016] [:notice] [pid 1881]
mod_ruid2/0.9.8 enabled
[Sun Dec 04 06:43:37.535379 2016] [ssl:warn] [pid 1881] AH02292:
Init: Name-based SSL virtual hosts only work for clients with TLS
server name indication support (RFC 4366)
[Sun Dec 04 06:43:37.535844 2016] [mpm_prefork:notice] [pid 1881]
AH00163: Apache/2.4.7 (Ubuntu) mod_fcgid/2.3.9 PHP/5.5.9-1ubuntu4.17
OpenSSL/1.0.1f configured -- resuming normal operations
[Sun Dec 04 06:43:37.535858 2016] [core:notice] [pid 1881] AH00094:
Command line: '/usr/sbin/apache2'
[Mon Dec 05 18:42:53.735381 2016] [mpm_prefork:notice] [pid 1881]
AH00169: caught SIGTERM, shutting down
Run as root this command:
v-rebuild-user admin

Apache stop working. This site can’t be reached

My apache web server goes down several moment ago. I have Ubuntu 14.04 on digitalocean with PHP 7. When I visit my site, it shows this:
This site can’t be reached
crystalcrowd.ge refused to connect.
When I run service apache2 restart command, it Shows this:
* Restarting web server apache2
Segmentation fault (core dumped)
Action 'start' failed.
The Apache error log may have more information.
last Error in the error_log:
[Thu Dec 08 08:55:41.970435 2016] [mpm_prefork:notice] [pid 25213] AH00169: caught SIGTERM, shutting down
[Thu Dec 08 08:55:42.995218 2016] [mpm_prefork:notice] [pid 30673] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Thu Dec 08 08:55:42.995313 2016] [core:notice] [pid 30673] AH00094: Command line: '/usr/sbin/apache2'
[Thu Dec 08 08:58:17.074621 2016] [mpm_prefork:notice] [pid 30673] AH00169: caught SIGTERM, shutting down
[Thu Dec 08 08:58:18.087459 2016] [mpm_prefork:notice] [pid 30738] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Thu Dec 08 08:58:18.087522 2016] [core:notice] [pid 30738] AH00094: Command line: '/usr/sbin/apache2'
[Thu Dec 08 09:28:16.914107 2016] [mpm_prefork:notice] [pid 30738] AH00169: caught SIGTERM, shutting down
Last moment I was trying to set up mail server.

systemd[1]: Failed to start LSB: Apache2 web server

I have an Apache Web (version 2.4.10) server running on Debian 8 (Jessie). It is mainly used as a SVN repository server.
It was working well since a few weeks, and suddenly, I got an internal error when attempting to list the SVN repos from a Web Browser as can be seen below:
Apache Internal Error & Authentication
As you can see, authentication is still working fine.
I ran the 2 following commands:
systemctl status apache2.service
and
journalctl -xn
commands
But that doesn't help me much, maybe I'm missing something?
I did NOT modify any configuration file recently related to Apache (or even anything else for that matter): neither the main apache conf file nor any vHost conf file.
I tried restarting Apache, it does restart but the Web Server still encounters an internal error.
error.log:
[Sun Jan 31 18:36:17.372502 2016] [core:notice] [pid 27449:tid 140087289513856] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jan 31 18:37:07.641329 2016] [mpm_event:notice] [pid 27449:tid 140087289513856] AH00491: caught SIGTERM, shutting down
[Sun Jan 31 18:38:31.156131 2016] [wsgi:warn] [pid 1049:tid 140557851056000] mod_wsgi: Compiled for Python/2.7.8.
[Sun Jan 31 18:38:31.156330 2016] [wsgi:warn] [pid 1049:tid 140557851056000] mod_wsgi: Runtime using Python/2.7.9.
[Sun Jan 31 18:38:31.157222 2016] [mpm_event:notice] [pid 1049:tid 140557851056000] AH00489: Apache/2.4.10 (Debian) SVN/1.8.10 OpenSSL/1.0.1k mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations
[Sun Jan 31 18:38:31.157241 2016] [core:notice] [pid 1049:tid 140557851056000] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jan 31 19:21:39.401930 2016] [mpm_event:notice] [pid 1049:tid 140557851056000] AH00491: caught SIGTERM, shutting down
[Sun Jan 31 19:22:35.038612 2016] [wsgi:warn] [pid 1313:tid 139813423814528] mod_wsgi: Compiled for Python/2.7.8.
[Sun Jan 31 19:22:35.038672 2016] [wsgi:warn] [pid 1313:tid 139813423814528] mod_wsgi: Runtime using Python/2.7.9.
[Sun Jan 31 19:22:35.039592 2016] [mpm_event:notice] [pid 1313:tid 139813423814528] AH00489: Apache/2.4.10 (Debian) SVN/1.8.10 OpenSSL/1.0.1k mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations
[Sun Jan 31 19:22:35.039611 2016] [core:notice] [pid 1313:tid 139813423814528] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jan 31 19:24:57.303622 2016] [mpm_event:notice] [pid 1313:tid 139813423814528] AH00491: caught SIGTERM, shutting down
[Sun Jan 31 19:26:20.336578 2016] [wsgi:warn] [pid 1050:tid 140178825381760] mod_wsgi: Compiled for Python/2.7.8.
[Sun Jan 31 19:26:20.336805 2016] [wsgi:warn] [pid 1050:tid 140178825381760] mod_wsgi: Runtime using Python/2.7.9.
[Sun Jan 31 19:26:20.337601 2016] [mpm_event:notice] [pid 1050:tid 140178825381760] AH00489: Apache/2.4.10 (Debian) SVN/1.8.10 OpenSSL/1.0.1k mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations
[Sun Jan 31 19:26:20.337617 2016] [core:notice] [pid 1050:tid 140178825381760] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jan 31 19:31:24.663351 2016] [mpm_event:notice] [pid 1050:tid 140178825381760] AH00491: caught SIGTERM, shutting down
[Sun Jan 31 19:31:25.827873 2016] [wsgi:warn] [pid 1208:tid 139958437914496] mod_wsgi: Compiled for Python/2.7.8.
[Sun Jan 31 19:31:25.827919 2016] [wsgi:warn] [pid 1208:tid 139958437914496] mod_wsgi: Runtime using Python/2.7.9.
[Sun Jan 31 19:31:25.828655 2016] [mpm_event:notice] [pid 1208:tid 139958437914496] AH00489: Apache/2.4.10 (Debian) SVN/1.8.10 OpenSSL/1.0.1k mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations
[Sun Jan 31 19:31:25.828679 2016] [core:notice] [pid 1208:tid 139958437914496] AH00094: Command line: '/usr/sbin/apache2'
Could that come from the Python version that mod_wsgi is running which differs from what mod_wsgi is apparently expecting?
try two commands blow:
sudo apt-get purge apache2
sudo apt-get install apache2
after that use systemctl status apache2 to check you apache's status
These commands solved my problem:
sudo apt-get remove apache2
sudo apt-get install apache2
Note: if you use purge as another answer, you should set all Apache config again, But when you use remove it just removes core of Apache and after installing you don't need anything more.

Apache won't start on MAMP in Yosemite/Virtual Hosts don't resolve to their directories

I recently updated to Yosemite on my mac and I had been using virtual hosts on MAMP, and even after updating they were working fine, however I could not create a new virtual host. I messed around with a couple things, started and restarted apache and now all my virtual hosts resolve to a page that says "It Works!" and apache on MAMP won't start. I've already done the apache fix by changing the envarrs file to _envarrs. This is my apache error log file
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using
Harrys-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message
[Mon Nov 10 21:10:53.256847 2014] [mpm_prefork:notice] [pid 26139] AH00163: Apache/2.4.9 (Unix) PHP/5.6.2 configured -- resuming normal operations
[Mon Nov 10 21:10:53.256901 2014] [core:notice] [pid 26139] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Nov 10 21:12:14.386605 2014] [mpm_prefork:notice] [pid 26139] AH00169: caught SIGTERM, shutting down
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Harrys-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message
[Mon Nov 10 21:12:16.330823 2014] [mpm_prefork:notice] [pid 27444] AH00163: Apache/2.4.9 (Unix) PHP/5.6.2 configured -- resuming normal operations
[Mon Nov 10 21:12:16.330885 2014] [core:notice] [pid 27444] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Nov 10 21:13:12.913471 2014] [mpm_prefork:notice] [pid 27444] AH00169: caught SIGTERM, shutting down
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Harrys-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message
[Mon Nov 10 21:16:44.629618 2014] [mpm_prefork:notice] [pid 54] AH00163: Apache/2.4.9 (Unix) PHP/5.6.2 configured -- resuming normal operations
[Mon Nov 10 21:16:44.629939 2014] [core:notice] [pid 54] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Nov 10 21:27:57.710912 2014] [mpm_prefork:notice] [pid 54] AH00169: caught SIGTERM, shutting down
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Harrys-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message
[Mon Nov 10 21:28:04.948306 2014] [mpm_prefork:notice] [pid 3305] AH00163: Apache/2.4.9 (Unix) PHP/5.6.2 configured -- resuming normal operations
[Mon Nov 10 21:28:04.948362 2014] [core:notice] [pid 3305] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Error after upgrading to Apache 2.4.6

The "a2ensite""a2dissite" are not working
Echo:
ERROR: Site XXXXXX does not exist!
I swear it exists in sites-available folder.
After I typed a2ensite and double clicked the Tab button, it shows the /root directory.
There must be something wrong with the a2en/dissite script.
How can I make it back to work?
=====================
Here are the last lines of the error log:
[Sun Aug 04 22:59:31.406192 2013] [mpm_event:notice] [pid 5378:tid 140459282536256] AH00489: Apache/2.4.6 (Ubuntu) configured -- resuming normal operations
[Sun Aug 04 22:59:31.406433 2013] [core:notice] [pid 5378:tid 140459282536256] AH00094: Command line: '/usr/sbin/apache2'
[Sun Aug 04 23:09:44.648984 2013] [mpm_event:notice] [pid 5378:tid 140459282536256] AH00491: caught SIGTERM, shutting down
[Sun Aug 04 23:09:46.001182 2013] [mpm_event:notice] [pid 5692:tid 139671144335168] AH00489: Apache/2.4.6 (Ubuntu) configured -- resuming normal operations
[Sun Aug 04 23:09:46.001490 2013] [core:notice] [pid 5692:tid 139671144335168] AH00094: Command line: '/usr/sbin/apache2'
Renaming site configuration files in /etc/apache2/sites-available/* into *.conf helped.
Example, when enabling site dummy.com, configuration file must be named dummy.com.conf.
Another solution is to change this line in /etc/apache2/apache2.conf from:
IncludeOptional sites-enabled/*.conf
to:
IncludeOptional sites-enabled/*