Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Why does init.d/apache2 require net?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
pizzach
Apprentice
Apprentice
User avatar
Posts: 195
Joined: Mon Aug 28, 2006 8:55 pm

Why does init.d/apache2 require net?

  • Quote

Post by pizzach » Sat Jun 12, 2010 4:06 pm

I don't always have a wireless connection on my laptop and sometimes I like to use my computer to show clients specific webpages on my local hard drive. Since they use PHP, I have no choice and have to have a web server running to parse the code.

Once I removed the requirement for net from /etc/init.d/apache2, all has become fine. Shouldn't apache start up fine anyway as long as net.lo is running? I mean, the loopback device is why you can use localhost etc to connect to yourself right? It just doesn't lead to the outside world.
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10898
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Sat Jun 12, 2010 4:26 pm

Probably more than 99% of all Apache deployments serve web pages off of localhost, so requiring net is the more correct implementation for the vast majority of users. You've discovered the correct modified solution for your particular case, so all is well with the world. :)

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

Re: Why does init.d/apache2 require net?

  • Quote

Post by Hu » Sat Jun 12, 2010 4:39 pm

pizzach wrote:Shouldn't apache start up fine anyway as long as net.lo is running? I mean, the loopback device is why you can use localhost etc to connect to yourself right?
Not necessarily. Apache needs to be able to bind to its specified listen addresses when it starts. If you have configured it to listen to a specific non-loopback address, then Apache cannot start until some interface is configured with that address. Hence, Apache cannot start until the initscript for that interface has run. In theory, the Apache initscript could be enhanced to examine the Apache configuration file and choose either need net or need net.interface, depending on whether Apache has a wildcard/loopback bind or a specific non-loopback bind. However, Apache configuration files are complicated, so it might be easier just to move that to a variable in /etc/conf.d/apache2 and let the administrator set it properly for his site.
Top
pizzach
Apprentice
Apprentice
User avatar
Posts: 195
Joined: Mon Aug 28, 2006 8:55 pm

  • Quote

Post by pizzach » Sat Jun 12, 2010 5:53 pm

Sorry guys. Let me try to be clear about what I think it wrong. Shouldn't net.lo be sufficient to start apache2/vsftpd etc when the init.d script has net required? I think I am either missing something, or that may be a bug in gentoo marked as a feature.
Top
broken_chaos
Guru
Guru
Posts: 370
Joined: Wed Jan 18, 2006 7:47 am
Location: Ontario, Canada

  • Quote

Post by broken_chaos » Sat Jun 12, 2010 7:32 pm

Have you set RC_NET_STRICT_CHECKING="lo" in /etc/conf.d/rc (if using baselayout-1)?

If you're using baselayout-2/openrc, you might be able to set rc_apache2_need="!net" in /etc/rc.conf to accomplish the same thing as you've already done, without editing the init.d script.
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Jun 12, 2010 8:19 pm

pizzach wrote:Let me try to be clear about what I think it wrong. Shouldn't net.lo be sufficient to start apache2/vsftpd etc when the init.d script has net required? I think I am either missing something, or that may be a bug in gentoo marked as a feature.
I understand exactly what you want, and I am saying that it is configured the way it is because for most users, the shipped behavior is correct. Your need to run a webserver without offering service to any other machines, although not unpredecented, is atypical. Configuring the system as you have done allows the initscript to start Apache at a time when, for a more typical configuration, functionality required by Apache would not be available, resulting in a startup failure. For your use case, starting net.lo is adequate, but the initscript currently has no way to recognize that, so it requests the more complete functionality offered by bringing up a non-loopback interface.

As broken_chaos notes, there are configuration settings you can use to affect this without modifying the initscript. I grant that the support for your particular situation is not as simple as it could be. I think the developers would be willing to accept patches to improve that support, if the patches were well written and free of negative side effects. I think that the relatively rare nature of your use case results in a lack of interest in improving that support on the hope that someone might find it useful.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic