After Installing my first Linux system the joy's of having your own webserver to play with was hard to match.
But I have found something that does. Setting apache up to do what you want it to do. Before we start a few points:
If you have apache installed, but it's not running you'll need to edit your startup scripts to start it up when you boot your system. < see the Documentation of your distribution to see how this is done > Installing Apache Web ServerQ:) Where to get Apache ? A:) Best place would be the Apache home page
Q:) What else do I need ?
Q:) What version do I download ? Now What ?
Ok once you have your version in whichever format time for installing to start.
Estaga was kind enought to supply us with the debian package install syntax.
The package managers will install all the pre-compiled versions so there is no compiling needed. In a directory you created or use for compiling source extract the file using tar and gzip. tar -zxvf apache-version.tar.gz tar syntax is : z = use gzip compression x = extract v = verbose ( list all messages ) f = uses a archive device Enter the newly extracted directory. So setup apache for compiling you need to setup a few things depending on your system. Luckily there is a programm ( script ) that does this all for you. so at this point type in ./configure --prefix=/www This will setup apache for your system with the base install path as /www it will create and install apache there for you. After the configuring is complete you can type make to compile the source code make install to install the compiled binaries and configuration files After all is made and install time to see if everthing worked.
mkdir /www/share/apache/htdocs/homepage
mkdir /www/share/apache/htdocs/newpage1
mkdir /www/share/apache/htdocs/newpage2 Once you have created the directories where the virtual domain are going to be hosted you need to edit the configuration files to know where to look. use your favorite editor and open /www/etc/apache/http.conf file go to the end of the file where the virtual domain section is. If you have multiple network cards and IP addresses you'll use the VirtualHost syntax. If you are hosting all the sites on one IP address or host then your use the NameVirtualHost syntax as well. For both do the following. The template looks like this
#<VirtualHost host.some_domain.com> Now change the infomation to reflect the domain information. Lets say I'm hosting a site called games.tudols.com it will look like this.
#<VirtualHost 192.168.1.1>
P.S. please note I used an IP address. The IP address is that which the hostname, games.tudols.com, resolves to.If you are going to host only one site .. then this addition to your http.conf file will be enough. If however you want more then one and you only have one IP address you'll have to use the _NEW_ NameVirtualHost syntax. ( only relevant for apache 1.3.3 and after ) To do so add the line NameVirtualHost 192.168.1.1 before the VirtualHost settings. Also make sure that the IP addresses is correct. Then just have the IP address that you specify in your NameVirtualHost in the VirtualHost part of the Host setup. Now run apachectl start to start up your webserver again. Now you have installed apache, configured it for hosting and restarted it with the new settings. You'll have to do some editing of your /etc/rc.d/rc.local file to get apache to start up everytime linux boots up < see the Documentation of your distribution to see how this is done >, otherwise your Apache Webserver is now Up and running. Unfortunately because Apache is such a big program with so much settings I cannot cover every possible setup or install setting ( there is lots ) please refer to the documentation you get with Apache or visit their website for more information. If you have any suggestions or additions to this install guide please mail me at [email protected] |