Mini Howto: 301 redirect using htaccess & apache

August 31st, 2010

How to redirect index.php to index.html, correctly and friendly with the search engines so you don’t lose traffic?

Well, a 404 is not the way!

The 301 redirect is easy.  Edit your htaccess file on your linux server in the root directory of your site, or create one if you do not currently have one.

My old page was index.php and I wanted it as index.html, I have my index.html uploaded to my site.

The simple contents below is all that you need:

redirect 301 /index.php http://www.m3server.com/

The above line will redirect  your index.php requests to your main web site url, in this example.

Perhaps you had a page that you want to change its name to.  Rename the file to the name you wish to use, add the redirect, presto – your traffic saved and served without a nasty 404.  Example is below:

redirect 301 /fishin.html http://www.m3server.com/fishing.html

That is a fictitious link, but you get the idea.

If you make a mistake and your web site appears broken, first step should always be to rename your .htaccess file to off.htaccess, see if that resolved your trouble.  If it does, then you just need to isolate the bug in your .htaccess file.

M3Server.com – world.class.hosting

Mini Howto: How to setup email accounts

August 8th, 2010

This post applies to dedicated and dedicated vps hosting on linux servers at M3Server.com.

Remember, each pop3 email account has to be unique to the server, just like there is only one you, there is only one unique email account. So, let’s get started with the most basic setup.

Our example domain, (this is fake and non operational, just substitute your real domain for the example):
aaa_cars.com

Let’s say you want to setup sales@aaa_cars.com. Well, sales is not a unique user name as is probably already taken or in use by another one of your domains. How can I use sales then?

First, we setup a pop3 account so you can send/receive email. Our test account name is going to be:

john.doe

Login to your server admin control panel. Under the navigation panel on the left hand side (Control Center), click on the small navigation box to the left of email. The drop down list appears.

Click on “Add Mailbox”

Enter a unique name, like our example, john.doe, select the domain from the drop down box, and assign the password, confirm it, and click continue. Verify your settings to confirm, then click confirm.

Now you have a working email account that you can check and send email from.

You can access it quickly via the webmail interface, example url:

http://aaa_cars.com/webmail/

So, thats great, but what about sales@aaa_cars.com? Now, you need to create an email box alias, we call them email routes. They are a standalone email address that just simply routes email to a local email box.

Back to the Control Center at your server admin control panel, click on:
Add Alias

Enter the address on the box to the left:
sales@aaa_cars.com

On the box to the right, enter just the pop3 account name you want the email to route to, not a full address, just the name, in our example, we are using:

john.doe

click continue to access the values.

Now, people can email you at sales@aaa_cars.com and it will arrive in your email box, john.doe waiting on you to download them.

You are probably wondering how to show the recipients that you email, that the email comes from sales and not your user name, john.doe? This is where the magic comes in.

Login with john.doe via your webmail interface.

Look at the top navigation bar, locate and click on “preferences”.

Now that your alias (email route) and pop3 account are setup, you are free to make changes here based on your alias configuration.

Locate the top section and click on the edit nav link by the From address.

The left box is the user’s name, in our example case, it will be:
Sales

The right box is for the real email address we previously setup, in this example we will type in:
sales@aaa_cars.com

Click the add/modify button to save your addition, and then click the back button.

Next, under the From is the Reply to option. Type in:
sales@aaa_cars.com

Scroll to the bottom and hit save.

Now, the system will send email from SALES and will appear to the recipient as it came from sales@aaa_cars.com. When the recipient clicks on reply, it will be sent back to sales@aaa_cars.com. In which, the email route you setup, will deliver the email to john.doe.

Presto, you can now use the common name, sales, and have it route to your mailbox.

Sounds complicated, a long post, but it is rather basic and once you do it one or two times, it will be easy. I assure you.

You can route many email addresses from one or more domains to the john.doe mailbox, because as we have learned in the previous blog, a mailbox is just a holding place for our incoming email.

Travis

- M3Server.com

Email Servers: basic understanding of operation

August 8th, 2010

This post is basic knowledge for people with non technical administration experience.

There are two parts to an email server, one that sends email to other servers, and one that enables your client to receive email from your local mailbox server. This is often the most confusing part to understand.

A mail client, either web based, or application based, uses both parts of the mail server to send and receive email.

Let’s start with sending of email. The sending of email is done via the outgoing mail server, most commonly known as the SMTP server. This is often provided by the ISP that your internet connection is connected to. The security method here is relay by IP address, so there isn’t any authentication method such as a login and password.

When you are using a 3rd party SMTP server, the most common security method for access is, SMTP AUTH. This is done by selecting the option for your mail client’s outgoing mail server, “My server requires authentication” and entering a user name and password – often the same as the pop3 client’s login information.

Once the message is sent, it is routed to the destination email address’s mail server. This mail server will route it to a mailbox as instructed in the email configuration files. the mailbox, accessed via a pop3 user name and password is unique to the local server.

The pop3 server, mostly referred to as the incoming mail server, is accessed with a pop3 login account name and password. This allows access to the mailbox file. The mailbox file contains a list of all email messages in the box. If two users shared the same mailbox user name and password, the could see each other’s email. This is coming when multiple people work under the same account, say – info@buildingcompany.com.

If you want to separate email for a different group, example, roof.info@buildingcompany.com, this address will require it’s own email account to keep the email separate from the info mailbox.

The key item to remember is this, pop3 mailbox account can be used by many domains, it is simply a mailbox that can have one or many email addresses.

-M3Server.com

Mini Howto: Change an FTP / Ssh login password

August 7th, 2010

While this mini howto article provides light instructions for obtaining putty, a terminal program for secure access to your linux server, detailed information is outside the scope of the article.

So, you want to change the password to your ftp/ssh login account on your linux server? No problem!

First, download putty for your windows based operating system and save it into a convenient directory. Copy and paste the following url into a new window:

http://www.chiark.greenend.org.uk/~sgtatham/putty/

1) Launch the program putty.exe (or any other terminal program that supports ssh).

2) Enter your server name in the host name field, the same as you would enter for your ftp host. Example: server.simplecom.net or simply, domain.com

3) The server will ask you to login using your current login and password.

4) once logged in, you can simply execute the following command and press enter:

passwd

(pressing enter after the command passwd, will enable the server to prompt you. Following the prompts, pressing enter after each one.)

That is it! once you logout, your new password will be required for your next login.

Travis

-M3Server.com
World Class Hosting – since 1996!

Mini HowTo: using htaccess to block an IP or IP range from accessing your site, or directory

August 1st, 2010

Add the following lines to your .htaccess file in your root directory, or the directory that you wish to protect. Adding to a directory will protect that directory and all directories below it.

order allow,deny
deny from 123.45.1.7
deny from 123.45.2.
allow from all

Add this to your .htaccess file, or create one if you do not have one with your favorite text editor, upload the file to the server into the directory you wish to protect.

This will allow any ip to access your site, except those listed. You can add as many as you wish. Note the 2nd example, 123.45.2. – this will block the full class C, from 123.45.2.1 to 123.45.2.254

Again, test it to ensure this is the effect you want. At any time, you can remove the .htaccess file, or rename it to, example, off.htaccess and it will disable any rules you have specified.

Travis