|
||||
|
Apache 2.0 ConfigurationBy Joshua Erdman Installing any of the Linux Services is a snap, you can do it during your Linux installation or just use the RPM program and install the package. But even after you think you got Apache up and running you can easily fall into some snags: Clue 1: After you install Apache, the RedHat default is to not start it on bootup (even though it is installed it is not running). Clue 2: You may also need to open the built-in firewall to allow incoming port 80 and port 443 packets. Below are the configuration steps we must complete to get Apache working as a
static HTML only web server. The next article (coming soon) will discuss
setting it up for dynamic programming such as PHP (coming soon). Getting Apache to RunFrom the command prompt you will need to:
Opening the Firewall (IP Tables)OK, now we need to open the firewall (do not bother doing this if you chose not to install the firewall option when you first set up your Linux box). Take a look at your current firewall configuration: pico /etc/sysconfig/iptables What you are loking at is the current firewall config listing all the allowed incoming
traffic. You need to copy one of the configuration lines and then modify it for the web server. To do this:
Apache Config FileThe Apache Config File is located at /etc/httpd/conf/httpd.conf In it are all the settings to specify default documents, configure virtual hosts (the hosting of multiple websites with one web server), specifying log files settings, etc. Setting Default DocumentThe defualt document directive allows someone to see your index page by
navigating to www.yoursite.com instead of www.yoursite.com/index.html DefaultDocuments index.html Some people prefer the default document to be index.html, it really doesn’t matter, you can even have multiple default documents. Hosting multiple websitesIf you plan to host multiple websites on your web server, you first need to create a virtualhost directive for the default site. The ServerName and DocumentRoot directives should be the same as the Global directives listed higher up in the config file. The format of a typical virtual host can be found below: #www.defaultsite.com Below are all the common directives you may use for the rest of your virtual hosts: #www.site1.com
Apache Security ContextsYou are not done yet. In addition to setting the correct file security (chmod 711) you need to set the context: chcon -t httpd_sys_content_t /filepath See our little article on chcon for more info. Apache PerformanceNeat! - Apache 2.0 also allows you to compress the outgoing data. This does not include graphics, just the static code. Compression will save you precious bandwidth but will also tax more CPU. If you need this you better hope your server is not an old 486. Article last reviewed: 02/12/2005
|
Related Articles: Books: Web Servers
Search Amazon.com for Top Articles: |
||||||