<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GS Design &#187; WHM &amp; Cpanel</title>
	<atom:link href="http://www.gsdesign.ro/blog/category/hosting/whm-cpanel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gsdesign.ro/blog</link>
	<description>Just another developer blog</description>
	<lastBuildDate>Fri, 23 Jul 2010 07:33:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Speeding your php application by tweaking the php configuration</title>
		<link>http://www.gsdesign.ro/blog/speeding-your-php-application-by-tweaking-the-php-configuration/</link>
		<comments>http://www.gsdesign.ro/blog/speeding-your-php-application-by-tweaking-the-php-configuration/#comments</comments>
		<pubDate>Sat, 03 May 2008 19:00:47 +0000</pubDate>
		<dc:creator>Gabi Solomon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[WHM & Cpanel]]></category>
		<category><![CDATA[Web Aplications]]></category>
		<category><![CDATA[php&mysql 101]]></category>

		<guid isPermaLink="false">http://www.gsdesign.ro/blog/lang_enspeeding-your-php-application-by-tweaking-the-php-configurationlang_enlang_rocresteti-viteza-aplicatiilor-web-prin-modificarea-configurarii-phplang_ro/</guid>
		<description><![CDATA[This article is meant to help you to speed up your application by by tweaking the php configuration. The time gained might not be to visible to the user, but i should relief a little of the load on the server. Also this tweaks are going to help you a little in security. If you [...]]]></description>
			<content:encoded><![CDATA[<p>This article is meant to help you to speed up your application by by tweaking the php configuration. The time gained might not be to visible to the user, but i should relief a little of the load on the server. Also this tweaks are going to help you a little in security.</p>
<p>If you are on a shared server and dont know how to change your php configuration you might want to check <a href="http://www.gsdesign.ro/blog/2008/04/30/how-to-change-php-configuration-on-shared-servers/" target="_blank">this article</a> also.</p>
<p>But enough talk and lets get right into it. I will write the configuration name, the recommended setting and how this helps your application.</p>
<h3>short_open_tag = Off</h3>
<p>This will turn off short tags ( &lt;? &#8230;. ?&gt; ) and have the php engine one problem less to worry about.</p>
<h3>asp_tags = Off</h3>
<p>Do not use ASP like tags: &lt;% echo “hello world”; %&gt;</p>
<h3>memory_limit = 32M</h3>
<p>This is one configuration that you might need to tweak once in a while. But for start it is better to set it to a lower value and adjusting it when you need it. This will help you keep track of your aplication memory usage.<br />
An article about memory usage you can find <a href="http://www.gsdesign.ro/blog/php-fatal-error-allowed-memory-size-of-33554432-bytes-exhausted/">here</a>.</p>
<h3>register_long_array = Off</h3>
<p>This will tells PHP to not register the deprecated long $HTTP_*_VARS type predefined variables. The default value is On. Since almost nobody ever uses them any more ( unless they have some compatibilty problems with old scripts, and they need them on ) it&#8217;s recommended to turn them off, for performance reasons. Instead, use the superglobal arrays, like $_GET.</p>
<p>This directive became available in PHP 5.0.0 and was dropped in PHP 6.0.0.</p>
<h3>register_argc_argv = Off</h3>
<p>This is more or less the same with <em>register_long_arrays</em> referring mostly to GET informations so it should be set to Off as well.</p>
<h3>auto_globals_jit = On</h3>
<p>This makes php stop generating the SERVER and ENV variables at script start ( default behaver ) and generating them when needed (Just In Time). These should help performance by cutting down the memory used by your scripts.<br />
For this to work you need to have register_globals, register_long_arrays, and register_argc_argv disabled.<br />
As an inside info : i tried this on a server .. .and it didn&#8217;t seem to create any SERVER or ENV variables, but i guess it was the server configuration because on a different server it worked <img src='http://www.gsdesign.ro/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<h3>magic_quotes_gpc</h3>
<p>From my experience having this on can be a real pain in the [****]. When this is on, all &#8216; (single-quote), &#8221; (double quote), \ (backslash) and NUL&#8217;s are escaped with a backslash automatically. Why this is bad ? because you dont have a control over it. For example you use a mysql wrapper for youre database interactions that already has an escape function, this will make your values double escaped, and you endup after a few submits with a bunch of backslashes. So better have it off and do your own escaping, and maybe use a cleaning function to prevent SQL Injection ( <a href="http://www.gsdesign.ro/blog/how-to-prevent-sql-injection/">more info here</a> )</p>
<h3>always_populate_raw_post_data = Off</h3>
<p>Raw Post data is one of the more advanced knowledge, so if you dont use it, relief php of it concern <img src='http://www.gsdesign.ro/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  and set always_populate_raw_post_data = Off.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gsdesign.ro/blog/speeding-your-php-application-by-tweaking-the-php-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing WHM and cPanel</title>
		<link>http://www.gsdesign.ro/blog/securing-whm-and-cpanel/</link>
		<comments>http://www.gsdesign.ro/blog/securing-whm-and-cpanel/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 12:29:42 +0000</pubDate>
		<dc:creator>Gabi Solomon</dc:creator>
				<category><![CDATA[WHM & Cpanel]]></category>

		<guid isPermaLink="false">http://www.gsdesign.ro/blog/2007/06/24/securing-whm-and-cpanel/</guid>
		<description><![CDATA[Yet another article on server security Requirements: Root access to WHM ========================================= Below is a list of items inside of WHM/cPanel that should be changed to secure your server. Goto Server Setup =>> Tweak Settings Check the following items&#8230; Under Domains Prevent users from parking/adding on common internet domains. (ie hotmail.com, aol.com) Under Mail Attempt [...]]]></description>
			<content:encoded><![CDATA[<p>Yet another article on server security <img src='http://www.gsdesign.ro/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Requirements: Root access to WHM<br />
=========================================<br />
Below is a list of items inside of WHM/cPanel that should be changed to secure your server.</p>
<p>Goto Server Setup =>> Tweak Settings<br />
Check the following items&#8230;</p>
<p>Under Domains<br />
Prevent users from parking/adding on common internet domains. (ie hotmail.com, aol.com)</p>
<p>Under Mail<br />
Attempt to prevent pop3 connection floods<br />
Default catch-all/default address behavior for new accounts &#8211; blackhole<br />
(according to ELIX &#8211; set this to FAIL, which is what I am going to do to reduce server load)</p>
<p>Under System<br />
Use jailshell as the default shell for all new accounts and modified accounts</p>
<p>Goto Server Setup =>> Tweak Security<br />
Enable php open_basedir Protection<br />
Enable mod_userdir Protection<br />
Disabled Compilers for unprivileged users.</p>
<p>Goto Server Setup =>> Manage Wheel Group Users<br />
Remove all users except for root and your main account from the wheel group.</p>
<p>Goto Server Setup =>> Shell Fork Bomb Protection<br />
Enable Shell Fork Bomb/Memory Protection</p>
<p>When setting up Feature Limits for resellers in Resellers =>> Reseller Center, under Privileges always disable Allow Creation of Packages with Shell Access and enable Never allow creation of accounts with shell access; under Root Access disable All Features.</p>
<p>Goto Service Configuration =>> FTP Configuration<br />
Disable Anonymous FTP</p>
<p>Goto Account Functions =>> Manage Shell Access<br />
Disable Shell Access for all users (except yourself)</p>
<p>Goto Mysql =>> MySQL Root Password<br />
Change root password for MySQL</p>
<p>Goto Security and run Quick Security Scan and Scan for Trojan Horses often. The following and similar items are not Trojans:<br />
/sbin/depmod<br />
/sbin/insmod<br />
/sbin/insmod.static<br />
/sbin/modinfo<br />
/sbin/modprobe<br />
/sbin/rmmod</p>
<p>=========================================<br />
More Security Measures<br />
=========================================<br />
1) Update OS, Apache and CPanel to the latest stable versions.<br />
This can be done from WHM/CPanel.</p>
<p>2) Use The Latest Software<br />
Keep the OS and 3rd party software up to date. Always!<br />
CPanel itself can be updated from the root WHM.</p>
<p>3) Change Passwords<br />
Change the root passwords at least once a month and try to make them hard to guess. Yes it&#8217;s a pain to have to keep remembering them, but it&#8217;s better than being hacked.</p>
<p>4) Watch The Logs<br />
Install something like logwatch to keep an eye on your system logs. This will extract anything &#8216;interesting&#8217; from the logs and e-mail to you on a daily basis.<br />
Logwatch can be found at: http://www.logwatch.org<br />
Install instructions here.</p>
<p>5) Avoid CPanel Demo Mode<br />
Switch it off via WHM Account Functions => Disable or Enable Demo Mode.</p>
<p>6) Jail All Users<br />
Via WHM Account Functions => Manage Shell Access => Jail All Users.<br />
Better still never allow shell access to anyone &#8211; no exceptions.</p>
<p>7) Set The MySQL Root Password<br />
This can be done in CPanel from the root WHM Server Setup -> Set MySQL Root Password.<br />
Make it different to your root password!</p>
<p> <img src='http://www.gsdesign.ro/blog/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Tweak Security<br />
From the root WHM, Server Setup -> Tweak Security, you will most likely want to enable:<br />
- php open_basedir Tweak.<br />
- SMTP tweak.<br />
You may want to enable:<br />
- mod_userdir Tweak. But that will disable domain preview.</p>
<p>9) Use SuExec<br />
From root WHM, Server Setup -> Enable/Disable SuExec. This is CPanel&#8217;s decription of what it does:<br />
&#8220;suexec allows cgi scripts to run with the user&#8217;s id. It will also make it easier to track which user has sent out an email. If suexec is not enabled, all cgi scripts will run as nobody. &#8220;<br />
Even if you don&#8217;t use phpsuexec (which often causes more problems), SuExec should be considered.</p>
<p>10) Use PHPSuExec<br />
This needs to built into Apache (Software -> Update Apache from the root WHM) and does the same as SuExec but for PHP scripts.<br />
Wisth PHPSuExec enabled, you users will have to make sure that all their PHP files have permissions no greater than 0755 and that their htaccess files contain no PHP directives.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gsdesign.ro/blog/securing-whm-and-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing your VPS</title>
		<link>http://www.gsdesign.ro/blog/securing-your-vps/</link>
		<comments>http://www.gsdesign.ro/blog/securing-your-vps/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 12:26:45 +0000</pubDate>
		<dc:creator>Gabi Solomon</dc:creator>
				<category><![CDATA[WHM & Cpanel]]></category>

		<guid isPermaLink="false">http://www.gsdesign.ro/blog/2007/06/24/securing-your-vps/</guid>
		<description><![CDATA[After a lot of resseller accounts i owned this past years i decided to rent a VPS with another friend fo mine. But we are both new to linux, so i started to do some reasearch around the internet on how to secure my server the best i can. Here is an article i found [...]]]></description>
			<content:encoded><![CDATA[<p>After a lot of resseller accounts i owned this past years i decided to rent a VPS with another friend fo mine.<br />
But we are both new to linux, so i started to do some reasearch around the internet on how to secure my server the best i can. Here is an article i found very ussefull</p>
<p>=========================================<br />
Requirements:  Root access to VPS<br />
=========================================</p>
<p>=========================================<br />
Checking for formmail<br />
=========================================</p>
<p>Form mail is used by hackers to send out spam email, by relay and injection methods. If you are using matts script or a version of it, you may be in jeopardy.</p>
<p>Command to find pesky form mails:<br />
find / -name &#8220;[Ff]orm[mM]ai*&#8221;</p>
<p>CGIemail is also a security risk:<br />
find / -name &#8220;[Cc]giemai*&#8221;</p>
<p>Command to disable form mails:<br />
chmod a-rwx /path/to/filename<br />
(a-rwx translates to all types, no read, write or execute permissions).</p>
<p>(this disables all form mail)</p>
<p>If a client or someone on your vps installs form mail, you will have to let them know you are disabling their script and give them an alternative.</p>
<p>=========================================<br />
Root kit checker &#8211; http://www.chkrootkit.org/<br />
=========================================</p>
<p>Check for root kits and even set a root kit on a cron job. This will show you if anyone has compromised your root. Always update chrootkit to get the latest root kit checker. Hackers and spammers will try to find insecure upload forms on your box and then with injection methods, try to upload the root kit on your server. If he can run it, it will modify *alot* of files, possibly causing you to have to reinstall.</p>
<p>To install chrootkit, SSH into server and login as root.<br />
At command prompt type:</p>
<p>cd /root/<br />
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz<br />
tar xvzf chkrootkit.tar.gz<br />
cd chkrootkit-0.44<br />
make sense</p>
<p>To run chkrootkit</p>
<p>At command prompt type:<br />
/root/chkrootkit-0.44/chkrootkit</p>
<p>Make sure you run it on a regular basis, perhaps including it in a cron job.</p>
<p>Execution</p>
<p>I use these three commands the most.<br />
./chkrootkit<br />
./chkrootkit -q<br />
./chkrootkit -x | more</p>
<p>=========================================<br />
Install a root breach DETECTOR and EMAIL WARNING<br />
=========================================</p>
<p>If someone does happen to get root, be warned quickly by installing a detector and warning at your box. You will at least get the hackers/spammers ip address and be warned someone is in there.</p>
<p>Server e-mail everytime someone logs in as root</p>
<p>To have the server e-mail you everytime someone logs in as root, SSH into server and login as root.</p>
<p>At command prompt type:<br />
pico .bash_profile</p>
<p>Scroll down to the end of the file and add the following line:</p>
<p>echo &#8216;ALERT &#8211; Root Shell Access on:&#8217; `date` `who` | mail -s &#8220;Alert: Root Access from `who | awk &#8216;{print $6}&#8217;`&#8221; your@email.com</p>
<p>Save and exit.</p>
<p>Set an SSH Legal Message</p>
<p>To an SSH legal message, SSH into server and login as root.</p>
<p>At command prompt type:<br />
pico /etc/motd</p>
<p>Enter your message, save and exit.<br />
Note: I use the following message&#8230;</p>
<p>ALERT! You are entering a secured area! Your IP and login information<br />
have been recorded. System administration has been notified.<br />
This system is restricted to authorized access only. All activities on<br />
this system are recorded and logged. Unauthorized access will be fully<br />
investigated and reported to the appropriate law enforcement agencies.</p>
<p>=========================================<br />
More Security Measures<br />
=========================================</p>
<p>These are measures that can be taken to secure your server, with SSH access.</p>
<p>1) Update OS, Apache and CPanel to the latest stable versions.<br />
This can be done from WHM/CPanel.</p>
<p>=========================================<br />
Restrict SSH Access<br />
=========================================<br />
To restrict and secure SSH access, bind sshd to a single IP that is different than the main IP to the server, and on a different port than port 22.</p>
<p>SSH into server and login as root.<br />
Note: You can download Putty by Clicking Here (http://www.chiark.greenend.org.uk/~s&#8230;/download.html). It&#8217;s a clean running application that will not require installation on Windows-boxes.</p>
<p>At command prompt type:<br />
pico /etc/ssh/sshd_config</p>
<p>Scroll down to the section of the file that looks like this:<br />
#Port 22<br />
#Protocol 2, 1<br />
#ListenAddress 0.0.0.0<br />
#ListenAddress ::</p>
<p>Uncomment and change<br />
#Port 22<br />
to look like<br />
Port 5678 (choose your own 4 to 5 digit port number (49151 is the highest port number AND do not use 5678 lol )</p>
<p>Uncomment and change<br />
#Protocol 2, 1<br />
to look like<br />
Protocol 2</p>
<p>Uncomment and change<br />
#ListenAddress 0.0.0.0<br />
to look like<br />
ListenAddress 123.123.123.15 (use one of your own IP Addresses that has been assigned to your server)</p>
<p>Note 1: If you would like to disable direct Root Login, scroll down until you find<br />
#PermitRootLogin yes<br />
and uncomment it and make it look like<br />
PermitRootLogin no</p>
<p>Save by pressing Ctrl o on your keyboard, and then exit by pressing Ctrl x on your keyboard.</p>
<p>Note 2: You can also create a custome nameserver specifically for your new SSH IP address. Just create one called something like ssh.xyz.com or whatever. Be sure to add an A address to your zone file for the new nameserver.</p>
<p>Now restart SSH<br />
At command prompt type:<br />
/etc/rc.d/init.d/sshd restart</p>
<p>Exit out of SSH, and then re-login to SSH using the new IP or nameserver, and the new port.</p>
<p>Note: If you should have any problems, just Telnet into your server, fix the problem, then SSH in again. Telnet is a very unsecure protocol, so change your root password after you use it.</p>
<p>After SSH has been redirected, disable telnet.<br />
=========================================<br />
 Disable Telnet<br />
=========================================<br />
To disable telnet, SSH into server and login as root.<br />
At command prompt type: pico -w /etc/xinetd.d/telnet<br />
change disable = no to disable = yes<br />
Save and Exit<br />
At command prompt type: /etc/init.d/xinetd restart</p>
<p>=========================================<br />
 Disable Shell Accounts<br />
=========================================<br />
To disable any shell accounts hosted on your server SSH into server and login as root.<br />
At command prompt type: locate shell.php<br />
Also check for:<br />
locate irc<br />
locate eggdrop<br />
locate bnc<br />
locate BNC<br />
locate ptlink<br />
locate BitchX<br />
locate guardservices<br />
locate psyBNC<br />
locate .rhosts</p>
<p>Note: There will be several listings that will be OS/CPanel related. Examples are<br />
/home/cpapachebuild/buildapache/php-4.3.1/ext/ircg<br />
/usr/local/cpanel/etc/sym/eggdrop.sym<br />
/usr/local/cpanel/etc/sym/bnc.sym<br />
/usr/local/cpanel/etc/sym/psyBNC.sym<br />
/usr/local/cpanel/etc/sym/ptlink.sym<br />
/usr/lib/libncurses.so<br />
/usr/lib/libncurses.a<br />
etc.</p>
<p>=========================================<br />
Disable identification output for Apache<br />
=========================================<br />
(do this to hide version numbers from potentional hackers)</p>
<p>To disable the version output for proftp, SSH into server and login as root.<br />
At command prompt type: pico /etc/httpd/conf/httpd.conf</p>
<p>Scroll (way) down and change the following line to<br />
ServerSignature Off</p>
<p>Restart Apache<br />
At command prompt type: /etc/rc.d/init.d/httpd restart</p>
<p>=========================================<br />
Install BFD (Brute Force Detection &#8211; optional)<br />
=========================================</p>
<p>To install BFD, SSH into server and login as root.</p>
<p>At command prompt type:<br />
cd /root/<br />
wget http://www.rfxnetworks.com/downloads/bfd-current.tar.gz<br />
tar -xvzf bfd-current.tar.gz<br />
cd bfd-0.4<br />
./install.sh</p>
<p>After BFD has been installed, you need to edit the configuration file.</p>
<p>At command prompt type:<br />
pico /usr/local/bfd/conf.bfd</p>
<p>Under Enable brute force hack attempt alerts:<br />
Find<br />
ALERT_USR=&#8221;0&#8243;<br />
and change it to<br />
ALERT_USR=&#8221;1&#8243;</p>
<p>Find<br />
EMAIL_USR=&#8221;root&#8221;<br />
and change it to<br />
EMAIL_USR=&#8221;your@email.com&#8221;</p>
<p>Save the changes then exit.</p>
<p>To start BFD</p>
<p>At command prompt type:<br />
/usr/local/sbin/bfd -s</p>
<p>Modify LogWatch<br />
Logwatch is a customizable log analysis system. It parses through your system&#8217;s logs for a given period of time and creates a report analyzing areas that you specify, in as much detail as you require. Logwatch is already installed on most CPanel servers.</p>
<p>To modify LogWatch, SSH into server and login as root.</p>
<p>At command prompt type:<br />
pico -w /etc/log.d/conf/logwatch.conf</p>
<p>Scroll down to<br />
MailTo = root<br />
and change to<br />
Mailto = your@email.com<br />
Note: Set the e-mail address to an offsite account incase you get hacked.</p>
<p>Now scroll down to<br />
Detail = Low<br />
Change that to Medium, or High&#8230;<br />
Detail = 5 or Detail = 10<br />
Note: High will give you more detailed logs with all actions.</p>
<p>Save and exit.</p>
<p>A number of suggestions to improve system security. Some of this is specific to CPanel, but much can be applied to most Linux systems.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Use The Latest Software<br />
Keep the OS and 3rd party software up to date. Always!<br />
CPanel itself can be updated from the root WHM.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Change Passwords<br />
Change the root passwords at least once a month and try to make them hard to guess. Yes it&#8217;s a pain to have to keep remembering them, but it&#8217;s better than being hacked.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Set Up A More Secure SSH Environment As described here.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Disable Telnet<br />
1. Type: pico -w /etc/xinetd.d/telnet<br />
2. Change the disable = no line to disable = yes.<br />
3. Hit CTRL+X press y and then enter to save the file.<br />
4. Restart xinted with: /etc/rc.d/init.d/xinetd restart<br />
Also, add the following line to /etc/deny.hosts to flag Telnet access attempts as &#8216;emergency&#8217; messages.</p>
<p>in.telnetd : ALL : severity emerg</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Disable Unnecessary Ports (optional)<br />
First backup the file that contains your list of ports with:<br />
cp /etc/services /etc/services.original<br />
Now configure /etc/services so that it only has the ports you need in it. This will match the ports enabled in your firewall.<br />
On a typical CPanel system it would look something like this:<br />
<?php<br />
tcpmux 1/tcp # TCP port service multiplexer<br />
echo 7/tcp<br />
echo 7/udp<br />
ftp-data 20/tcp<br />
ftp 21/tcp<br />
ssh 22/tcp # SSH Remote Login Protocol<br />
smtp 25/tcp mail<br />
domain 53/tcp # name-domain server<br />
domain 53/udp<br />
http 80/tcp www www-http # WorldWideWeb HTTP<br />
pop3 110/tcp pop-3 # POP version 3<br />
imap 143/tcp imap2 # Interim Mail Access Proto v2<br />
https 443/tcp # MCom<br />
smtps 465/tcp # SMTP over SSL (TLS)<br />
syslog 514/udp<br />
rndc 953/tcp # rndc control sockets (BIND 9)<br />
rndc 953/udp # rndc control sockets (BIND 9)<br />
imaps 993/tcp # IMAP over SSL<br />
pop3s 995/tcp # POP-3 over SSL<br />
cpanel 2082/tcp<br />
cpanels 2083/tcp<br />
whm 2086/tcp<br />
whms 2087/tcp<br />
webmail 2095/tcp<br />
webmails 2096/tcp<br />
mysql 3306/tcp # MySQL<br />
?><br />
Additional ports are controlled by /etc/rpc. These aren&#8217;t generally needed, so get shot of that file with: mv /etc/rpc /etc/rpc-moved<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Watch The Logs<br />
Install something like logwatch to keep an eye on your system logs. This will extract anything &#8216;interesting&#8217; from the logs and e-mail to you on a daily basis.<br />
Logwatch can be found at: http://www.logwatch.org<br />
Install instructions here.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Avoid CPanel Demo Mode<br />
Switch it off via WHM Account Functions => Disable or Enable Demo Mode.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Jail All Users<br />
Via WHM Account Functions => Manage Shell Access => Jail All Users.<br />
Better still never allow shell access to anyone &#8211; no exceptions.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Immediate Notification Of Specific Attackers<br />
If you need immediate notification of a specific attacker (TCPWrapped services only), add the following to /etc/hosts.deny</p>
<p>ALL : nnn.nnn.nnn.nnn : spawn /bin/ &#8216;date&#8217; %c %d | mail -s&#8221;Access attempt by nnn.nnn.nnn.nnn on for hostname&#8221; notify@mydomain.com<br />
Replacing nnn.nnn.nnn.nnn with the attacker&#8217;s IP address.<br />
Replacing hostname with your hostname.<br />
Replacing notify@mydomain.com with your e-mail address.<br />
This will deny access to the attacker and e-mail the sysadmin about the access attempt.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Check Open Ports<br />
From time to time it&#8217;s worth checking which ports are open to the outside world. This can be done with:<br />
nmap -sT -O localhost<br />
If nmap isn&#8217;t installed, it can be selected from root WHM&#8217;s Install an RPM option.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Disable Compilers<br />
This will prevent hackers from compiling worms, root kits and the like on your machine.<br />
To disable them, do the following:</p>
<p>chmod 000 /usr/bin/perlcc<br />
chmod 000 /usr/bin/byacc<br />
chmod 000 /usr/bin/yacc<br />
chmod 000 /usr/bin/bcc<br />
chmod 000 /usr/bin/kgcc<br />
chmod 000 /usr/bin/cc<br />
chmod 000 /usr/bin/gcc<br />
chmod 000 /usr/bin/i386*cc<br />
chmod 000 /usr/bin/*c++<br />
chmod 000 /usr/bin/*g++<br />
chmod 000 /usr/lib/bcc /usr/lib/bcc/bcc-cc1<br />
chmod 000 /usr/i386-glibc21-linux/lib/gcc-lib/i386-redhat-linux/2.96/cc1</p>
<p>You will need to enable them again when you need to perform system updates. To do this, run:</p>
<p>chmod 755 /usr/bin/perlcc<br />
chmod 755 /usr/bin/byacc<br />
chmod 755 /usr/bin/yacc<br />
chmod 755 /usr/bin/bcc<br />
chmod 755 /usr/bin/kgcc<br />
chmod 755 /usr/bin/cc<br />
chmod 755 /usr/bin/gcc<br />
chmod 755 /usr/bin/i386*cc<br />
chmod 755 /usr/bin/*c++<br />
chmod 755 /usr/bin/*g++<br />
chmod 755 /usr/lib/bcc /usr/lib/bcc/bcc-cc1<br />
chmod 755 /usr/i386-glibc21-linux/lib/gcc-lib/i386-redhat-linux/2.96/cc1</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Obfuscate The Apache Version Number<br />
1. Type: pico /etc/httpd/conf/httpd.conf<br />
2. Change the line that begins ServerSignature to:</p>
<p>ServerSignature Off</p>
<p>3. Add a line underneath that which reads:</p>
<p>ServerTokens ProductOnly</p>
<p>4. Hit CTRL+X, they y, the enter to save the file.<br />
5. Restart Apache with: /etc/rc.d/init.d/httpd restart<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gsdesign.ro/blog/securing-your-vps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
