Dedicated Server Hosting FAQs (Part 1 of 3)

May 23, 2008

When purchasing a dedicated server, you are going to ask a lot of questions to your potential dedicated web host. Sometimes, though, you can find answers to the most common pre-sales questions via the dedicated web hosting company’s website, and this can help you make your decision or at least narrow down the options. Remember that dedicated hosting is different than shared web hosting in many ways, one of which includes the fact that dedicated servers can have customized setups. So even if the answer on their website is “no”, you should still ask, as most dedicated hosts will likely work with you if you are going to purchase with them or will help you find a way around your hosting dilemma.

And now for some helpful Dedicated Server Hosting FAQs and pre-sales answers!

How many websites can I host on my Dedicated Server?

The best dedicated web hosts will say “unlimited website hosting” is okay! This is because it is YOUR server! You own and control almost all aspects of it, except maintenance and storage.

Can I resell space on my Dedicated Server?

If your web host says anything but “yes”, you’re in trouble! Qualified dedicated server hosting providers will allow you to resell your dedicated server space to clients, friends, family, and even strangers. For example, if you wanted to run a “free web hosting” site, where you give thousands of customers small websites to host for free, you can do this easily by purchasing a dedicated server.

I don’t like the control panels offered – can I install my own or just work through SSH?

Yes and yes! Some web hosting providers will install control panels for you at a nominal charge, while all of them will allow you to install yourself or just use SSH/shell commands to cut down on costs or for simplicity.

How long does it take to get my Dedicated Server setup?

No longer than 24-48 hours, unless you have asked for something that is more difficult to setup. If you want your account setup ASAP, we always recommend calling the dedicated hosting provider so they can verify your information immediately for a faster setup.

Setting Up Private Nameservers on Your Dedicated Server (Part 2 of 2)

May 22, 2008

Step 6: Edit Files in SSH Shell

Login to your SSH Shell into your server as root and open the following 2 files to edit using the information below:

* file 1:
nano /etc/resolv.conf

From there, the file needs to be edited. Make sure it looks like this:

domain yourwebsite.com
search yourwebsite.com
nameserver 127.0.0.1
nameserver IP1
nameserver IP2

At this point you should save by typing ctrl+o and entering. Then, close the file by typing ctrl+x.

* file 2:
nano /etc/nameserverips

The file needs to be edited, just like File 1. Make sure it looks like this:

IP0=0
IP1=ns1.yourwebsite.com
IP2=ns2.yourwebsite.com

**Please note IP0=your server IP**

Save and close as per File 1.

Step 7: Setup Nameservers in WHM

In WHM, select Edit Server again and set your Primary Nameserver to ns1.yourwebsite.com and assign the IP Address once more – it should now be the correct IP. Then click Add an A Entry for This Nameserver and repeat the process for the Secondary Nameserver using ns2.yourwebsite.com. Make sure you save.

Then you can double check that everything is setup properly by selecting Manage Nameserver IPs in WHM. If you see the 2 IPs and nameservers, you’re all set.

Step 8: Reboot Your Dedicated Server

Get into the Shell via SSH as root and type the simple command: reboot

Step 9: Point Your Domain Nameservers

If you host with LPDedicated.com or Lunarpages, you can login via the instructions in our previous post to manage your domain nameservers. Make sure they are pointed correctly, and once they fully propagate (24 hours or so), your nameservers will be listed properly and your website will resolve on your dedicated server!

Setting up Private Nameservers on Your Dedicated Server (Part 1 of 2)

May 21, 2008

When you purchase a dedicated server hosting plan, you will need to specify which nameservers you want to use. Unlike shared web hosting where you can only use your web host’s company name servers, with dedicated web hosting you can create your own private nameservers! This means your website will point to ns1.yourwebsite.com and ns2.yourwebsite.com

Step 1: Register Your Domain Name

If you purchase dedicated web hosting with LPDedicated.com, you can get your domain name registered for free. Otherwise, you can purchase the domain from a domain registrar or if you already have it purchased, just skip this step.

Step 2: Purchase 2 Dedicated IP Addresses

LPDedicated.com provides 2 Free IP Addresses for your dedicated server, both of which can be used for this purpose. Otherwise, IPs normally cost under $5 per IP per month.

Step 3: Register Your Nameservers

If you purchased hosting with LPDedicated.com or Lunarpages, you can do this easily. Simply read through this quick tutorial on Registering Your Name Servers. If you purchased through an outside domain registrar, contact them and let them know you need to register your domain as a nameserver. Most registrars normally take about 3 days to propagate.

Step 4: Fix NDC

You’ll need to login via SSH into your server at the root and run the following command:

/scripts/updatenow
/scripts/fixndc

Then, if you’re hosting with LPDedicated.com, in WHM on the left window pane, restart DNS/Nameserver (BIND). If you’re hosting elsewhere, check with your provider for further instructions.

Step 5: Set Up Your Nameservers in WHM

Visit your WHM panel again, and select Edit Setup near the top fo the left window pane and then set the Primary Nameserver to ns1.yourwebsite.com. Then assign the IP Address and repeat the process using ns2.yourwebsite.com for the Secondary Nameserver. Make sure you save your work!

Securing Shell on a Dedicated Server

May 20, 2008

By default SSH will give root and any local user secure access to the server. For security reasons it is a good idea to change this setting and specify the users which are allowed to have SSH access. The configuration file for SSH is called sshd_config and is either in /etc or /etc/ssh

Login to the server and on the command prompt do:

[root@office root]# vi /etc/ssh/sshd_config

things to change:

#don't allow root to SSH in to the server:
PermitRootLogin no

#users allowed to login:
AllowUsers user1 user2 user3

Now do a “shift zz” (hold down the shift key and tab 2 times the z key)
The configuration file now is saved and closed and you have to restart ssh:

[root@office root]# /etc/init.d/sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
[root@office root]#

Now you can SSH to your server with your username,then do a su on the command prompt and type in the root password to become root.

More on Cron Jobs for Your Dedicated Server

May 19, 2008

Using cron jobs on your dedicated server can help you backup your server, send emails, delete files, or run scripts. In the long run, this can save you precious manpower and even money, as you don’t have to pay a technician, system admin, or other employee to do these things on a scheduled basis for you.

To get started using cron jobs, you need to know a bit more about how to use them.

Start by typing “contab -e” to begin editing your cron file. A couple other really useful commands include “crontab-l” for a list or “crontab -r” to delete a previously-created cron job.

Looking at your list of cron jobs, they should look like this:

1 2 3 4 5 /bin/YourStuff etc

Each of the numbers above represent specific schedule times that you can incorporate to produce tasks on a monthly, daily, hourly, etc., basis. They are as follows:

1: Stands for minutes, so if you want a cron job to run every 5 minutes, you would start that sequence above with “5”. Works with numeric values from 0-59.

2: Stands for hours, so as above, if you want it to run every 2 hours, you would include a “2” in the above sequence. Works with numbers 0-23.

3: Stands for days, so if you want to run a cron job in dedicated web hosting every 6 days, you would input a “6” where applicable. Works with numbers 0-31.

4: Stands for the month, where 0=January and 12=December.

5: Stands for the actual day of the week, where 0=Monday and 7=Sunday.

Keep in mind, you can also edit these cron jobs to apply to various other formats. For example, you could set up a cron job to run 1-4/2 or every third week with */3. You can also define executions via the Shell and specify where you want the results emailed as below:

SHELL=/bin/whatever
MAILTO=youremail@yourdomain.com

Cron Jobs

May 15, 2008

Using cron jobs can save you time, money, and lots of headaches! But do you know what a cron job is and what it can do for you and your dedicated server hosting?

To start, you can impress your friends and tech-geeks alike by letting them know that ‘cron’ comes from the Greek word ‘chronos’, which means ‘time’. And in fact cron jobs manage things in a time-based banner – for example, every minutes, every hour, every day, etc.

Cron jobs are simply scheduling devices and work through SSH shell without you. In other words, once you set up a cron job, it will essentially perform its task in the background while you sip margaritas and watch the money roll in. Okay, maybe they won’t make you rich, but they will save you time and money by performing the same tasks you need to implement without costing you any trouble. Once you set them up once, they do what they’re told until told to stop.

By using cron jobs, you eliminate the middle-man. You can set tasks for your website like checking for new subscribers, deleting inactive website members, sending email newsletters and more. Especially for email marketing on a dedicated server, cron jobs can help manage the amount of emails sent per hour and eliminate the worry of getting blacklisted for normal email marketing and newsletter distribution.

Using APF on a Dedicated Server

April 4, 2008

You should have a look at the first 4 parts of this tutorial series on installing, configuring, and running APF (Advanced Policy Firewall) on a Dedicated Server before proceeding here, just to be sure your dedicated server is setup correctly with APF configurations. Here is a quick list to roundup these tutorials on dedicated web hosting and APF setup:

1. Installing APF on a Dedicated Server

2. Configuring APF on a Dedicated Server

3. Configuring AntiDOS on a Dedicated Server for APF (optional)

4. Starting APF on a Dedicated Server

Now, here are some helpful commands for your Firewall Usage. With these codes and options, you can do nearly everything necessary to run APF, block IP addresses, flush the firewall, etc. Please review these APF codes below and keep them handy for future reference.

Firewall Usage

Usage /usr/local/sbin/apf [OPTION]

OPTIONS are as below

-s|–start ……………………. load firewall policies
-r|–restart ………………….. flush & load firewall
-f|–flush|–stop ……………… flush firewall
-l|–list …………………….. list chain rules
-st|–status ………………….. firewall status
-a HOST CMT|–allow HOST COMMENT … add host (IP/FQDN) to allow_hosts.rules and immediately load new rule into firewall
-d HOST CMT|–deny HOST COMMENT …. add host (IP/FQDN) to deny_hosts.rules and immediately load new rule into firewall

As an example, if you would like to deny an IP from accessing your sites, execute,

apf -d 123.123.123.123

Hopefully this tutorial series for APF on a Dedicated Server has been extremely helpful to you, but if you’re ever stuck, contact your dedicated web hosting provider and ask for Managed Hosting solutions.

Starting APF on a Dedicated Server

April 3, 2008

After you have successfully installed and configured APF (Advanced Policy Firewall) on your dedicated server, you can optionally configure AntiDOS for DOS protection. Once done, you will need to start and run APF on your server, and below, you will find the steps necessary to do so.

Starting APF on Your Web Server

1. Edit /etc/apf/allow_hosts.rules and enter your IP (not a mandatory step, but will avoid being locked out of the server)

2. Start the firewall by executing the command apf -s

You should then see,

Development mode enabled!; firewall will flush every 5 minutes.

Now try to access all the services, including mail, ssh, and websites.

3. If you are able to access all the services, then open up /etc/apf/conf.apf, change the DEVEL_MODE=”1″ to read DEVEL_MODE=”0″

Then simply restart the firewall by executing apf –r and you should be done!

4. As a last step, you should execute the command “chkconfig –list apf” and confirm whether you see a similar entry like

apf             0: off   1: off   2: off   3: on    4: on    5: on    6: off

You should see it, exactly similar to above, but in case it is not like that, execute chkconfig –level 345 apf on

Congratulations, you have successfully installed APF! If these tutorials were over your head or you feel you may have done something erroneously, you ought to purchase Managed Hosting from Lunarpages, as they can offer APF installation completely free with your Managed Hosting purchase.

Configuring AntiDOS on a Dedicated Server for APF

Please refer to our earlier tutorials on Installing APF on a Dedicated Server and Configuring APF on a Dedicated Server. If you do not wish to setup anti-DOS on your server, you can skip this series in the tutorial and move onto Starting APF.

Please note that this configuration is completely optional when setting up a dedicated web hosting server. While it can help protect your server and website from DOS attacks, there are also other ways to do this.

AntiDOS Configuration

1. Open up /etc/apf/ad/conf.antidos

2. Change LP_KLOG=”0″ to LP_KLOG=”1″

3. CONAME=”Your Company”

Enter your company name within quotes similar to CONAME=”Lunarpages”

4. USR_ALERT=”0″ to USR_ALERT=”1″

Change it to 1 only if you wish to receive email alerts.

5. USR=”you@yourco.com”

Enter your email address here similar to the entry made in step 3 (i.e in quotes).

6. Antidos is intended to operate via cron. This is a critical setup point as if not done, antidos will simply not operate.

Execute the command

crontab -e

*/2 * * * * root /etc/apf/ad/antidos -a >> /dev/null 2>&1

This will run antidos every two minutes.

If this sounds too confusing for you or you are unsure about managing your dedicated server, you should definitely look into Managed Hosting from Lunarpages, as they offer free APF installation with your purchase. Check out our Dedicated Hosting Coupons page for more information on the latest deals from Lunarpages Dedicated Web Hosting.

Configuring APF on a Dedicated Server

April 2, 2008

So you have learned about Advanced Policy Firewall (APF) and how to install it on your dedicated server. However, there are a couple more steps to providing advanced firewall support for your dedicated web hosting account. This will help secure your dedicated server and assure your server’s safety.

Remember, if you purchased Managed Hosting from Lunarpages, they can install APF for you at no additional charge. There’s no coupon necessary for this promotion, but if you’re not yet signed up with our recommended dedicated host, check out our Dedicated Hosting Coupons for information on how you can save a bundle on your dedicated server hosting purchase!

Configuring APF (Advanced Policy Firewall)

/etc/apf is the configuration directory of APF and conf.apf is the main configuration file. So open up conf.apf in your favorite editor.

1. Scroll down till you see

IG_TCP_CPORTS=”22″

Tip: Pico -> Ctrl+W and then keyword –> Invokes search for keyword
Vi –> Esc and then /keyword –> Invokes search for keyword
emacs –> Ctrl+s and then keyword –> Invokes search for keyword

Change it to read

a) For a webmin server:

IG_TCP_CPORTS=”20,21,22,25,53,80,110,143,443,465,993,3306,10000,30000_35000″

b) For a Cpanel server :

IG_TCP_CPORTS=”20,21,22,25,53,80,110,143,443,465,993,995,2082,2083,2084,2086,2087,2095,2096,3306,10000,30000_35000″

2. Change IG_UDP_CPORTS=”" to read

IG_UDP_CPORTS=”21,53,465″

3. EGF=”0″ to EGF=”1″ #

This filters outgoing connections also, though I recommend it even if it may sometimes cause issues.

4. Change EG_TCP_CPORTS=”21,25,80,443,43″ to read:

EG_TCP_CPORTS=”21,22,25,37,53,80,110,113,443,465,43,873,2089,3306″

5. Change EG_UDP_CPORTS=”20,21,53″ to read

EG_UDP_CPORTS=”20,21,53,465″

6. Change USE_DS=”0″ to USE_DS=”1″

APF makes use of dshield (DS), which is a little like spam blocklists such as spews and lists the most commonly abused networks and those most often used in denial of service attacks and similar.

7. USE_AD=”0″ to USE_AD=”1″

The USE_AD=”1″ enables the Antidos Feature which is still in beta at the time of this writing. Readme says “Antidos is a log parsing script made for r-fx.org’s APF (advanced policy firewall). Its purpose is to parse specific log formats for network attacks against a given system; then it takes certain actions. It is designed to be modular so it can be removed from APF and used in other environments.”

You can now save the conf.apf and quit the editor. If you didn’t change the value of USE_AD to 1, you can skip our our web hosting turtorial on Configuring antiDOS and jump to the fourth one on Starting APF Firewall.