install web server on debian 6

$ sudo apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server
$ sudo vi /etc/mysql/my.cnf
uncomment #bind-address = 127.0.0.1
$ sudo /etc/init.d/mysql restart
check sql is enabled:
$ sudo netstat -tap | grep mysql
install bind9
$ sudo apt-get install bind9 dnsutils
install apache, php
$ sudo apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libruby libapache2-mod-ruby
$ sudo /etc/init.d/apache2 restart
edit /etc/hosts and
$ echo server1.example.com > /etc/hostname
$ /etc/init.d/hostname.sh start
edit /etc/network/interface to set up static ip address:
sample:

 

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
        address 192.168.0.100
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
$sudo /etc/init.d/networking restart
 
edit /etc/hosts:
127.0.0.1       localhost.localdomain   localhost
192.168.0.100   yiznix.com    host
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
 
edit /etc/hostname:
$sudo echo yiznix.com > /etc/hostname
$sudo /etc/init.d/hostname.sh start
 
check hostname:
$sudo hostname
$sudo hostname
both of them must be yiznix.com

No comments: