faq
search
add article
cool-stuff
how-to
main
tips
|
Posted by Jason on Saturday October 20, @11:26AM
from the world-wide-web dept.
This post covers the basics of installing the Apache web server for personal use. It is not an in depth article, but it will
help a newbie get started with the Apache web server running on FreeBSD.
In case you have been living in cave banging rocks together for the last
few years, Apache is a web server. A very fast and powerful OpenSource
web server which is used by some of the largest websites worldwide. If you
go to the Netcraft website and check uptimes, you will
notice two things: BSD runs longer than most other OS's before requiring
a reboot, and the web server those boxes are running is Apache. You will
also find that Apache is run on over 50% of the websites worldwide.
Okay! Enough soap box evangelizing of Apache. Let's get on with installing it.
There are just few basic steps to configuring Apache.
[1 - download and install Apache]
[2 - start and test the server]
[3 - create content and restart Apache]
Here are the steps to setup apache. This is what most people
will want to do in order to setup a personal web server.
[1 - download and install Apache]
You must be logged in as root in order to install programs from the
ports collection.
cd /usr/ports/apache13
make install && clean
[2 - start and test the server]
Here is how to start and test the apache web server. Once you have determined that
apache is up and running, you can replace the default content with your
own web pages.
/usr/local/etc/rc.d/apache.sh start
Note: Apache will automatically start each time the system is rebooted.
You should now be able to connect to your apache web server with your
browser on the local computer or a remote computer on the same network.
If you have netscape, lynx or some other browser on the machine apache
is installed on, you can test it with one of these urls.
http://localhost
http://127.0.0.1
http://{your ip address}
From a remote machine you could use:
http://{your apache hosts ip address}
Once you have used your web browser to test that the server is up and running, you should see apache's Congratulations splash screen displayed.
[3 - create content and restart Apache]
Once you've authored some html web content, you should place it in the /usr/local/www/data/ directory, restart apache and test it with your browser.
example:
cp /usr/home/jason/index.html /usr/local/www/data/
killall -hup httpd
You can also start and stop apache with the start and stop command from the rc.d script:
/usr/local/etc/rc.d/apache.sh stop
/usr/local/etc/rc.d/apache.sh start
For in depth information on Apache I recommend Apache the definitive guide by O'Reilly Publishing. You can also check the man pages.
man httpd
man apachectl
man kill
man killall
Important Stuff:
Note: Fields with bold titles are required.
Please try to keep posts on topic.
Try to reply to other people comments instead of starting new threads,
Read other people's messages before posting your own to
avoid simply duplicating what has already been said.
Use a clear subject that describes what your
message is about.
Please do not post offtopic, inflammatory, inappropriate, illegal,
or offensive comments. Repeat offenders will be sanctioned.
|