Debian 7 Wheezy Dedicated Web Server Setup Step by Step

Perform a system upgrade

Check your repositories definitions:

nano /etc/apt/sources.list

They must look like:

deb wheezy main
deb-src wheezy main

deb wheezy/updates main
deb-src wheezy/updates main

Perform system update:

apt-get update && apt-get -V upgrade

Install systemd

Using apt-get:

apt-get install systemd

Edit Grub options:

nano /etc/default/grub


GRUB_CMDLINE_LINUX_DEFAULT="quiet init=/bin/systemd"


update-grub && reboot

Install time server

Using apt-get:

apt-get install ntp

Add static IP

To set the static IP modify network configuration:

nano /etc/network/interfaces


allow-hotplug eth0
iface eth0 inet dhcp


auto eth0
iface eth0 inet static

Restart network

systemctl restart networking.service

Test results:

ip addr

Results must look like:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:e7:e5:87 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
    inet6 fe80::a00:27ff:fee7:e587/64 scope link
       valid_lft forever preferred_lft forever

Harden SSH

Edit SSH configuration:

nano /etc/ssh/sshd_config

Make the following changes

PermitRootLogin no
X11Forwarding no
AllowUsers pontikis ...

Restart SSH

systemctl restart ssh.service

Install Webmin (optional)

According to

Add Webmin repositories KEY:

apt-key add jcameron-key.asc

Modify repositories definitions:

nano /etc/apt/sources.list

Add Webmin repositories:

deb sarge contrib
deb sarge contrib

Update repositories:

apt-get update

Finally, install webmin:

apt-get install webmin

Test Webmin at: (login with root logins)

Install git (optional)

Using apt-get:

apt-get install git

Install some tools (optional)

Using apt-get:

apt-get install mc p7zip-full

Install MySQL

Using apt-get:

apt-get install mysql-server

REMARK: restart MySQL using systemctl restart mysql.service

Install Apache

Using apt-get:

apt-get install apache2 apache2-mpm-prefork

REMARK: restart Apache using systemctl restart apache2.service

Install PHP

Using apt-get:

apt-get install php5

Install MySQL Native Driver (mysqlnd)

apt-get install php5-mysqlnd

REMARK: If, for any reason, you don’t want mysqlnd, try apt-get install php5-mysql instead.

Install php adodb extension (optional).

apt-get install php5-adodb

Install database manager (optional)

phpMyAdmin and adminer are popular. I prefer adminer:

mkdir /var/www/adminer

REMARK: you can use apt-get install adminer, but this will remove php5-mysqlnd and install php5-mysql. See here.

Leave a Reply

Your email address will not be published. Required fields are marked *