Difference between revisions of "Tung httpd conf"

From CDOT Wiki
Jump to: navigation, search
Line 1: Line 1:
<b><big><big>Installing and Configuring Firewall</big></big></b>
+
==Running and Configuring Apache Server==
 
 
  
 
<b><big>Introduction</big></b>
 
<b><big>Introduction</big></b>
  
<font face="Georgia">In this page, you are going to create a firewall that allows only outside world view the web page in your server
+
<font face="Georgia">In this page, you are going to set up a Apache server and allow a user create his own personal web page.
 
</font>
 
</font>
  
 
+
===Creating a Public Web Page===
<b><big>Instruction</big></b>
+
# Login as root user
#Login as root user
+
# Configure the Apache server to start when the Fedora is booted: chkconfig httpd on
#Clear up the rules in your iptables: <b><code><font color=green >iptables -F</font></code></b>
+
# Start the Apache server: service httpd start
#Change the input chain default policy to drop: <b><code><font color=green >iptables -P INPUT DROP</font></code></b>
+
# Create index.html in /var/www/html/ directory, write some html code in the file
#Create a rule that allow outside to access http port only: <b><code><font color=green >iptables -I INPUT -p tcp --dport http -j ACCEPT</font></code></b>
+
# Open a browser, and enter http://localhost. Your page should display.
#Change the input chain default policy to drop: <b><code><font color=green >iptables -P OUTPUT DROP</font></code></b>
+
# Make web page accesses by other hosts: iptables -I INPUT -p tcp --dport http -j ACCEPT
#Create a rule that allow packets to output from http port only: <b><code><font color=green > iptables -I OUTPUT -p tcp --sport http -j ACCEPT</font></code></b>
 
#View your web page from other virtual machine. The web page should be displayed.
 
#Try to <b>ssh</b> and <b>ping</b> from virtual machine to your server. All connections should be blocked.
 
#Save your iptables rules: <b><code><font color=green >service iptables save</font></code></b>
 

Revision as of 18:29, 27 July 2011

Running and Configuring Apache Server

Introduction

In this page, you are going to set up a Apache server and allow a user create his own personal web page.

Creating a Public Web Page

  1. Login as root user
  2. Configure the Apache server to start when the Fedora is booted: chkconfig httpd on
  3. Start the Apache server: service httpd start
  4. Create index.html in /var/www/html/ directory, write some html code in the file
  5. Open a browser, and enter http://localhost. Your page should display.
  6. Make web page accesses by other hosts: iptables -I INPUT -p tcp --dport http -j ACCEPT