Category Archives: Webmin

Enabling Multiple Domain Names and Sites on Apache2 Server

Today I set up a new server and I am documenting exactly how to set up multiple domain names, sub domains and websites on a new Apache2 Server. I am using Ubuntu, but I believe these directions are similar for any Linux Apache2 web server.

Pointing your domain or sub-domain

It is a good practice to point your domain name or sub-domain first, before you set it up on your server which I'll cover afterwards below, so let's go ahead and point our domain. Whether you are using a new domain name or a sub-domain on one of your existing domain names, the process is similar for pointing the domain name or sub domain name to your server IP address. You will need to go to your domain management console and create a Type "A" record. This will normally be done in your DNS provider's advanced DNS settings or zone file settings. Use the following settings to create two new records:

  • Name: if there is a name field, enter the domain name or sub-domain name(most require you to follow the domain with a "." so for my sub domain I entered "subdom.jafty.com.".
  • Type: "A" for both records.
  • Hostname field: enter "www" in the first record and "@" in the second.
  • Destination IPv4 address(sometimes just called Address): Use your server's IP address for both records.
  • TTL: use "14400" for both records.

That should be enough information for you to figure out how to create your two host records on just about any platform, but if your platform differs, ask your provider for assistance or google the providers name followed by DNS instructions or "How to point a name with Provider Name". You are creating two similar records, one for WWW and one for @. That way visitors of your site can access with either www.example.com or just example.com. The Hostname of @ makes the record for the domain without "www" in front of it. If your provider's DNS settings do not include the Host or Hostname field where we put either www or @, then you probably need to create two records with different names instead. For example, name one record "example.com." and name the other "www.example.com.". If you're using a sub domain then name one "sub.example.com." and the other "www.sub.example.com." You don't really need a www record for sub domains usually, but you can use one if you want, it won't hurt anything and might help some users find your site.

Steps to adding  a second domain name to your server

Here I am going to explain how I set up a sub domain as as second domain name pointing to a second website on my Linux/Apache2 web server:

Note: My first site was already set up in var/www/html. Most people prefer to set up multiple websites under the var/www directory, but to keep things simple, I'm going to use the var/www/html folder and not var/www. It really makes no difference. It's just a preference.

  1. Create your directory structure for your new website that will reside on your new domain or sub-domain. I'm creating a sub domain like subdir.jafty.com, but these directions are the same as if I were using just jafty.com instead. First, create the directory /var/www/html/subdir.jafty.com. Then create /var/www/html/subdir.jafty.com/logs and /var/www/html/subdir.jafty.com/public_html. If you are logged into FileZilla as root, you can create these from there, otherwise log in with putty and create them using the sudo command.
  2. Create your log files. Simple make two empty files named access.log and error.log and upload them to the logs folder you created in step one above.
  3. Create a VHOSTS file named after the domain or sub-domain followed by .conf, so in my case, I'd name my file subdir.jafty.com.conf. THen copy and paste the  content below under the heading "VHOSTS Example File Contents" into it then change all instances of my sub-domain name with your own domain or sub domain and upload that file to /etc/apache2/sites-available.
  4. Next, use the a2ensite tool from the Linux command line to finalize the new site with the following command(replace example.com with your domain or sub-domain):  sudo a2ensite example.com.conf
  5. Reset apache2 with: sudo service apache2 restart

VHOSTS Example File Contents

<Directory /var/www/html/planner.jafty.com/public_html>
    Require all granted
</Directory>
<VirtualHost *:80>
    ServerName planner.jafty.com
    ServerAlias www.planner.jafty.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/planner.jafty.com/public_html

    ErrorLog /var/www/html/planner.jafty.com/logs/error.log
    CustomLog /var/www/html/planner.jafty.com/logs/access.log combined
</VirtualHost>

Automating the process of setting up domain names and sub domains

If you have to do this often or alter DNS records often and create lots of virtual hosts, you should probably look into automating the process. I provide such a service and have done so for several of my clients. What I do is create a simple user interface in a secure admin web page on your own server where you can simply enter the domain name or sub domain name into a form field and press GO and it does all the above work for you! A real time saver if you have to do this more than once in a great while! IF you are interested in this service, contact me, Ian L. of Jafty.com for a fast, free quote by email or Skype. My email is linian11@yahoo.com and my Skype name is ianlin11. Or use the contact link on this site.

Summary

That is how you do it!

Edit Files Live on the Server

I've been a web developer for many  years now and I must say I feel a little foolish for not thinking of this earlier. I've been wasting countless amounts of time waiting for files to upload and doing the mundane tasks involved in updating files and uploading them to a server when I didn't really have to. Here's why.

Today I got fed up with editing my file in Notepad++, switching to Filezilla,  finding the file in a folder on my desktop, uploading the file by dragging it to Filezilla and finally testing my online website or app. I decided to Google the term "Edit files live on server" and found https://cyberduck.io/ that has an amazing product which allows you to type in your FTP details, just like I used to in Filezilla, and open a connection to my server. Then it gives me a directory tree on my server. CyberDuck allows me to click on any file on my server and open it in Notepad++ on my desktop, edit it and save it right back to the server without having to click and drag it to another program like I used to do for so many years.

This is the best program for a developer I have found in years. Traditionally I do not favor fancy programs to help you write code or frameworks to make things "easier" because I found that they only complicate matters in the long run, CyberDuck is the exception however. It is great so far, but I've only been using it for an hour now, so if I find any flaws, I will report them here asap. I just wanted to share this. If you are interested in downloading the CyberDuck app for yourself, simply CLICK HERE or the link above and look for the two download links on the left side of the page. Do not use the first download link you see at the top of the page because it is a sponsored ad and will try to trick you into downloading something else. I hate those types of ads, but none-the-less, I still recommend CyberDuck!

Like I said, it's great when used with Notepad++, so if you'd like the experience I had, download Notepad++ too. Just google it, it's easy to find.

Be sure to visit Jafty.com to view my portfolio and see the web development services I offer! You an also email me at linian11@yahoo.com if you need anything.

Domain Name and Nameserver Tools

This is a simple list of links I put together for anyone needing help with domain name monitoring and nameserver set up. They are meant to give you information regarding your domain name, IP address and nameservers.

DnsStuff.com

DnsStuff.com - This site is one I use regularly to make sure my domain name is pointed right and to test nameservers for that domain or nameservers that I have built.

DomainTools.com

DomainTools.com is a great place for gathering WhoIs info for your domain and if you look around a bit they have other useful domain name tools and info.

DnsCheck.pingdom.com

DnsCheck.pingdom.com has a useful tool for running all sorts of DNS tests on a domain name.

Pingability.com

Pingability.com - is a great tool for checking to see if your domain is pointed to the proper server. Looking up your IP address and getting nameserver information for the domain name and/or IP address. IT lists MX records, A records, nameserver IPs and other host file data and zone information that is useful.

FYI - If you need custom domain name tools or SEO tools, I specialize in developing such tools for the internet. Web-based domain name, SEO, Calculators and business development tools are my no. one specialty. If you need any such custom tools contact Ian at linian11@yahoo.com and we can work something out and get a free estimate on the spot.

 

 

 

 

 

EmployWorkers.com Virtual Work

Need to hire the perfect coder, designer, developer or graphics specialist? EmployWorkers has all areas of Information technology covered and more.

Virtual employment agency

Where work that needs done, gets done.

Need to find work in the Information Technology field, EmployWorkers.com is for you! We employ all skilled workers in a vast array of areas including, but not limited to graphic design, logo design, Photoshop, web design, web development, application development, special needs coding, PHP, HTML, CSS, SEO, writing of all types, programming of all types and much more. If you need work, visit employworkers.com today and sign up for free. Finding work online has never been easier!

I, Ian L. of Jafty.com have created employworkers.com to fill a niche left open by the buyout of Vworker.com. They had a simpley to use website for posting jobs and finding work. I have expanded on the idea by making it even easier to sign up, post jobs and find work all for free. You never pay a cent, we collect a small percentage of the project price only in cases where a job was completed satisfactory and accepted by the employer. We have a zero risk policy where you don't pay anything until you are satisfied with our services. Money for projects is held in escrow so the worker knows he will be paid once he fulfils his contract with the employer, but employers can dispute at any time they feel there is a breech in the contract and get their escrowed funds returned to them hassle free. Most times you will find that satisfaction is standard however because employworkers.com uses a skilled pool of workers and expertly matches the most qualified workers with your project.

Go ahead and visit EmployWorkers.com today and give it a try whether you are an employer seeking assistance on a project or a worker looking for your next project, we have got you in mind!

Setting up Domain Names on Autoratative Nameserver with Bind and Webmin

This is an advanced level DNS server administration tutorial. If you don't know what DNS means, get out while you can, this is complex stuff and you got to have some background information first. Start reading up on nameservers first, you will need some education behind you before attempting this tutorial, trust me. It took me weeks to learn to set one up with no background education in computer science, but I did it and here is how. First you may also want to read my previous article on how to set up the domain name for the webserver itself. This tutorial is for setting up domain names on an already configured nameserver that already has a domain name and at least two sub-domains such as ns1.domain.com and ns2.domain.com.

 

Inserting new domains in Bind and Webmin

 

How Setup domain name Zone Records:

This is a tutorial on how to set up domain name Zone records on our name servers using Webmin and Bind. This is necessary in the process of pointing a domain to our nameserver and being able to control them from our domain name rotation system.

  1. Login to Webmin - and click on "Servers" then on "Bind DNS Server"
  2. Create a Master Zone - by scrolling down to "Existing DNS Zones" and clicking on "Create master zone". Then fill out the form as follows:
    • In the first field, type in the domain name you are setting up. For example, "buildmycareer.com" without quotes.
    • Then skip down to the "" field and enter "ns1.imonetizepark.com" without quotes.
    • If you have Global Server Options/Default Zones set up, enter the relative IP address in the "IP address for template records" field and check yes in front of it, otherwise skip this and check no in front of it.
    • For "Refresh time" enter 30 min. for testing or longer for permanent records.
    • For "Transfer retry time" enter 30 min. for testing or longer for permanent records.
    • For "Expiry time" enter 60 min. for testing or longer for permanent records.
    • For "Negative cache time" enter 60 min. for testing or longer for permanent records.
  3. Click the "Create" button to save the master zone.
  4. Click on the "Address" icon and enter the following information in the resulting pop up window:
    • Leave the "Name" field blank and enter the IP address to the server that holds the website for the domain name you are configuring in the "Address" field.
    • Press the Create button and a new address record form will appear. This time, type "www" without quotes in the "Name" field and enter the same IP in the "Address" field and click Create again.
  5. Click on "Return to record types" at the bottom of the form and click on the "Nameserver" icon from the main menu. Enter the domain name in the first field and enter the nameserver in the second. If you look below the form, the first nameserver, ns1, should already be entered, so just enter the second one here, buildmycareer.com. It is important to enter a trailing period after both the domain name and the nameserver domain name in this form. When you have both nameserver records entered, click create and "return to record type".
  6. Finally, click on "Apply zone" in the top right corner of the page and you should be done. If it doesn't take, restart the Bind server, but you shouldn't have to.
  7. Duplicate process on nameserver two - When you are done with all of the above steps for nameserver one, do the exact same thing on nameserver two.
  8. Create Virtual Host - After the all the zone records are done, follow the instructions below to create a virtual host for the same domain name you just set up on both nameservers. you will be creating the virtual host on both as well.
  9. TEST - When you are done, the settings can take up to 72 hours to work, but normally work within a half hour, so as soon as you are done, you can test by typing your domain name into a browser window to see if it resolves. If it doesn't wait an hour and try again. If it still doesn't work after 72 hours you likely have a problem, so go over everything and make sure it's set correctly. You can use online tools such as those found at
  10. TIPS Trouble shooting - If you still need help or more information since this is a very basic, bare bones set up I have described, go to docfre.webmin.com for more complete instructions or go to wallpaperama.com for similar simple instructions or finally also at linuxjunkies. There are also tools available to check DNS settings available at pingability.com and dnsstuff.com. GOOD LUCK! (you may need it)

How Setup domain name Virtual Hosts:

This is a tutorial on how to set up domains on our web server using Webmin. This is also necessary in the process of pointing a domain to our nameserver and being able to control them from our domain name rotation system.

  1. Login to Webmin - Click on Servers/Apache Webserver
  2. Create Virtual Host - by clicking on the "Create Virtual Host" tab.
  3. Enter IP Address - in the first field and select the "Specific address .. " option just above it.
  4. Enter the document Root - in the "Document Root" field.
  5. Save - by clicking the "Create Now" button under the form.
  6. Copy settings - on webserver two just like you did here for webserver one.
  7. Apply Changes - by clicking on the "Apply changes" link in the upper right hand corner of the webpage in Webmin.
  8. Test - by entering the domain name into a web browser and seeing if it resolves to the correct webserver. If it doesn't wait an hour or so and try again. If it doesn't work after 72 hours, something is definitely wrong. Use the tools mentioned above in the section on setting up the nameserver section.