Archive for the ‘HSP’ Category
Saturday, January 12th, 2008
Using php mail() function to send emails from php script.
Send Email from a PHP Script Example :
The first argument to this function is the recipient, the second specifies the message’s subject and the third one should contain the body. So to send a simple sample message, we could use:
php
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("
Message successfully sent!
“);
} else {
echo(”
Message delivery failed…
“);
}
?>
Save this file as mail.php and browse from url http://yourdomain/mail.php
Posted in Direct Admin, Ensim, General, HSP, HSphere, Helm, Linux, PHP / Mysql, VPS, WHM/cPanel | No Comments »
Thursday, April 19th, 2007
MySQL is one of the most important programs on a server, unfortunatly it is also pretty resource intensive. One a server it is not uncommon for a single user or even a query to take up the bulk of the servers cpu cycles. Mytop is a very useful program to see what queries a server is currently processing as well as which user is executing them. Think of mytop as top for mysql. If you see a lot from a user that means they are probably the hog. Mytop can also be useful for figuring out exactly which queries are causing the problem in the case of a self-designed website. The following is how to install mytop on the server and run it. Thanks to carlos for the actual commands
We are going to install 2 perl modules in addition to mytop to ensure that it will work.
Install TermReadKey:
cd /usr/local/src
wget http://search.cpan.org/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz
tar -zxf TermReadKey-2.30.tar.gz
cd TermRead*
perl Makefile.PL
make test
make
make install
cd ..
Now install DBI:
wget http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.48.tar.gz
tar -zxf DBI-1.48.tar.gz
cd DBI*
perl Makefile.PL
make test
make
make install
cd ..
Finally install mytop:
wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.4.tar.gz
tar -zxf mytop-1.4.tar.gz
cd mytop*
perl Makefile.PL
make test
make
make install
Now simply run “mytop” and your done!
Thanks to eth0
Posted in Articles -- Webhosting, Direct Admin, Ensim, HSP, Linux, PHP / Mysql, Plesk, VPS, WHM/cPanel | No Comments »
Tuesday, April 17th, 2007
1. SSH into your server as ‘admin’ and gain root access by su
2. Copy and paste this line to edit the file for SSH logins
pico -w /etc/ssh/sshd_config
3. Find the line
Protocol 2, 1
4. Uncomment it and change it to look like
Protocol 2
5. Next, find the line
PermitRootLogin yes
6. Uncomment it and make it look like PermitRootLogin no
7. Save the file Ctrl+X then Y then enter
8. Now you can restart SSH
/etc/rc.d/init.d/sshd restart
Now, no one will be able to login to root with out first loggin in as admin and ’su -’ to root, and you will be forcing the use of a more secure protocol. Just make sure you remember both passwords!
Posted in Articles -- Webhosting, Direct Admin, Ensim, HSP, Linux, Plesk, VPS, WHM/cPanel | No Comments »
Tuesday, April 17th, 2007
1. Login to your server and su to root.
2. cd /root
3. pico .bashrc
4. Scroll to the end of the file then add the following:
echo ‘ALERT – Root Shell Access (YourserverName) on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” you@yourdomain.com
Replace YourServerName with the handle for your actual server
Replace you@yourdomain.com with your actual email address
5. Crtl + X then Y
Now logout of SSH, close the connection and log back in! You should receive an email address of the root login alert a few minutes afterwards.
Posted in Articles -- Webhosting, Direct Admin, Ensim, HSP, Linux, Plesk, VPS, WHM/cPanel | No Comments »
Tuesday, April 17th, 2007
Telnet sends clear text passwords and usernames through logins and should be disabled on all web servers and replaced with SSH.
Some hosting providers are not disabling telnet by default but you should ensure that it has been turned off as it’s a great security risk to your servers. TELNET server listens for incoming messages on port 23, and sends outgoing messages to port 23.
1. Login to your server through SSH and su to root.
2. Type pico /etc/xinetd.d/telnet
3. Look for the line: disable = no and replace with disable = yes
4. Now restart the inetd service: /etc/rc.d/init.d/xinetd restart
5. Turn off it through chkconfig as well because it can still start through that.
/sbin/chkconfig telnet off
6. Scan your server to ensure port 23 is closed.
nmap -sT -O localhost
Also run ps -aux | grep telnet and if you find anything other than “grep telnet” as result kill the process.
Posted in Articles -- Webhosting, Direct Admin, Ensim, HSP, Linux, Plesk, VPS, WHM/cPanel | No Comments »
Thursday, April 12th, 2007
Happy Bloging
Posted in Articles -- Webhosting, Direct Admin, Ensim, Fantastico / Installatron, HSP, Kernel, Linux, ModernBill, Plesk, VPS, WHM Auto Pilot, WHM/cPanel, Windows | No Comments »
Thursday, April 12th, 2007
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
Posted in Articles -- Webhosting, C# / VB/ ASP .net, Direct Admin, Domains, Ensim, Fantastico / Installatron, HSP, Internet, Kayako Helpdesk, Kernel, Linux, ModernBill, PHP / Mysql, Plesk, SEO, Ubersmith, VPS, Virtuozzo, WHM Auto Pilot, WHM/cPanel, WHMCS, Windows | No Comments »