Tuesday, September 6, 2011

Setup a Dedicated Web Server using Linux Ubuntu Cloud and Ubuntu Enterprise

Installing a Firewall

sudo cp /usr/share/doc/shorewall-common/myfwconfig/one-interface/* /etc/shorewall/

Note: sudo - super user do


Now, open the “rules” file:

sudo nano /etc/shorewall/rules


etc - directory for maintain lots of files.

text editor in linux

1. nano

2. vi or vim

3. emacs

4. pico

5. gedit

6. bluefish

Add these lines above where it says “#LAST LINE”

HTTP/ACCEPT net $FW
SSH/ACCEPT net $FW


Adding Web Site to Web Server

sudo usermod -g www-data [YOUR USERNAME]
sudo chown -R www-data:www-data /var/www
sudo chmod -R 775 /var/www


Note

775 - is equal to rwx rwx -rx

r - read

w - write

x - execute


other permissions


400 r-------- files
444 r--r--r-- files (read only)
600 rw------- files (file invisile to all)
666 rw-rw-rw- files
700 rwx------ allow permission to programs and directories
750 rwxr-x--- allow permission to programs and directories
755 rwxr-xr-x allow permission to programs and directories
777 rwxrwxrwx allow permission to programs and directories

Note: 777 dangerouse to use as permission

Redhat and Cent OS Web Traffic Monitoring

Do the Following:

1. Go to Terminal and Login as super user.

Command : su (super user)

2. see display connection by using the command


netstat -netstat

3. Install tcptrack package via Terminal.


yum install tcptrack

Installing in Ubuntu

sudo apt-get install tcptrack


Installing in Open Suse


zypper install tcptrack or go to YaST -> Software Management -> Search the Package tcptrack and Install the Package.

4. Track Ethernet traffic

tcptrack -i eth0
tcptrack -i eth1

Show web traffic on port 80.


5. tcptrack -i eth1 port 80