I’ve lost my email password. How can I reset it?

23 May, 2013 (18:26) | mail | By: sblogadmin

[ Note : These are the complete step-by-step instructions. In many cases, your email password is the same as your control panel password. You may wish to try that password first.]

Here is the best method to reset an email password.

1. Login to your hosting control panel at:

https://phpwebhosting.com/login/

2. If you know your “postmaster” (master) password, skip to step 3. If you do not know your “postmaster” (master) password, click on :

“Password: change”

in the side left section of your control panel.

Here you can change your password. The new password will affect your hosting control panel, ftp and master email password.

3. After you have your master email password, click the “email” link near the top of the control panel.

4. Click “Configure your email accounts”

5. Login here with :

POP Account: postmaster
password: your postmaster password set in step #2
domain: your-domain.com

6. Click :

Edit existing address:

7. Click the red circle under “Modify User” for the user you wish to change the password for.

How can I remove index.html from my URL’s?

10 May, 2013 (13:01) | mod_rewrite | By: sblogadmin

I do not want index.html (or index.php, etc.) to show up in my URLs.

Use mod_rewrite to remove index.html from the URL. Enter the following into a .htaccess file :

RewriteCond %{REQUEST_URI} index\.html
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]

How can I force my URL’s to have www at the front?

10 May, 2013 (12:59) | mod_rewrite | By: sblogadmin

How can I force my URL’s to have www at the front?

Use mod_write to force the www in the URL. Inside of a .htaccess file, add the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^your-domain\.com [NC]
RewriteRule (.*) http://www.your-domain.com/$1 [R=301,L]

Send mail using Pear:Mail

3 May, 2013 (19:23) | mail, php | By: sblogadmin

How can I send mail from php using a specific smtp host, for example, smtp1.phpwebhosting.com or my private smtp server?

Use the pear mail package.

include(‘Mail.php’);

$from = ““;
$to = ““;
$subject = “Test”;
$body = “Test”;

$host = “smtp1.phpwebhosting.com”; // enter the smtp server you wish to use here
$port = “25”; // smtp port
$username = “your_smtp_user@domain.com”; // your smtp-auth username
$password = “your_password”; // your smtp-auth password

$headers = array (‘From’ => $from,
‘To’ => $to,
‘Subject’ => $subject);
$smtp = Mail::factory(‘smtp’,
array (‘host’ => $host,
‘port’ => $port,
‘auth’ => true,
‘username’ => $username,
‘password’ => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo(“

” . $mail->getMessage() . “

“);
} else {
echo(“

Message successfully sent!

“);
}

ssh will not connect – Connection closed by remote host

14 March, 2013 (19:43) | ssh | By: sblogadmin

Question:

When I try to connect with ssh I get an error such as “ssh_exchange_identification: Connection closed by remote host”. I know that ssh is enabled on my account. What is wrong?

Answer:

Usually these errors are caused when an attacker is scanning for badly configured servers with default usernames and passwords or easy to guess passwords. Our scripts detect and block such scans/attacks but there can be times during the attack when all connections are taken and the server refuses new connections. Your server is safe and such attacks/scans are part of the day-to-day life of servers on the internet. Usually you never notice the effects but in rare cases there can be disruptions.

A temporary work-around is to connect to ssh on port 23. Many of our servers run ssh on port 23 as well as port 22. You can try to connect to port 23 with:

ssh your_username@your_server.com -p 23

or change the port from 22 to 23 in your client.

Hide eregi() deprecated errors

11 February, 2013 (22:14) | php | By: sblogadmin

Question:

My script gives errors like:

Deprecated: Function eregi() is deprecated in /home/my_username/www/path/contact/include/fgcontactform.php on line 548

Why is this occuring? How can I fix it?

Answer:

Newer php versions are removing support for the eregi() function. Your script will continue to work but using normal php.ini settings the deprecated errors are shown. You can hide the errors by adding:


error_reporting = E_ALL & ~E_DEPRECATED

to your /home/username/etc/php.ini file

Create the file if it does not exist. If you already have a error_reporting line, modify it hide E_DEPRECATED

If you are on a VPS, edit /etc/php.ini and restart httpd if you are running mod_php.

You should also work to update your script to no longer call the deprecated functions as future versions of php will remove support for the functions completely.

How to disable mod_security on shared hosting via .htaccess

28 January, 2013 (15:34) | htaccess | By: sblogadmin

Question: I’m installing a new php cart and get the error :

Your webserver has the mod_security module enabled. As a result, you may see the “403 Forbidden” or “Not Acceptable” error messages after submitting forms that contain “curl”, “perl”, “set”, etc. It is recommended to disable this module or reconfigure it so that these words are not forbidden.*

How can I disable mod_security?

Answer:

To disable mod_security, add the following to a .htaccess file in the base directory for the script you are trying to install.


SecFilterEngine Off
SecFilterScanPOST Off

Outgoing mail is no longer working (error 0x8004210B)

30 December, 2012 (07:55) | mail | By: sblogadmin

Question:

I get the error :

Task ‘xxxx@xxxxxxxxxxxxxx.com – Sending’ reported error (0x8004210B): ‘the
operation timed out waiting for a response from the sending (SMTP) server.
If you continue to receive this message, contact your server administrator or
Internet service provider (ISP).’

when trying to send mail. How can I fix this?

Answer:

Your local ISP may have begun blocking port 25. Many ISP’s do this to attempt to make you only send through their SMTP servers so they can better manage all mail leaving their network (to control spam). Change the port to 2525 in your email program and it will likely work. If 2525 does not work, try port 587.

Another – less likely cause – is hung anti-virus software running on your computer. Some anti-virus / anti-malware software re-directs all port 25 activity to scan mail before it leaves your computer. Try to restart your computer and/or anti-virus software and see if this corrects the problem.

Webmin crashing / unresponsive on my VPS – how to fix?

17 December, 2012 (19:39) | VPS | By: sblogadmin

Question: Webmin keeps crashing on my VPS. Why does this happen and how can I fix it?

Answer:

From our experience, webmin seems to become non-responsive when running on “low memory” VPS’s (typically those with 256 megs of ram or less).

If you attempt to connect to webmin (port 10000 by default) and get an unable to connect message, do the following:

1. ssh in to your server
2. as root, type :

/sbin/service webmin restart

Note, that “service” will restart webmin on a RedHat/Centos based VPS. If you are running a different Linux flavor you’ll need to use the service management for that distribution.

You should also make sure webmin is set to start automatically on reboots by running:

/sbin/chkconfig webmin on

Hide index.html from URL in address bar

12 December, 2012 (21:07) | htaccess, mod_rewrite | By: sblogadmin

Question: I want users to my site to always go to the base URL http://site.com/ – I never want the index page to show. For example, I want http://site.com/index.html to redirect automatically to http://site.com without the index.html

Answer:

Create a .htaccess file (or add to your existing .htaccess) in the top level directory for your site and add the following line:


RewriteEngine on

RewriteRule ^index\.html$ / [R=301,L]

The line :


RewriteEngine on

may already be in your existing .htaccess. If so, do not duplicate it.