Log into WHM and click on “Service Manager” under the Service Configuration grouping. Put a checkmark next to “exim on another port” (the default is port 26) then click “Save”.
Uncategorized
How to forward a website to another url using PHP
There are several ways to accomplish this task, but the simplest to understand is to use php.
To do this, you need to create the page that will do the forwarding. This can be any page, as long as it ends in “.php”. If you are trying to redirect a domain, you’d create “index.php” inside the public_html directory.
Once you decide which page you will use, then create the file and enter the following text:
<?php
header(“Location: http://whereyouwant.com/to/go.html“);
?>
Where http://whereyouwant.com/to/go.html is the location that you want the page to forward to. You can use local values, ie: /page.html, or full urls as in the above example (http://..etc.)
Plesk Migration Manager is unable to connect to Plesk Agent installed on a remote server.
Source server has Plesk Migration agent installed. Plesk Migration Manager is installed on Plesk server. Plesk keeps displaying
Unable to upload scout: Unable to run migrmng: Unable to connect to remote host xxx.xxx.xxx.xxx. Please check if the remote server is available for connection and if the correct login and password are specified.
To successfully utilize Plesk Migration Manager it’s important to have the network setting configured correctly:
1. The following ports need to be open for PMM (add the required exceptions for firewall):
For PMM:tcp 6489 (by default or other custom)
For data transferring on Windows source servers:tcp 135tcp 139tcp 445udp 137udp 138
For data transferring on Linux source server:tcp: 22
2. Server’s network settings. “Client for Microsoft Networks” and “File and Printer Sharing for Microsoft Networks” must be present.
Start, Settings, Network Connections, Local Area Connection click Properties button. “Client for Microsoft Networks” and “File and Printer Sharing for Microsoft Networks” should be present. If they are not, they need to be installed.
You can test connection to server with PMM Agent using
Start, Run, type \\хxх.хxх.хxх.ххх\c$ and hit Enter
where xхх.xхх.хxх.ххх is the IP address of the source server.
And if “Network sharing” ports are opened you can access windows administrator’s share folders.
PVA troubleshooting.
Linux/Unix, Management Node:
PVA status: # pvamn status
PVA restart: # pvamn restart
PVA (Control Center) status: # pvacc status
PVA (Control Center) restart: # pvacc restart
Special config file: /opt/pva/mn/bin/pva.conf
[log_folder] – Location of log files, default: /var/log/pva
[etc_folder] – Location of config files, default: /var/opt/pva/mn/etc
To change log level, find vzagent.conf location in pva.conf and change
3 – INFO level
4 – DEBUG level
Installation logs: /var/log/pva/setup/
To collect PVA Report run: # /opt/pva/mn/bin/pvareport.sh
Linux/Unix, Slave node:
PVA status: # pvaagent status
PVA restart: # pvaagent restart
PVA (Power Panel) status: # pvapp status
PVA (Power Panel) restart: # pvapp restart
Special config file: /opt/pva/agent/bin/pva.conf
[log_folder] – Location of log files, default: /var/log/pva
[etc_folder] – Location of config files, default: /vz/pva/agent/etc
To change log level, find vzagent.conf location in pva.conf and change
3 – INFO level
4 – DEBUG level
Installation logs: /var/log/pva/setup/
To collect PVA Report run: # /opt/pva/agent/bin/pvareport.sh
PhpMyAdmin Stuck at Login screen with no errors !
This is a possible issue when the path to save php_session is not correctly set :
The directory for storing session does not exists or php do not have sufficient rights to write to it.
To define the php_session directory simply add the following line to the php.ini :
session.save_path=”/tmp/php_session/”
And give write rights to the http server.
usually, the http server run as user daemon in group daemon. If it is the case, the following commands will make it :
chown -R :daemon /tmp/php_session
chmod -R g+wr /tmp/php_session
restart http server.
WHM locked out – cphulkd
cPHulk Brute Force Protection prevents malicious forces from trying to access your server’s services by guessing the login password for that service. BUT sometimes it becomes troublesome when you are accessing the cPanel with incorrect password and cPanel assuming you as attacker blocks you with below message :
—————————————————————————————
This account is currently locked out because a brute force attempt was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.
—————————————————————————————
To get out of such situation you can disable cphulkd protection :
login via ssh and disable cphulkd using the command below.
# /usr/local/cpanel/bin/cphulk_pam_ctl –disable
This should allow you to login to WHM and double check your cphulk settings.
You can view IP addresses that have been blocked via the WHM interface: WHM -> Security -> Security Center -> cPHulk Brute Force Protection in the Brutes table. On that screen, you can also customize brute force protection settings.
Flush DB will remove all blocked IPs:
WHM >> Security Center >> cPHulk Brute Force Protection >> Click on Flush DB
Well the other way to this is to remove the IP’s blocked by cPHulk from its database .
ssh to the server login as root and type the following at the prompt
[root@server:] mysql
mysql> use cphulkd;
mysql>BACKUP TABLE brutes TO ‘/path/to/backup/directory’;
mysql> SELECT * FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;
mysql> DELETE FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;
mysql>quit
🙂
How to access Plesk database
APPLIES TO:
- Plesk for Windows
Answer
Plesk Database can be accessed by following steps below depending on the database provider are configured in current Plesk installation.
For MSSQL provider:
Database can be accessed using the following CLI command:
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql –E Or Microsoft SQL Server Management Studio Express utility can be used.
For MySQL DB provider:
Execute the following commands in command prompt:
cd %plesk_dir%\Databases\MySQL\bin mysql -P8306 -uadmin -p psa For MS Access DB provider (JET):
You can find and use any utility for viewing MS Access(.mdb) database files:
E.g.
http://www.alexnolan.net/software/mdb_viewer_plus.htm
http://www.softpedia.com/get/Internet/Servers/Database-Utils/MDB-View.shtml
Plesk Database file is located in %plesk_dir%\admin\db\psa.mdb
Named rndc.key error when starting
When trying to restart named process after making modifications may end up in a corrupt rndc.key key and the error will show like this:
Sep 12 03:30:54 server named[23683]: loading configuration: bad base64 encoding
Sep 12 03:30:54 server named[23683]: exiting (due to fatal error)
A simple explanation to this is that the key got modified somehow might me some bug.
What to do about this? Well it is simple just check the /etc/rndc.conf file and copy the key from there(you will see the key in the first lines of the file) and replace the key that it is in /etc/rndc.key file and restart named process.
# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
Windows integration notes
Make program default editor for a file type
Shift-right-click on a file of a type; this forces the ‘open with’. Click ‘Choose program’, find it, and select the checkbox that tells windows to always open files of this type.
Change IE ‘view source’ program
Folder:
has a default key that is the path to a program, e.g.
Add to context menu for all files
Run regedit. Create the key:
…if it doesn’t exist. Choose a name that doesn’t exist under it, e.g. Notepad2, and create that as key, and a key under it called ‘command’:
HKEY_CLASSES_ROOT\*\shell\Notepad2\command
Make the default value under the first what you want to appear in the menu and the second what you want it to run, e.g.
and
“C:\Program Files\Notepad2\Notepad2.exe” “%1”
…respectively.
DNS Cache Poisoning Test
Q. How do I verify that my ISP or my own recursive resolvers are free from DNS cache poisoning bug that is promised full disclosure of the flaw by Dan on August 7 at the Black Hat conference? How do I test my dns server for DNS cache pollution or DNS Cache Poisoning bug?
A. DNS cache poisoning (also known as DNS cache pollution) is a maliciously created or unintended situation that provides data to a Domain Name Server that did not originate from authoritative DNS sources. It occur if DNS “spoofing attack” has been encountered. An attacker will send malicious data / non-secure data in response to a DNS query. For example dns query for www.linuxbabu.net can be redirected to www.redhat.com.
how do I find out if my DNS server is open to such attack or not?
Visit Dan Kaminsky java script page to check your DNS
You can also use following command dig command, enter:$ dig +short @{name-server-ip} porttest.dns-oarc.net txtSample output:
$ dig +short @ns1.example.com porttest.dns-oarc.net txt
$ dig +short @208.67.222.222 porttest.dns-oarc.net txt
z.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.
"208.67.222.222 is GOOD: 26 queries in 0.1 seconds from 26 ports with std dev 17746.18"Another test,$ dig +short @125.22.47.125 porttest.dns-oarc.net txtOutput:
z.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.
"125.22.47.139 is POOR: 42 queries in 8.4 seconds from 1 ports with std dev 0.00"FIX :
Run yum updateyum updateOpen named.conf file and comment out following two lines:query-source port 53;Make sure recursion is limited to your LAN only. Set ACL. Restart bind to take effect:
query-source-v6 port 53;rndc reload
service named restart