Archive for May 2008

How do I password protect a directory on a Linux server?

There are two files you need to create that work together to make a folder password protected on a Linux hosted website.

In the folder that you need to protect, you need to place a file called .htaccess which contains instructions for the webserver to make that folder protected.

In the top level of your site you need to place a file called .htpasswd. The top level of your site is the same directory that your www and cgi-bin directories sit in. This file contains the usernames and their respective encrypted passwords, stored one per line.

Note, the dot at the beginning of .htaccess and .htpasswd signify a hidden file on the Linux server, your FTP program may not always be able to see or deal with them. We recommend you follow these steps carefully.

1. Enter the username you want to use for the password protected folder.
2. Enter the cleartext password you want to use for that user on the password protected folder.
3. Click Submit.
Folder username:
Folder password:

.htpasswd
1. In a text editor, create a file called htpasswd.txt.
2. Copy and paste this text into the file. If you need multiple users and passwords, repeat the above submit and paste each entry in, one per line.
3. Save the file.
4. FTP into your web area.
5. Ensure you are in the top level directory of your site (ie, above the www directory.)
6. Upload htpasswd.txt.
7. Rename the file to .htpasswd

.htaccess
1. In a text editor, create a file called htaccess.txt.
2. Copy and paste this text into the file.
3. Save the file.
4. FTP into your web area.
5. Ensure you are in the directory that you wish to password protect.
6. Upload htaccess.txt.
7. Rename htaccess.txt to .htaccess

Note:
1. The . infront of files on linux servers specifies that it is a hidden file so you may not see it after you rename it.
2. As soon as your rename htaccess.txt to .htaccess, it will start attempting to password protect that directory.
3. The directives inside a .htaccess file will take effect for the directory you upload it to and any of it’s subdirectories. If the .htaccess file is in your www directory, it’s directives will apply across your entire site.
4. When you are testing the password protection, it is common for .htaccess details to be cached by your browser. If it is not working as expected, close the browser and use a new one to test again.

mail(): Failed to connect to mailserver at “localhost” port 25, verify your “SMTP” and “smtp_port” setting in php.ini

* Open php.ini as per your website php version (Normally php.ini available under C:\PHP or C:\Windows)

* Uncomment the following lines

SMTP = localhost ; for Win32 only
smtp_port = 25
sendmail_from= me@localhost.com ; for Win32 only

* Click on save.

Notice: Undefined index” Error in PHP

* Open php.ini as per your website php version (Normally php.ini available under C:\PHP or C:\Windows)
* By default “error_reporting = E_ALL; display all errors, warnings and notices” is enabled in php.ini file

change it to

;error_reporting  = E_ALL; display all errors, warnings and notices

and uncomment the line

error_reporting = E_ALL & ~E_NOTICE

* Click on save

How to Import/Export MSSQL 2000 database?

1) From the Start Menu, select “Programs” -> “Microsoft SQL Server” -> “Import and Export Data” then click “Next.

2)In the “Server” field, type in the Name or IP of the source server (your local machine Ip), choose “Use SQL Server Authentication,” type in your username and password, choose your database from the “Database” field, click “Next”.

3) In the “Server” field, type in the hostname of the remote SQL Server (this is listed in your hosting control panel), choose “Use SQL Server Authentication,” type in your database username and password, choose your database from the “Database” field, click “Next”.

The destination server is ” ”
Database User Name : database user name
Database Password : (which is given you in Helm CP)

Download Microsoft SQL Server Management Studio Express for connecting SQL Server 2005

http://download.microsoft.com/download/b/3/8/b3847275-2bea-440a-8e2e-305b009bb261/sql_09.wmv

1. Download MSXML 6.0 from Microsoft.com and run the setup.
2. Now Download Microsoft SQL Server Management Studio Express for connecting SQL Server 2005

http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&DisplayLang=en

and run the setup. (From here you can connect with SQL Server 2005 database.)