Server Networking Tips

Over the past year, we have covered many networking tips for servers. Here is a brief summary of the most important networking tips you should keep in mind for your dedicated server.
1. Use both a router firewall and a software firewall
2. Your name servers should be hosted on at least two different servers
3. If you use content delivery services, make sure they have servers close to your primary users
4. Block all ports except the most essential (i.e. web server, ssh, ftp)
5. Use traceroute and dns lookups to test network connectivity issues
6. Be sure to follow Internet standards with your DNS records
7. Use SSH, SCP, SFTP, and other secure protocols whenever you need to connect to your server
Photo Source: Flickr
Tag: dedicated server, dns, firewall, ports, scp, servers, sftp, ssh
How to install Apache on a FreeBSD server

Continuing with our series this week on non-Linux operating system servers, today we will learn about FreeBSD. Its proponents (of BSD distributions in general) call it the most secure and reliable operating system for Internet-connected servers. It comes with several different versions of Apache. Here is a quick guide to getting the one you want installed.
1. Make sure your ports collection is up to date:
# portsnap fetch update
2. Using ports, install Apache (2.2 in this example):
# cd /usr/ports/www/apache22/
# make install clean
It will take a minute to go through the installation, but it will ask you configuration options. You will also need to configure the Apache httpd.conf file as you would on a Linux server. If you would like a more in-depth guide to the specifics of that configuration, see the nixCraft article on the subject.
Source: nixCraft
Photo: Flickr
Tag: apache, bsd, freebsd, ports, server, web server
Gain access to cPanel from anywhere with JAP

Many people who manage websites also have other jobs, and even those who do not frequently find themselves traveling and away from the comfort of their own home Internet connection. In such situations, users sometimes find themselves behind firewalls that prevent them from accessing certain services, including web hosting control panels like cPanel.
The reason for the restriction is usually not to prevent people from specifically accessing cPanel but rather just a general blocking of any “unnecessary” ports by the network’s firewall. JAP4CPANEL (or simply JAP) allows you to access cPanel, WebHostManager, and webmail all through port 80, acting as a proxy between your network and your server.
With JAP, you will be able to access cPanel no matter where you are. It is available for PHP4 and PHP5 and also requires cURL, which is installed on most active web servers. JAP is free and open source software, released under the LGPL.
Source: webhostingtalk.com
Photo: Flickr
Tag: control panel, cpanel, jap, php, ports, software, websites
How to open and close ports with iptables

Question: How do I open and close ports with an iptables firewall setup?
Answer: You can easily open ports on a dedicated server with these simply commands. Depending on whether you need to open a UDP or TCP port, use one or both of the following:
iptables -A INUPT -p tcp –dport -j ACCEPT
iptables -A INUPT -p udp –dport -j ACCEPT
And to close a port, enter:
iptables -A INUPT -p tcp –dport -j DROP
iptables -A INUPT -p udp –dport -j DROP
Then, save and restart iptables:
service iptables save
service iptables restart
You can keep track of which ports have been opened and closed by viewing the /var/log/messages file.
Photo: Flickr
Tag: dedicated server, firewall, iptables, ports, tcp, udp
Which Programs Are Using Ports?

Question: How do I find out what Linux programs are using my ports?
Answer: Running a Linux dedicated server can be a big responsibility, so it is good to know shortcuts for some of the more sticky situations that arise. If you ever have a situation where you cannot start a critical service like Apache or MySQL because the port that it uses is being used by another application, there is a way to find out exactly what is going on.
To find out which processes are using which ports, login to your server through SSH and type:
netstat --nlp
This will bring up a list looking something like this:
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN 3941/cupsd
tcp6 0 0 :::22 :::* LISTEN 3158/sshd
The numbers after the colons tell you the port addresses being used. For example, CUPS printing service is using port 631, and SSHD is using port 22. Once you find out the rogue process, you can kill it and resume normal operation.
Photo Source: Flickr
Tag: dedicated server, linux, ports, server, ssh
Common Server Port Numbers

Question: What are some common port numbers used in web hosting?
Answer: Most firewalls come configured with the essential port numbers open and the rest of them closed. Nevertheless, it is still important to know which ports do what, whether you are running a dedicated server or just one shared hosting website.
80 – Arguably the most essential port, it is the standard HTTP port on nearly all web servers, unless changed. It is the default port for Apache.
443 – This is the standard port for HTTPS. SSL encrypted sites will use this.
Read More >>
Tag: apache, ftp, ports, server, ssh, web hosting, web servers