Bill Patterson on 29 Jan 2016 14:19:48 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Apache2 weird problem


# Thank you.  That moved us forward.  So now, while I was no longer told that apache does not exist, I was given a set of errors which I could then track down.  It seems that there was a process hanging, in spite of rebooting that could be determined by
    netstat -ltnp | grep ':80'
#then I entered
    kill -9 1271
        where 1271 was the pid for the process revealed by the netstat command.
# My apache then lived until the next reboot, and then the problem returned.  I could do the same thing on the next boot to get my apache back.  BUT now there are 2 problems:  I have to do this to make apache start although it should just start on boot, AND NetBeans does not link correctly with apache.


# FYI, here is how I took the suggestion to get to this next point:
root@mymachine:/var/log/apache2# apt-get install --reinstall apache2-bin
Reading package lists... Done
Building dependency tree      
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 69 not upgraded.
Need to get 0 B/839 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 243515 files and directories currently installed.)
Preparing to unpack .../apache2-bin_2.4.7-1ubuntu4.9_amd64.deb ...
Unpacking apache2-bin (2.4.7-1ubuntu4.9) over (2.4.7-1ubuntu4.9) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up apache2-bin (2.4.7-1ubuntu4.9) ...
root@mymachine:/var/log/apache2# apache2ctl start
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
root@mymachine:/var/log/apache2# ls
access.log  error.log  other_vhosts_access.log
root@mymachine:/var/log/apache2# cat access.log
root@mymachine:/var/log/apache2# cat error.log
root@mymachine:/var/log/apache2# cat other_vhosts_access.log


--------------------------------------

On 01/29/2016 04:12 PM, Josh Zenker wrote:
OK, so it's actually the /usr/sbin/apache2 binary that's missing. That's provided by apache2-bin, so you'll need to do 

apt-get install --reinstall apache2-bin

On Friday, January 29, 2016, Bill Patterson <patterson@computer.org> wrote:
BTW this is Debian/Ubuntu: ubuntu 14.04 LTS

#I did what Rachel suggested:
root@mymachine:/etc/init.d# service apache2 status
root@mymachine:/etc/init.d# service apache2 configtest
root@mymachine:/etc/init.d# apt-get install --reinstall
Reading package lists... Done
Building dependency tree      
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.

#even if I include 'apache2' as a parameter to reinstall I get a similar result:
root@mymachine:/var/log# apt-get install --reinstall apache2
Reading package lists... Done
Building dependency tree      
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 69 not upgraded.
Need to get 0 B/87.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 243515 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.7-1ubuntu4.9_amd64.deb ...
Unpacking apache2 (2.4.7-1ubuntu4.9) over (2.4.7-1ubuntu4.9) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up apache2 (2.4.7-1ubuntu4.9) ...
root@mymachine:/var/log# apache2ctl start
/usr/sbin/apache2ctl: 143: /usr/sbin/apache2ctl: /usr/sbin/apache2: not found
Action 'start' failed.
The Apache error log may have more information.

#except the  error logs are empty.




On 01/29/2016 11:17 AM, Rachel Rawlings wrote:

The apache daemon is normally taken care of by apachectl, as Keith said above.

Look in /etc/init.d for your server control script (apache2, iirc, for Ubuntu) and do

$ sudo service apache2 status
$ sudo service apache2 configtest

If you have no running process and no errors, you can start the daemon again, but mist likely there's either an error in the config or a permission problem on thr logs (which have to be writable by apache).

If you have no daemon at all, then back up /etc/apache2 and do 'apt-get install --reinstall'

On Jan 29, 2016 12:04 AM, "Josh Zenker" <jzenker@gmail.com> wrote:
On my Ubuntu 14.04.3 system, it looks like the apache2 binary is actually installed by the apache2-bin package.

$ dpkg -L apache2-bin | grep '/usr/sbin'
/usr/sbin
/usr/sbin/apache2

Have you tried reinstalling apache2-bin? I believe it is a dependency for apache2 and may not have been reinstalled in your previous steps.

On Thu, Jan 28, 2016 at 11:34 PM, Bill Patterson <patterson@computer.org> wrote:
Dear Colleagues -

I don't know how it happened.  I was debugging PHP with NetBeans, and after a distraction I went back to it and found that the server wasn't running.  I tried to restart Apache.  I completely removed and purged it and reinstalled it.  It now says it is installed but if I type "apache2 -v" it says the program isn't installed:

me@mymachine:~$ sudo apt-get install apache2
[sudo] password for me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.
me@mymachine:~$ apache2 -v
The program 'apache2' is currently not installed. You can install it by typing:
sudo apt-get install apache2-bin
me@mymachine:~$


any ideas?

Bill
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug



___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug



___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug