pavement

Apache, Controlling

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(Remove spam about goodville from user DavidYoung.)
(minor updates)
Line 44: Line 44:
  
 
[[Category:Common Tasks]]
 
[[Category:Common Tasks]]
 +
 +
== Little Things You Can Do to Make the World a Lot Nicer ==
 +
 +
A few years ago, Debbie Tenzer was feeling overwhelmed by all the crises in the news. But rather than give in to despair, she thought, Maybe I cant solve our big problems, but I know I can do something.
 +
 +
[[http://goodvillenews.com/Little-Things-You-Can-Do-to-Make-the-World-a-Lot-Nicer-PxxL5F.html Little Things You Can Do to Make the World a Lot Nicer]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 +
 +
== The Importance of Learned Optimism ==
 +
 +
What 25 years of research reveal about the cognitive skills of happiness and finding lifes greater purpose.The illiterate of the 21st century, Alvin Toffler famously said, will not be those who cannot read and write, but those who cannot learn, unlearn, and relearn. Our outlook on the world and our daily choices of disposition and behavior are in many ways learned patterns to which Tofflers insight applies with all the greater urgency
 +
 +
[[http://goodvillenews.com/The-Importance-of-Learned-Optimism-jmZjsG.html The Importance of Learned Optimism]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 +
 +
== Cat Saves Owner Hours After Adoption ==
 +
 +
A newly-adopted cat repaid his owners loving gesture earlier this month by saving her from a medical emergency just hours after he was brought home, the Green Bay Press Gazette reports.
 +
 +
[[http://goodvillenews.com/Cat-Saves-Owner-Hours-After-Adoption-ixHpp7.html Cat Saves Owner Hours After Adoption]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 +
 +
== The Opposite Of Poverty Is Justice ==
 +
 +
 +
 +
[[http://goodvillenews.com/The-Opposite-Of-Poverty-Is-Justice-oqL04K.html The Opposite Of Poverty Is Justice]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 +
 +
== Student Goes From Homeless to Harvard ==
 +
 +
Despite being abandoned to homelessness by her parents, Dawn Loggins worked as a high school custodian by day and studied hard by night to become the first person from her school to ever be admitted to Harvard.
 +
 +
[[http://goodvillenews.com/Student-Goes-From-Homeless-to-Harvard-QX9Vg4.html Student Goes From Homeless to Harvard]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]

Revision as of 03:25, 9 August 2012

Want to see if it works? If you just got done installing Apache, first of all, issue a rehash command to reindex your system's PATH. Then let's get started:

ph34r# apachectl start
/usr/local/sbin/apachectl start: httpd started

Don't take its word for it, though - sometimes apachectl lies through its teeth. Let's make sure we really do have some httpd processes running:

ph34r# ps ax | grep http
18564  ??  SsJ    0:00.74 /usr/local/sbin/httpd
18566  ??  IJ     0:02.71 /usr/local/sbin/httpd
18567  ??  IJ     0:01.12 /usr/local/sbin/httpd
18568  ??  IJ     0:00.64 /usr/local/sbin/httpd
18569  ??  IJ     0:02.10 /usr/local/sbin/httpd
18570  ??  IJ     0:06.16 /usr/local/sbin/httpd
18612  ??  IJ     0:03.00 /usr/local/sbin/httpd
18621  ??  IJ     0:03.94 /usr/local/sbin/httpd
18639  ??  IJ     0:05.96 /usr/local/sbin/httpd
18644  ??  IJ     0:01.60 /usr/local/sbin/httpd
18645  ??  IJ     0:02.05 /usr/local/sbin/httpd

Okay, good, looks kosher. You're probably going to want Apache to run automatically whenever the server boots, though, right? Well, there are two ways to go about doing that. One way is to edit /etc/rc.conf and set some variables that will then cause the default apache.sh / apache2.sh startup script that the port placed in /usr/local/etc/rc.d to actually do something when the machine starts... but we're not going to talk about that way, because I personally despise forcing the administrator to maintain two files where one would do. So instead, we're just going to write our own script for /usr/local/etc/rc.d that will start Apache all on its lonesome, regardless of what is or isn't in /etc/rc.conf. So make yourself a new script and name it /usr/local/etc/rc.d/apache.sh, and make it look like this:

#!/bin/sh

case "$1" in
start)
        /usr/local/sbin/apachectl start > /dev/null && echo -n ' apache'
        ;;
stop)
        /usr/local/sbin/apachectl stop > /dev/null && echo -n ' apache'
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0

Now you'll want to make sure that your new script 1. can get executed when the system starts, and 2. won't get clobbered the next time you upgrade Apache from the ports tree, so make it executable but NOT writeable:

ph34r# chmod 555 /usr/local/etc/rc.d/apache.sh

There you go - now that you've got a handle on starting and stopping Apache, move on to the basics of Configuring Apache.

Contents

Little Things You Can Do to Make the World a Lot Nicer

A few years ago, Debbie Tenzer was feeling overwhelmed by all the crises in the news. But rather than give in to despair, she thought, Maybe I cant solve our big problems, but I know I can do something.

[Little Things You Can Do to Make the World a Lot Nicer]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

The Importance of Learned Optimism

What 25 years of research reveal about the cognitive skills of happiness and finding lifes greater purpose.The illiterate of the 21st century, Alvin Toffler famously said, will not be those who cannot read and write, but those who cannot learn, unlearn, and relearn. Our outlook on the world and our daily choices of disposition and behavior are in many ways learned patterns to which Tofflers insight applies with all the greater urgency

[The Importance of Learned Optimism]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Cat Saves Owner Hours After Adoption

A newly-adopted cat repaid his owners loving gesture earlier this month by saving her from a medical emergency just hours after he was brought home, the Green Bay Press Gazette reports.

[Cat Saves Owner Hours After Adoption]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

The Opposite Of Poverty Is Justice

[The Opposite Of Poverty Is Justice]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Student Goes From Homeless to Harvard

Despite being abandoned to homelessness by her parents, Dawn Loggins worked as a high school custodian by day and studied hard by night to become the first person from her school to ever be admitted to Harvard.

[Student Goes From Homeless to Harvard]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Personal tools