hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Cpanel Server Tweaks?
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Cpanel Server Tweaks?

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-02-2011, 02:26 PM
The Calling The Calling is offline
Web Hosting Guru
 
Join Date: Sep 2010
Posts: 319

Cpanel Server Tweaks?


Can someone suggest performance tweaks (and security) for a cpanel hosting environment (shared and reseller mixed)?

I'm running:

Centos 6 64bit
MySQL 5.1
Cpanel 11
PHP 5.3
Apache 2.2

Thanks.

Reply With Quote


Sponsored Links
  #2  
Old 11-02-2011, 02:43 PM
Lee-RackSRV Lee-RackSRV is offline
WHT Addict
 
Join Date: Jul 2011
Location: Sittingbourne, Kent, UK
Posts: 165
echo "root: your@emailaddress.com" >> /etc/aliases; newaliases;

Will help with CSF / LFD notifications re: security / intrusion detection notifications.

__________________
RackSRV Communications Limited
UK specialists in Dedicated Servers & Server Colocation
Company: 06856870 VAT: GB 934 7073 15 Tel: 0330 111 4444

Reply With Quote
  #3  
Old 11-02-2011, 03:01 PM
The Calling The Calling is offline
Web Hosting Guru
 
Join Date: Sep 2010
Posts: 319
root@server [~]# echo "root: me@domain.com" >> /etc/aliases; newaliases;
-bash: newaliases: command not found

Reply With Quote
Sponsored Links
  #4  
Old 11-02-2011, 03:08 PM
Lee-RackSRV Lee-RackSRV is offline
WHT Addict
 
Join Date: Jul 2011
Location: Sittingbourne, Kent, UK
Posts: 165
Should be fine then, try logging in via SSH with CSF/LFD enabled, it may just be Fedora that requires the newaliases command :-)

__________________
RackSRV Communications Limited
UK specialists in Dedicated Servers & Server Colocation
Company: 06856870 VAT: GB 934 7073 15 Tel: 0330 111 4444

Reply With Quote
  #5  
Old 11-03-2011, 03:30 AM
HostAdmins HostAdmins is offline
Aspiring Evangelist
 
Join Date: Jan 2011
Posts: 371
Do you have SSH access as root to this servers or only cPanel account access ?

Reply With Quote
  #6  
Old 11-03-2011, 08:12 AM
Lee-RackSRV Lee-RackSRV is offline
WHT Addict
 
Join Date: Jul 2011
Location: Sittingbourne, Kent, UK
Posts: 165
If the command is still missing it's as postfix isnt installed / started, had to check this morning :-D

__________________
RackSRV Communications Limited
UK specialists in Dedicated Servers & Server Colocation
Company: 06856870 VAT: GB 934 7073 15 Tel: 0330 111 4444

Reply With Quote
  #7  
Old 11-03-2011, 09:43 AM
linux-tech linux-tech is offline
<?require_once("life")?>
 
Join Date: Sep 2002
Location: inside your network
Posts: 9,548
Quote:
Originally Posted by Lee-RackSRV View Post
echo "root: your@emailaddress.com" >> /etc/aliases; newaliases;

Will help with CSF / LFD notifications re: security / intrusion detection notifications.
or just
Code:
echo youraddress@domain.com >> /root/.forward
much less fuss . No worries about the newaliases command
You'll also want to recompile php/apache with suhosin/mod_security/phpsuexec and add csf/lfd and grab their modsec stuff (for whm) if you don't know what you're doing there

When it comes to modsec rules, you should probably take a look here. They have a free (delayed) ruleset that usually works well enough

__________________
Linux Tech Networks Reliable, Affordable Linux administration and monitoring since 2002

Reply With Quote
  #8  
Old 11-03-2011, 10:00 AM
fshagan fshagan is offline
Web Hosting Master
 
Join Date: Jun 2003
Location: California
Posts: 2,478
Quote:
Originally Posted by The Calling View Post
Can someone suggest performance tweaks (and security) for a cpanel hosting environment (shared and reseller mixed)?

I'm running:

Centos 6 64bit
MySQL 5.1
Cpanel 11
PHP 5.3
Apache 2.2

Thanks.
I've found performance and security to be at odds, sometimes. But since you mention both, I will give you just the performance tips that don't jeopardize security (as far as I know!) and security tips I've used that don't seem to impact performance.

If you host a database driven site using MySQL, you can improve the performance of MySQL by adding cache. I use a script called mysqltuner.pl for this:

Code:
wget mysqltuner.pl
chmod 755 mysqltuner.pl
./mysqltuner.pl
MySQL should have been running for 24 - 48 hours before running mysqltuner so there's enough history for it to evaluate. It will give you a number of recommendations, including the admonition to increase some settings gradually (especially table_cache). This is important, as you can cause data corruption with incorrect settings.

It's a good idea to backup all your MySQL databases before you start tweaking the config file.

On my cPanel VPS, the configuration file for MySQL is at /etc/my.cnf. It is empty because the default configuration is someplace else. Any values you add will overwrite the cPanel default values. I set the values either "4" higher (in the case of table_cache), or 8 to 16 higher (some values are in KB, some in MB, and some are not specified as memory allocations, such as table_cache).

After setting the values, restart MySQL ("/etc/init.d/mysqld restart") and let it run for 24 - 48 hours. If MySQL refuses to restart, you probably have a typo in your my.cnf file. Not specifying the memory "M" for instance, or including a memory allocation when there is none for that setting). After running for 24 - 48 hours, log back in and run ./mysqltuner.pl and see what it recommends.

For security, I like the CSF / LFD product from http://configserver.com ... a free firewall that provides a UI in WHM after installation. Check out their site for the installation instructions for a cPanel server. It includes a "security audit" feature that gives some recommendations.

I recently bought their ConfigServer eXploit Scanner (cxs) product and like it very much; it enables you to scan for suspicious files using pre-configured "fingerprints" or profiles you create yourself. For instance, after seeing a "new to me" javascript redirect exploit that used hacked .htaccess files to append a file to each file served by the web server, I have it looking for "auto_append_file" ... a command I know I would never use. It's $50, one time.

rkhunter (root kit hunter) and chrootkit are similar scanning scripts that can scan for rootkits. I have rkhunter installed so far, and on a cPanel server, you need to edit the config file to allow some commands to be run as scripts, allow some hidden files, and ignore certain files (it will flag /usr/share/man/man1/..1.gz, for instance). The commands are already in the config file; you just have to un-comment them.

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tweaks & Security Tips (cPanel / Centos) The Calling Hosting Security and Technology 5 04-01-2011 01:09 PM
Game Server Setup/Tweaks vpncast Systems Management Offers 5 12-02-2007 10:48 PM
Need Security tweaks on Server Asif_Mustfa Systems Management Requests 4 08-05-2007 10:31 PM
Server tweaks? Who should I hire? v12kid Dedicated Server 5 04-27-2006 05:26 PM
server tweaks clocker1996 Hosting Security and Technology 9 03-24-2002 09:22 AM

Related posts from TheWhir.com
Title Type Date Posted
Hosting Control Panel cPanel & WHM 11.34 Release Hits Stable Tier Web Hosting News 2012-11-12 17:04:57
Video: cPanel and Attracta Talk About Integrating SEO Tools into the Hosting Control Panel Whir Tv 2012-08-31 14:10:47
Control Panel cPanel Launches New Apache Configuration Script Web Hosting News 2011-12-28 19:41:39
cPanel Offers Windows Hosting Control Panel Enkompass for Free Web Hosting News 2011-10-13 17:14:16
cPanel to Launch Certification Program at cPanel Conference 2011 Web Hosting News 2011-09-21 18:15:42


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?