|
| /root | OpenBSD | FreeBSD |
| >> Main | System | Network | Daemons | Security | Software | Various |
|
Sections |
General Configuration directory: /var/www/confMost important configuration file: /var/www/conf/httpd.confSetting the default e-mail address as seen on the 404 pages, edit the ServerAdmin directive in httpd.conf:ServerAdmin alex{}purebsd.comIf you want users being able to have a homepage like http://purebsd.com/~alex
enable and set the UserDir directive in httpd.conf:UserDir public_htmlIf you'd like to have Apache see index.php too as a valid
index file, edit and/or set the DirectoryIndex directive in httpd.conf:DirectoryIndex index.php index.htmlIf you'd like Apache to resolve IP addresses, for usage in logfiles, the REMOTE_HOST variable, /server-status page, etcetera, set the HostnameLookups in httpd.conf to this:HostnameLookups OnIf you don't like Apache to report its version number and the hostname in 404 error pages, set the ServerSignature directive to Off in httpd.conf:ServerSignature OffVirtual hosts/domains If you'd like Apache to serve up name-based virtual hosts you first you need to define on which IP address(es) Apache will receive requests for them. Your name-based virtual host names usually resolve to this/these IP(s). So, edit httpd.conf to have something like this:
NameVirtualHost 192.168.0.1
Now, adding the so called virtual hosts (names) to Apache is rather easy. An purely arbitrary example:
# (www.)purebsd.comServerName is the name of the virtual host you'd like to have
Apache serve pages for.ServerAlias is an optional directive, indicating all possible aliases
for the same content (set of pages).The ServerAdmin sets the e-mail address (only) for this particular
virtual host.DocumentRoot is very important. It tells Apache where to grab the pages/content
of the virtual host. More accurately, it betrays the location of the directory holding the
pages for the virtual host. http://purebsd.com/hoeba.html is translated into
/var/www/htdocs/www.purebsd.com/hoeba.htmlThe ErrorLog directive dictates to Apache to which file it should log
occurring errors.CustomLog tells Apache about the whereabouts of the file where it should
write the non-error events off our virtual host.Sidenote: as to where the root of the DocumentRoot should be is mostly personal
taste. Some like to put websites in /var/www/htdocs/, some in /vol/www/,
others in /home/httpd/. Others mix it with a previously mentioned place for
their own sites/special sites and use /home/user/htdocs-www.example.org for
3rd party users. |
| Contact | Feedback | License | Copyright © 2000,2001,2002,2003,2004,2005,2006 PureBSD.com |
|
All rights reserved. |