|
L i n u x H e l p
: :
: :
: :
: :
|
Apache Virtual Hosts
Apache is an open source web server that is currently dominating the
market because of it's low cost (nothing) and ease of use and
configuration. There is a large support database available from
www.apache.org and the source is freely available from the same site.
Apache also offers ease of use for Perl, PHP, JServ (Java Servlets) and
CGI scripts.
There are two ways to do webhosting, IP Based Virtual Hosting which binds
one IP address to a specific URL and Name-Based Virtual Hosting which allows
mulitple domain names to operate on one IP.
Installing:
Hopefully, you have already realized that you need to have Apache installed
before going any further. Click here if you need instructions on
how to install Apache.
Configuring:
cd to the apache directory (/usr/local/apache).
There are several subdirectories (conf, bin, logs). Start in the conf
directory. Edit the file httpd.conf using the command 'vi conf/httpd.conf'.
If the vi editor is foreign to you, you can brush up on editor commands with
the vi editor tutorial
There are 2 ways to run apache, IP based Virtual Hosting and Name-Based
Virtual Hosting.
The NameVirtualHost directive
-=-=-=-=-=-
NameVirtualHost 192.168.1.10:8080
REQUIRED for Name-based virtual hosting. (A * can be used to specify that
the server is only doing Name-Based Virtual Hosting). The line above tells
httpd to only run name based virtual hosts on 192.168.1.10 port 8080.
The following tells httpd to listen for name based virtual hosts on all interfaces
NameVirtualHost *
The BindAddress Directive
-=-=-=-=-=-
For IP Based hosting, you need to add each IP that apache will listen on.
BindAddress 192.168.1.20 192.168.1.25 10.0.0.1
NOTE: The IPs MUST be the IP bound to the interfaces, and IPs from
multiple interfaces can be used. (A * can be used for all IPs on a given
machine)
The <VirtualHost> Directive
-=-=-=-=-
This works the same for IP and name based virtual hosting, with the
exception of the ServerName and ServerAlias being absent with IP Based
Virtual Hosting
Examples
-=-=-=-==-
Name-Based Virtual Hosting
#The following VirtualHost directive will answer for domain.com and
*.domain.com (* being a wildcard)
<VirtualHost 192.168.1.10>
ServerAdmin admin@domain.com
ServerName domain.com
ServerAlias *.domain.com
DocumentRoot /home/user/www
ErrorLog logs/domain.com-error_log
TransferLog logs/domain.com-access_log
ScriptAlias "/cgi-bin/" /home/user/www/cgi-bin
</VirtualHost>
# This Virtual Host will answer for circle.com, square.com and
triangle.com. It *WILL NOT* answer for www.circle.com, www.square.com or
www.triangle.com.
<VirtualHost 192.168.1.10>
ServerAdmin admin@circle.com
ServerName circle.com
ServerAlias square.com
ServerAlias triangle.com
ErrorLog logs/circle.com-error_log
TransferLog logs/circle.com-access_log
ScriptAlias "/cgi-bin/" /home/circle/www/cgi-bin
</VirtualHost>
IP Based Virtual Hosting
#This example will serve up trapeziod.com content to anyone browsing 10.0.0.1
<VirtualHost 10.0.0.1>
ServerAdmin admin@trapezoid.com
ErrorLog logs/trapezoid.com-error_log
TransferLog logs/trapezoid.com-access_log
DocumentRoot /home/trapezoid/www
ScriptAlias "/cgi-bin/" /home/trapezoid/www/cgi-bin
</VirtualHost>
Starting and Stopping
-=-=-=-=-=-=-
Start:
cd /usr/local/apache/bin
./apachectl start
Stop:
cd /usr/local/apache/bin
./apachectl stop
Status of currently running server:
cd /usr/local/apache/bin
./apachectl status
Thanks to Neal Krummell at http://tomsvw.com for starting this tutorial.
|
|
|
|
|
L i n u x W o r l d N e w s
: :
: :
: :
: :
|
|
|
What in the hell is a KrnlPanic? Well, a KrnlPanic is me! Actually, let's start with "What is a kernel?". The
kernel is the core of your operating system (OS), whether your OS is Linux, Unix or windows. The kernel takes
care of all process management (what program runs and when), memory management (which parts of memory get used for what) and
also, the kernel takes care of interfacing the OS with your computer's hardware (disk drives, sound card, modem, network card, etc).
Now...since the kernel is doing all of these extremely important jobs, it stands to reason
that if it has an error, it will be a Bad Thing(tm).
If you use windows, you know a kernel panic as a "BSOD" or Blue Screen of Death. Or how about "Invalid Page
Fault in KERNEL32.DLL". I'm sure you've probably seen both of those. In Linux, a Kernel Panic is normally plainly stated
so. At boot time is when you will see most linux panics. I have yet to see a linux kernel panic while the system is running.
You may have seen "Kernel Panic: init not found" or "Kernel Panic: VFS unable to mount root fs on 2:00". All of these previously
listed errors are because of something that happened to the kernel that it couldn't handle, whether it was an access to an
invalid memory location or the inability to find the initialization files it requires.
I hope that sufficiently explains things. Oh yeah...KrnlPanic is also my name ;-)
- Rick
|
|
|
|
|
|
S l a s h d o t / F r e s h m e a t
: :
: :
: :
: :
|
Slashdot and Freshmeat Headlines at 1268350038
(Unixtime)
|
|
|
|