Author Topic: Problem with httpd  (Read 231 times)

Offline ianw

  • Full Member
  • ***
  • Posts: 69
Problem with httpd
« on: February 28, 2013, 07:35:22 AM »
Hi All

I hope I can get some help here. I have just upgraded my two computers here from PCLOS 2012.07 to PCLOS 2013.02. One of them seems fine but I have a problem with the other.

I have a MySQL Database with LibreOffice Base as the Front End. However when I set-up the MySQL, MyAdmin and associated programs I hit a problem with httpd. When I install it I get the error message ...

"Warning: network-up is needed by httpd in runlevel 4"

And as a result I'm unable to set httpd the 'Run at Boot' and 'Start'.

I'm told that this is something to do with the Network not starting early enough in the Boot Cycle.

Can anyone help me out with this please??

Many thanks.


IanW
Pretoria, South Africa
PCLOS 2013-4

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3992
Re: Problem with httpd
« Reply #1 on: February 28, 2013, 12:11:06 PM »
Is network-up set to start at boot?

I've never been unable to start a service at boot. When do you get the warning? If you got it during installation you can just ignore it and make sure network-up is set to start at boot. It might slow the boot or cause it to hang while the network starts.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5335
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Problem with httpd
« Reply #2 on: February 28, 2013, 10:15:28 PM »
Hi All

I hope I can get some help here. I have just upgraded my two computers here from PCLOS 2012.07 to PCLOS 2013.02. One of them seems fine but I have a problem with the other.

I have a MySQL Database with LibreOffice Base as the Front End. However when I set-up the MySQL, MyAdmin and associated programs I hit a problem with httpd. When I install it I get the error message ...

"Warning: network-up is needed by httpd in runlevel 4"

And as a result I'm unable to set httpd the 'Run at Boot' and 'Start'.

I'm told that this is something to do with the Network not starting early enough in the Boot Cycle.

Can anyone help me out with this please??

Many thanks.


Open a console window and type in

chkconfig --list  <press return/enter>

find the line starting with httpd and post that line.

Example:

[dwmoar@laptop dwmoar]$ chkconfig --list
acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off   7:on
alsa            0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off
apmd            0:off   1:off   2:on    3:on    4:on    5:on    6:off   7:off
apmiser         0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off
apt             0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off
atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off   7:off
avahi-daemon    0:off   1:off   2:off   3:on    4:off   5:on    6:off   7:off
bpalogin        0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off
coherence       0:off   1:off   2:off   3:on    4:on    5:on    6:off   7:off
cpufreq         0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off   7:off
cups            0:off   1:off   2:on    3:on    4:on    5:on    6:off   7:off
denyhosts       0:off   1:off   2:off   3:on    4:on    5:on    6:off   7:off
dm              0:off   1:off   2:on    3:off   4:on    5:on    6:off   7:on
haldaemon       0:off   1:off   2:on    3:on    4:on    5:on    6:off   7:on
hddtemp         0:off   1:off   2:on    3:on    4:on    5:on    6:off   7:off
httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off
ibod            0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off


To change it, open a console window as root enter the following command

chkconfig  --level 2345 httpd on      <press return/enter>


You should see the following

[root@laptop dwmoar]# chkconfig  --level 2345 httpd on
Warning: network-up is needed by httpd in runlevel 4
Warning: network-up is needed by httpd in runlevel 4
Warning: network-up is needed by httpd in runlevel 4
Warning: network-up is needed by httpd in runlevel 4

Ignore these warnings

Again enter chkconfig --list  <press enter/return>

Look for the httpd line. It should now look like this

httpd           0:off   1:off  2:on    3:on    4:on    5:on    6:off   7:off

Enter the following command

service xinetd restart  <press return/enter>

You should see this

[root@laptop dwmoar]# service xinetd restart
Stopping xinetd                                                                              [  OK  ]
Starting xinetd                                                                               [  OK  ]
[root@laptop dwmoar]#

Now enter the following

service httpd start   <press enter/return>

You should see this

[root@laptop dwmoar]# service httpd start
Starting httpd:                                                                              [  OK  ]
[root@laptop dwmoar]#

If you see this
[root@laptop dwmoar]# service httpd start
apache is already running.
[root@laptop dwmoar]#

then use the command    service httpd restart    instead

Your web erver is now running and it is set to start upon booting.







Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline ianw

  • Full Member
  • ***
  • Posts: 69
Re: Problem with httpd
« Reply #3 on: March 01, 2013, 02:38:21 AM »
Thanks YouCanToo

I have gone through the steps you sent.

However I get a [FAILED] on the last step ...

[root@localhost ian]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for localhost.localdomain
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                 [FAILED]
IanW
Pretoria, South Africa
PCLOS 2013-4

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3992
Re: Problem with httpd
« Reply #4 on: March 01, 2013, 06:43:42 AM »
That means you haven't set your server name or configured httpd properly. You need to set up your computer to run httpd and set up httpd to run on your computer in the way you want. Apache is a very fussy program that will not start unless it is can make sense of its environment and configuration. For a program designed to accept requests from the whole Internet where security is vital you wouldn't want anything less.

There is no option in setting up Apache, other than working out exactly how you want to use it and reading the documentation to find out how.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5335
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Problem with httpd
« Reply #5 on: March 01, 2013, 02:02:22 PM »
Thanks YouCanToo

I have gone through the steps you sent.

However I get a [FAILED] on the last step ...

[root@localhost ian]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for localhost.localdomain
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                 [FAILED]


What does the "Listen directive show in the httpd.conf file

The httpd.conf file is located at /etc/httpd/conf/httpd.conf

Open it in a text editor and do a search for Listen

You should see something like this

# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
 Listen *:80


In my example above my server is set to listen to all IP on the server on port 80. So it would listen for the IP 192.168.1.125 which is the machines address as well as 127.0.0.1 which is the machines loop back IP.  Don't forget that when you make changes to the web servers conf file you have to restart the web server in order for it to use the new configuration changes

as the root user in a console window use this command

service httpd restart

Once this is done you can check to verify the status of Apache using the following command

service httpd status

EDIT:  Also check the ServerName directive.

It should look something like my example below

# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#     
#ServerName www.example.com:80
ServerName localhost.localdomain
« Last Edit: March 01, 2013, 02:07:21 PM by YouCanToo »




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline ianw

  • Full Member
  • ***
  • Posts: 69
Re: Problem with httpd
« Reply #6 on: March 02, 2013, 07:13:00 AM »
Thanks again YouCanToo

What does the "Listen directive" show in the httpd.conf file? - only 80 (in many locations).

ServerName directive. 'useCanonicalName OFF' - Changed to 'ServerName localhost.localdomain'

service httpd restart - Stopping OK, Starting OK

Start MyAdmin, enter user and pwd - #1045 Cannot log in to the MySQL server.

My SQL Server IS running and I have edited the 'my.cnf' to enable network (localhost) access. but httpd will still not start in the PCC.

This is VERY strange!! I have never had this before and it is now only happening on one of my computers - (It has to be the one I really want the DB working of course). I have even tried by re-installing the new OpSys again and nothing has changed!!



IanW
Pretoria, South Africa
PCLOS 2013-4