Welcome to Mac Productions
Shared Hosting FAQ's
What are the scripting options for my website?
Our shared hosting servers offer a number of different scripting options for you to use. It is recommended that you only turn on the scripting languages that you will need. As your website develops, you can turn different scripting options on and off through your control panel.
Step 1
Log into your control panel and click Hosting Packages.
Step 2
Select the domain that you would like to change your scripting options on.
Step 3
In the Hosting Summary section, click the Web Scripting link.
If you can’t see the Hosting Summary box, expand it by clicking the arrow.
Step 4
Your scripting options will be listed. These will be slightly different depending on which operating system you’re using. For example, ASP will not be available if your site is hosted on a Linux server.
Check the scripting languages you would like to use and then click Save to save the changes.
Step 5
Confirm any additional charges (if applicable), and click the Order now button.
You will see an on-screen confirmation that your changes have been applied, and your new scripting options will become available within a few minutes.
What is the .htaccess file?
The .htaccess file allows customized configuration settings to be applied to a specific directory (and any subdirectories thereof) on a Linux webserver.
The .htaccess file described in this article relates to Linux servers only, and should not be confused with the file of the same name created by Frontpage Extensions on a Windows server.
The .htaccess file will allow changes to the following configurations:
• Mod_rewrite This allows you to manipulate URL's to make them more user and search engine friendly. More information regarding the use of this feature can be found in our article: Can I use mod_rewrite on my server?
• Password Protection You can create password protected areas of your website using a .htaccess file in conjunction with a .htpasswd file. A useful third party tool for helping you create these files can be found at http://www.htaccesstools.com/htaccess-authentication.
• Custom error pages It is not possible to add custom error pages by creating a .htaccess file, however this feature can be created through your Mac Productions control panel.
All other features of the .htaccess file have been disabled on our shared hosting servers.
Why does my .NET website error?
The .NET framework is a powerful technology that allows you to access a large library of pre-coded solutions to common programming issues. This allows you to create complex websites with relative ease. The more complex the website the more difficult it can be to identify a specific error. This guide will explain some of the most common errors and how to generate a precise error message if you do come across any problems.
Server Error in "/" Application
This is a standard .net error message and is not enough information to diagnose what the error may actually be, however .NET has been designed to provide useful error messages. To diagnose a problem with a .NET website, the first step is to gather accurate information regarding the error. These informative error messages can be displayed, by simply turning off custom errors in your web.config file.
The easiest way of displaying complete error messages is to rename your existing web.config file, then upload a new web.config file with the following content.
<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>
This will show you the actual error message displayed, and should provide you with enough information to diagnose the fault. If you would like more information regarding the fault, you can edit the page that is generating the error.
The top line of the page should be similar to the following:
<%@ Page Language="VB" %> or <%@ Page Language="C#" %>
There may be additional content within your line of code, but by adding debug="true" trace="true"* you will see as much error and debug information as possible.
For example: <%@Page Language="VB" debug="true" trace="true" %>
You will not need to recompile your application as the code itself is not being altered, this change just instructs ASP.NET to output more information.
From the information provided you should have enough information to locate the source of the error and resolve the issue. If the error appears to be server related please contact us, providing the full error messages and debug information you are receiving so that we can investigate the issue straight away.
It is not recommended to leave debugging and tracing enabled in your script. Once you have resolved the issue we recommend you remove debug="true" trace="true" from your code.
My Custom/Third party DLL will not work
I receive the following errors:
• Security Exception Description: The application attempted to perform an operation not allowed by the security policy.
or
• Error: "The current trust level does not allow use of the <name> attribute".
To protect the integrity of our customers data and our network as a whole we have certain restrictions on our shared hosting environment. As such, certain third party DLL’s and DLL’s requiring full trust levels will not operate on our shared platform.
You should check whether your third party DLL has a version available that supports partial trusted callers. If you receive this error when running your own dll's you should ensure that the AssemblyInfo (eg AssemblyInfo.cs for c#) file has the following before your project is compiled:
[assembly:AllowPartiallyTrustedCallers]
We are unable to provide additional services on our shared hosting platform, if you wish to use an unsupported DLL, or need to run a DLL with full trust level you should consider a dedicated server, where you have full control over the configuration of your hosted .NET platform.
.Net session-state not maintained in a load-balanced environment
Session information for a .Net application cannot be maintained in a load-balanced environment. Customers using Mac Productions load-balancing service might be affected by this when requests from a user are transferred from one (load-balancing) server to another.
This problem can be avoided with the use of a temporary store of this information; in an SQL server, for example. Another alternative would be to send non-sensitive information to the user's computer in the form of a cookie; as is often used with many shopping carts.
My web.config file is not working
The web.config file is a settings and configuration file for .NET web applications. This should be located within the htdocs folder of your webspace. While sub directories may also contain a web.config file to provide configuration specific to that particular directory, a master web.config file must also be placed directly in the htdocs folder of your webspace.
More information on the configuration of the web.config file can be found in the following Microsoft articles:
• Web.config configuration:
• Hierarchical Configuration Architecture:
• Format of ASP.NET Configuration Files:
My scripts in the 'bin' directory do not execute
While scripts will execute correctly in most folders within your webspace, the Bin folder in an exception. When you create a bin folder it is automatically configured with special permissions and behavior to store .NET assembly files (compiled DLL’s).
This directory should not be confused with the cgi-bin directory, which is set up by default within your htdocs folder.
All scripts placed in a directory called bin in htdocs will fail to execute. You should either move the files to another folder and remove the folder, or rename the folder.
How can I install Joomla! on my hosting package?
Joomla! is a popular open source content management system that allows you to quickly create and administer feature rich websites. This guide shows how to install Joomla! version 1.5.14. While the basic principles of installation will remain the same, different versions of Joomla! may differ slightly.
This guide is not designed to replace the Joomla! installation documentation. A copy of the Joomla! installation guide can be downloaded by selecting the link.
We are unable to provide email or telephone support for Joomla!, but you can learn more about it in the projects documentation at: http://www.joomla.org
System requirements
Operating system: While Joomla! Will work on both Windows and Linux webservers, certain modules and Extensions require a change in file or folder permissions, which are only available on our Linux servers. This guide assumes that you have a Linux hosting package set up within your control panel.
Before you start
Joomla! relies on a number of additional services before it can be installed and configured fully. Its best practice to ensure you have all the details to hand before starting the installation process.
A copy of Joomla!:
Joomla! Installation guide:
A MySQL Database: How do I add a MySQL database to my account?
Make a note of the:
• Database name:
• Database IP address:
• Administrator username:
• Administrator password:
FTP Software:
You can use any FTP software you want. If you don't already have preferred FTP software you can Download and install WISE-FTP through your control panel.
Make a note of the:
• FTP username: How do I add additional FTP accounts?
• FTP Password: How do I change a domains FTP password?
A Mailbox: How do I add a new mailbox?
Make a note of:
• Your mailbox username: How can I find my mailbox settings?
• Your mailbox password: How can I find my mailbox settings?
Preparing and uploading Joomla!
Your downloaded version of Joomla! will be compressed to make downloading quicker and easier. Before you upload Joomla! to your web server you will need to extract these files.
To extract all your Joomla! Files from this compressed folder, open the compressed folder and click Extract all files in the folder tasks pane, then follow the extraction Wizard.
Once extracted you should see around 15 folders and 11 separate files.
Next you should upload these files to the htdocs folder of your webspace. Our article Where do I upload my website files? will show you how.
Installing Joomla!
Step 1: Once you have uploaded the Joomla! files to your webspace, enter your domain name into the address bar of your web browser. The Joomla! installation screen will appear.
Step 2: Select your language and click Next in the top right corner of the screen.
Step 3: Joomla! will now check the settings of your webserver. These checks should all pass, once the checks are complete click Next.
Step 4: Read the license for Joomla!. If you are happy with these terms, click Next again.
Step 5: You will now be prompted to enter the details of your database. These database details are available within your Mac Productions control panel.
Don't forget to enter the database IP address in the Hostname field. localhost will not work.
Step 6: Once you have entered your database details, click Next to see the FTP details screen.
Step 7: On the FTP screen, enter the following details:
Basic Settings
• Enable FTP File system layer: Yes
• FTP User: Your FTP username
• FTP Password: Your FTP Password
• FTP Root Path: /htdocs/
Advanced settings
• FTP Host: ftp.yourdomain.com (replacing yourdomain.com with your actual domain name)
• FTP Port: 21
• Save FTP Password: Yes
Step 8: Enter a name for your website in the text box provided.
Step 9: In the next section, enter your email address, then create and confirm an administrator password to access Joomla!
Step 10: If this is the first time that you have used Joomla! it's recommended that you install sample data. Click Install sample data to add this to your initial installation. Once complete, click Next.
You will be provided with your Administrator username, keep this safe.
Step 11: Log into FTP and remove the installation directory from the htdocs folder on your webspace.
Before you can proceed you should delete the installation directory on your webserver. While this directory remains on your webservers (even if it is renamed or moved) your site will remain vulnerable to attack.
Step 12: Once you have deleted this directory you will reach the Joomla! home page. Click the Administrator button located in the Resources section and enter your administrator username and password to access Joomla!.
You have now installed and configured Joomla! on your Mac Productions webserver.
We have additional articles showing how to set up email notifications and Apache mod_rewrite for more advanced Joomla! installations.
How do I setup SSL secure web space?
SSL (Secure Sockets Layer) encrypts communications between two computers. This stops anyone who may be between the two computers from being able to read any of the information that is being sent.
This is useful for any website where sensitive information will be shared, such as ecommerce websites, or any website that requests a username and password to log in.
You can add shared SSL space to your website at any time. This will create a folder on our SSL server for your sole use.
Step 1
Log into your control panel and click Hosting Packages.
Step 2
Select the domain that you would like to add an SSL folder to.
Step 3
Click SSL Secure Web Space.
Step 4
If you have already set up SSL folders, they will be listed on this screen, if you are creating a new folder, click Add SSL Folder.
Step 5
Enter a name for your SSL space in the text box provided. This will also advise you of the URL needed to access your SSL folder.
It is a good idea to make a note of the full URL of your SSL folder, as you will need this later.
Step 6
You can use FTP to upload files and content to your SSL space. Your username will be the same as the SSL folder name. You can create an FTP password and then confirm it in the text boxes provided.
Step 7
Once you have entered your FTP details, click Add SSL Folder to close the SSL wizard.
Do you have an example form to mail script for PHP?
This article shows and explains an example PHP script, that takes information from a feedback form and sends it to you as an email message.
You are responsible for the misuse of any scripts on your webserver. See our article How do I secure my web scripts for further details.
Before we start
To prevent spam being sent through our webservers, there are certain conditions that must be met before our SMTP servers will send the email.
• Email must be sent to, or from, an existing email address hosted by Mac Productions. This must be a mailbox on the same domain name on which the form to mail script is being hosted.
• To stop misuse of your form by third parties the sendmail_from variable should be set to your Mac Productions hosted email address. While access to the php.ini file is restricted on our shared environment, you can sent this variable using the ini_set() command, shown below.
• A fifth parameter, -f, should be added to the sendmail function. This will set the name of the from email address.
In its basic form, a simple sendmail script will look like this:
<?php
ini_set("sendmail_from", "user@yourdomain.com");
mail($email_to, $email_subject, $email_message, $headers, "-fuser@yourdomain.com");
?>
Provided that your form to mail script meets the requirements above, you should have no problems.
If you don't specify an existing mailbox on your domain as the to or from email address, your script may produce a 554: Recipient address rejected: Relay access denied error.
Example
This example will take the information from a feedback form, send it to you in an email message, and then forward the customer to a "thank you for your comments" page.
A simple feedback form
First of all we need to create a feedback form that will receive the data. We will call this form feedback.html. In its most basic form, it can look like this:
<form method="post" action="sendmail.php">
Email address: <input name="email" type="text" /><br />
Name: <input name="name" type="text" /><br />
Message:<br />
<textarea name="message" rows="15" cols="40"></textarea><br />
<input type="submit" />
</form>
Not the prettiest form, but it can be tidied up, and validation can be added at a later date. This form has three fields (email address, name and message) that users can fill in. Once the user click the Submit button, it will collect the information contained within the fields, tag the information as "email, name and message", then send the information to sendmail.php.
The sendmail script
Now we have a form that sends information to a script, we need to create a script to send the email. In this example, we will name the script sendmail.php as this is the address the form is submitting the data to.
In order to send an email, we need certain information (variables), so lets set them first.
<?php
$email_to = "you@yourdomain.com";
$name = $_POST["name"];
$email_from = $_POST["email"];
$message = $_POST["message"];
$email_subject = "Feedback from website";
$headers =
"From: $email_from .\n";
"Reply-To: $email_from .\n";
The code above sets the email address you will send your email to and gets the users' name, email address, and message from the previous form. It also sets the variables that contain the email subject, and headers to specify the from and reply to email addresses.
Now lets build the message of the email with the users' name and comments.
$message = "Name: ". $name . "\r\nMessage: " . $message;
Finally, let's send the email. If the email is sent we will go to a thank you page, if there is an error we will display a brief message.
ini_set("sendmail_from", $email_from);
$sent = mail($email_to, $email_subject, $message, $headers, "-f" .$email_from);
if ($sent)
{
header("Location: http://www.yourdomain.com/thankyou.html");
} else {
echo "There has been an error sending your comments. Please try later.";
}
?>
This script does not have any validation or error checking, so it is not recommended that you copy it directly to your website, however, it does show the basics of sending email from our
webservers, and can be used as a framework for your own scripts.
Attached to the foot of this article you will find example feedback.html and sendmail.php.txt files for reference. Before you can use sendmail.php.txt, please rename the file to sendmail.php.
Using third party scripts to send email
Third party scripts using sendmail will also work on Mac Productions servers, although some will need slight changes made in order to work correctly. If you are using a third party script to send email it must meet the requirements of our system above. Remember to set the sendmail_from variable, add the fifth -f parameter, and send the email either to, or from, a Mac Productions hosted email address.
How can I set up website forwarding?
If you have registered a domain name within your Mac Productions control panel you can set up web forwarding for this domain. This enables you to forward all enquiries for this domain name to another. This is useful if you have a range of domain names that all use the same website, you can forward ralphsdomainname.co.uk to ralphsdomainname.com for example. There is no charge for this service.
This article describes how you can forward one domain name to another. if you have a domain name registered with one company, but hosted elsewhere you will need to use DNS to forward the domain name to your hosting account.
Step 1
Log into your control panel and click the Domain Names tab.
Step 2
A list of your domain names will be displayed, select the domain you would like to add forwarding to.
Step 3
Click the Add Forwarding button.
If you already have hosting set up for the domain name the options to set up forwarding will not be visible. You will need to remove hosting for the domain name before completing this guide.
Step 4
Your domain name will be upgraded to an email and web-forwarding package. Check the box marked Enable Forwarding and enter the name of the website you want to forward to in the text box provided.
Step 5
Select the type of forwarding you would like to set up on your domain name. Mac Productions offer three types of forwarding within your control panel.
• 301 - Moved Permanently: This is the ideal forwarding to use if you want to permanently forward one domain name to another. For instance, if you were forwarding ralphsdomainname.co.uk to ralphsdomainname.com. 301 redirects tell search engines that this redirection is permanent and this will not affect search engine rankings.
• 302 - Moved Temporarily: Is useful for temporary redirections of your domain name, however over time this type of redirection can have adverse affects on your search engine rankings, this type of redirect should not be used for permanent re-directions.
• Masked: Masked forwarding creates a frame around the destination website allowing you to enter Meta tags, keywords, and to mask the destination web address. This has the advantage of not showing your customers the destination address, but can conflict with sites that are already using frames to display content.
The .mobi registry does not allow masked forwarding to be used on .mobi domains.
If you choose to use the Masked forwarding option, you should enter a new title and meta tags for your domain name in the text boxes provided.
Step 6
Once done, click Save to save your changes and set up website forwarding on your domain name.
What is Secure Shell Access (SSH) and how do I use it?
Secure Shell (SSH) is a network protocol, which allows you to connect and exchange data securely with your Linux hosting server. All data transferred in a Secure Shell session is encrypted, including your login password.
SSH is only available on Linux hosting servers.
The version of SSH installed on the Apache web server is called OpenSSH.
When and How to Use SSH
You only need to use SSH if you have to perform a task that cannot be completed with your FTP software, such as:
• Extracting compressed ZIP or TAR files.
• Using CHMOD to change file and folder permissions.
Note: We use a specialized SSH proxy server to maintain all SSH connections to our servers. As a result commands and utilitys will not be run directly on the webserver.
Changing your SSH Password
Before you can connect using SSH, you must set a shell password through your Control Panel. You will also need to make a note of your shell username as you will need it to login.
Step 1
Log into your control panel and click the tab marked Hosting packages.
Step 2
Locate the domain you would like SSH access to and click on it.
Step 3
In the Hosting Summary section, click on the SSH Access link.
Step 4
Click on Reset SSH Password
Step 5
Choose your new password, enter it in the text boxes, and click the Reset Password button.
Connecting to SSH
To connect, you need an SSH client. Most versions of Unix have SSH clients included, and you can just type: /ssh ssh.yourdomain.com (replacing yourdomain.com with your domain name).
For Windows, PuTTY is the recommended SSH client. PuTTY is free and simple to use.
Step 1
Open PuTTY.
Step 2
Enter ssh.yourdomain.com (replacing yourdomain.com with your domain name) in the Host Name box. Make sure the radio button marked SSH is selected, and the Port is set to 22).
Step 3
Click Open.
Quick tip: The first time that you connect to your server, you will be advised that the server’s host key is not cached. Answer Yes to continue. This warning will not occur again, unless Mac Productions rebuilds or upgrades the SSH server.
Step 4
The login as: prompt will appear. Enter your shell username followed by the shell password that you set using your Mac Productions control panel, and press the Enter key.
Step 5
The shell that you open is restricted for security reasons. You will be placed in your root directory, which is one level above the htdocs hierarchy. To move to your document root, use the command cd htdocs.
The commands available include:
• bunzip2
• bzip2
• cat
• chmod
• cp
• cpio
• doscvt
• grep
• gzip
• hostname
• ln
• login
• ls
• mkdir
• more
• mv
• od
• rm
• sh
• tar
• touch
• unzip
• vi
• zcat
When you have finished your shell session, type exit to log out.
You will be logged out automatically after 5 minutes of inactivity.
Featured Support Topics
Shared Hosting
Dedicated Hosting
Online File Backup
MatrixStats
Email
TrafficDriver
Website Maintenance/Management
Callback support is available by calling 1.206.279.2285. Allow up to 1 business day for callback.
| 