You are not logged in.

#1 2008-10-29 16:20:29

Reploid
Member
From: Cold Country up North
Registered: 2008-03-27
Posts: 110

Starting Apache - how?

I have done: pacman -S apache, and edited the conf file according to the LAMP-tutorial. http://wiki.archlinux.org/index.php/LAMP
However, there is a small discrepancy between the tips in that tutorial and the ebook I am using to learn php, apache and MySQL: in the tutorial, it says to start the apache server by typing sudo /etc/rc.d/httpd start. In the "dummies" ebook, it says to type in apachectl start. But if I do the latter, I get the following message:

(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Now I am a little confused. If apachectl start isn't used on Arch to start apache, why does the command give me such an error message, and not something along the lines of: apachectl: command not found?

Is apache started with /etc/rc.d/httpd start, or do I need to clear out some conflicting issues to start it with apachectl start? (ports used by several programs?)

And additionally, having googled for a solution, several posts say to use the command lsof -i to list which programs are using which ports, but that command doesn't seem to do anything for me. ???

Last edited by Reploid (2008-10-29 16:31:44)

Offline

#2 2008-10-29 16:33:09

chimeric
Member
From: Munich, Germany
Registered: 2007-10-07
Posts: 254
Website

Re: Starting Apache - how?

Reploid wrote:

[...] why does the command give me such an error message, and not something along the lines of: apachectl: command not found?

The command is there, but you either have to use sudo or be root to execute it.

Reploid wrote:

Is apache started with /etc/rc.d/httpd start, or do I need to clear out some conflicting issues?

Yes, however, you can use apachectl to manually start apache as well  (personally I'd recommend to use the former, this init script will call apachectl for you). Additionally, if you want to start apache automatically on boot up you can add "httpd" to your daemons array in /etc/rc.conf.

Offline

#3 2008-10-29 18:02:42

Reploid
Member
From: Cold Country up North
Registered: 2008-03-27
Posts: 110

Re: Starting Apache - how?

So it was just a permissions-problem. big_smile I should know better by now, and type sudo as a reflex.

Well, thx, chimeric.

Schönen Abend noch.

Offline

#4 2008-10-29 22:59:35

Jack B
Member
Registered: 2006-06-27
Posts: 107
Website

Re: Starting Apache - how?

To clarify furthor on what chimeric said, "apachectl start" is the command used to start apache.  If you use "/etc/rc.d/httpd start" it will run "apachectl start" to actually start apache.

Using the rc.d way has a few advantages:
- It will remember apache is running, and stop it cleanly (using /etc/rc.d/httpd stop) on shutdown
- It can be run as part of the boot process by adding httpd to the Daemons line in /etc/rc.conf

The reason this is not in your book is that Arch uses a somewhat unusual BSD-like way of running and keeping track of daemons.  It is IMO much easier to use than the alternatives.  You can learn more about it on the wikki

Offline

Board footer

Powered by FluxBB