A great linux stuff website

Monthly Archives: January 2013

If you get the following error sending emails in Squirrelmail:

SMTP Error Code:

Requested action not taken: mailbox unavailable
Server replied: 550 Verification failed for
Unrouteable address
Sender verify failed

It can be fix it simply by going into the OPTIONS -> Personal Information area and updating correct name and email address, it should be fix the issue.

Advertisements

Message not sent. Server replied: Connection refused 111 Can’t open SMTP stream.

This can be the solutions for the above error you are getting :
> Cpanel version of SquirrelMail does not work.

1) Check the config for Squirrelmail:

/usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php

*—————————–*
I just changed:
$useSendmail = false;
*—————————–*

Changed To:

*—————————–*
$useSendmail = true;
*—————————–*

2)Enabling the SMTP tweak option:
It is likely related to an iptables rule used to deny connections from those other than exim, mailman and root. Turning the SMTP Tweak on and then off should recreate this rule correctly.
Quote:
Main >> Security Center >> SMTP Tweak
3) Editing the CSF conf:

# Block outgoing SMTP except for root, exim and mailman (forces scripts/users
# to use the exim/sendmail binary instead of sockets access). This replaces the
# protection as WHM > Tweak Settings > SMTP Tweaks. This will block hosting
# clients from using your server as an SMTP relay

SMTP_BLOCK = 1

# If SMTP_BLOCK is enabled but you want to allow local connections to port 25
# on the server (e.g. for web scripts) then enable this option too
SMTP_ALLOWLOCAL = 1
Out of these three , one will work for sure.


You can generate a csr through the shell using the following command:
root@mylinux[/]# /scripts/gencsr
NOTE: You must have a Dedicated Hosting, Cloud Hosting or Cheap VPS Hosting to go about making changes using SSH.
This will ask you all the information like email address, domain name, country code, City, Company etc; fill the values and it generates a csr certificate and a private key.Use the following steps to install an ssl certificate:

Please check the domain name for which the ssl certificate is issued means http://www.domainname.com or domainname.com. Suppose you have to install an ssl certificate for domainname.com. You already generate csr for the domainname.com. Check following steps.

1)
Go to directory /usr/share/ssl/certs

root@mylinux[/]# cd /usr/share/ssl/certs

Please check domainname.com.csr file is present already.

root@mylinux[/usr/share/ssl/certs]# ls –l | grep domainname.com.csr

Create the .crt file and paste the ssl certificate into a .crt file as per below

root@mylinux [/usr/share/ssl/certs]# vi domainname.com.crt

paste ssl certificate
save the file.

If cabundle is provided by the client then add it in the domainname.com.cabundle file under the directory /usr/share/ssl/certs

root@server1 [/usr/share/ssl/certs]# vi domainname.com.cabundle

paste the cabundle key and save the file.

2)

Go to directory /usr/share/ssl/private and check to see if the file domainname.com.key is already present.

root@mylinux[/]# cd /usr/share/ssl/private
root@mylinux[/usr/share/ssl/private]# ls –l | grep domainname.com.key

3)
Go to the file /etc/httpd/conf/httpd.conf and copy the virtual host entry for the domainname.com in notepad and add the following line above the end of the tag

SSLEnable
SSLCertificateFile /usr/share/ssl/certs/domainname.com.crt
SSLCertificateKeyFile /usr/share/ssl/private/domainname.com.key
SSLCACertificateFile /usr/share/ssl/certs/domainname.com.cabundle
SSLLogFile /usr/local/apache/domlogs/shop.discdudes.com-ssl_data_log
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown

Add the following line above the virtual host entry.

add the following line at the end of the virtualhost tag.

Now your sslVH entry should look like as per below. Please check the sample sslVH entry.

ServerAlias domainname.com
ServerAdmin webmaster@domainname.com
DocumentRoot /home/username/public_html
BytesLog domlogs/domainname.com-bytes_log
ServerName domainname.com

User username
Group username

CustomLog /usr/local/apache/domlogs/domainname.com combined
ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/

SSLEnable
SSLCertificateFile /usr/share/ssl/certs/domainname.com.crt
SSLCertificateKeyFile /usr/share/ssl/private/domainname.com.key
SSLCACertificateFile /usr/share/ssl/certs/domainname.com.cabundle
SSLLogFile /usr/local/apache/domlogs/shop.discdudes.com-ssl_data_log
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown

4)
If cabundle is not given by the client then remove the following line from the sslVH entry

SSLCACertificateFile /usr/share/ssl/certs/domainname.com.cabundle

5)
Add the sslVH entry in httpd.conf file and restart the httpd service.

Now you are able to access site https://domainname.com

Please check the file paths are correctly specified for .crt, .key and .cabundle file. If the file paths are incorrect in the sslVH entry then the httpd service won’t started.


On a Linux VPS with cPanel you may be alerts along the lines of the following:

Time:
Account:
Resource: Virtual Memory Size
Exceeded: 418 > 200 (MB)
Executable: /usr/bin/php
Command Line: /usr/bin/php /home/your_site/public_html/index.php
PID:
Killed: No

This alert is an informational message. How you deal with these are a matter of personal preference and needs of your organization.

There is a daemon on your VPS, the lfd daemon, that will monitor processes and if a process’ memory usage exceeds a defined threshold (in this case of the example above, 200MB), it sends an alert. That is all that is happening here. The server has no way of knowing if this is expected behavior or not, so it just sends an alert so the owner can decide whether to investigate.

So, if the threshold is set to 200MB and a script or process uses more than 200MB memory, you will get an alert containing the name of the script, the time it occurred, and the amount of memory that it is consuming.

Here are some options you may want to consider for how to deal with these. This is not an exhaustive list but should give a good starting point.

The first option is to do nothing. When you get the alerts, glance at them and see what script or process is triggering the alert. If your VPS is running particularly sluggish and you are getting alerts about a PHP script consuming large amounts of RAM, you can consider killing the script to return the server to normal responsiveness. Likewise, if you write some script and start getting alerts about the amount of RAM it is consuming, that might be a heads up to you that your script has problems.
Increase the memory threshold for the alerts from 200MB to say 300MB. That will allow scripts and processes to consume more RAM before they trigger the alert. If you want to increase it much higher than 300MB, then you might be better off just turning this feature off alltogether (see the next option).
Turn off this feature entirely. If you are not interested in knowing when a process exceeds a defined threshold, then there is no need to get the alert and it can be turned off.

To change the threshold that LFD alerts on:

Log into WHM of your VPS at https://:2087 with the root account.
Go to ConfigServer Security&Firewall –> Firewall Configuration
Change the value for PT_USERMEM to the threshold you want to report on.

To turn off this feature, set the PT_USERMEM paramter to


Following are the commands to open TCP or UDP ports on the server.

To Verify the avalaible port on server use below command
# netstat -nap | grep : port no

E.g to open port 25

open TCP/UDP port 25
# iptables -A INPUT -p tcp –dport 25 -j ACCEPT
# iptables -A INPUT -p udp –sport 25 -j ACCEPT

# service iptables save

and for flushhing iptables us

# iptables -F

# iptables -A INPUT -s 111.xx.ss.111 -j DROP

o/p 111.xx.ss.111

# iptables -L

# service iptables save
# /etc/init.d/iptables save


Error: Unable to fetch the cPanel user file

If you getting the error “Unable to fetch the cPanel user file ” while modifying account through WHM >> Modify Account then in order to get this issue resolved follow the steps:

Log in to your server root (SSH) and check the following:

# cd /var/cpanel/users
# ls -lah username
-rw-r—– 1 root username 596 jan 8 14:03 username
# vi username

Here replace username with the cPanel username. The correct permissions on the file should look like the following

If the permissions are correct then check inside the file, the USER=username entry should have the username of that user. Some 3rd party plugins modify the username by appending .sometext to the end of the username. This can cause cPanel to be unable to read the user’s file.

Then run the cPanel command
# /script/updateuserdomain


While login to an account’s cpanel as reseller, there should be a drop down box to switch to the cpanel of various accounts under that reseller.
If it is not available there, you can check the following things.

1) Login In WHM -> Tweak Settings -> make sure the following option is not checked.

2) Disable login with root or reseller password into the users’ cPanel interface. Also disable switch account dropdown in themes with switch account feature.

3) Formerly, the problem can be with only one or two domains. All account’s cpanel may be chekcing the drop down, but when you enter into one the drop down just empty.

4) An instance, it could be a problem with cPanel account password. Try to resetting the password of that account and check if this resolve the issue.