New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

How to Secure CWP webserver

Started by tshetumd, April 18, 2016, 07:52:53 AM

Previous topic - Next topic

alafurtanfuni

#15
This is my ssl configuration for cwp


Listen 2031
<VirtualHost cp.domain.com:2031>
        ServerName cp.domain.com
        SSLEngine on
        SSLCertificateKeyFile /etc/pki/tls/certs/cp.domain.com.key
        SSLCertificateFile /etc/pki/tls/certs/cp.domain.com.cert
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>


By the way, 2030 and 2031 ports are work without ssl (via http)

Sandeep

#16
their is no virtual entry for your server ip create one

with your server ip:2031

and with certs

devnull

Quote from: tshetumd on April 18, 2016, 07:52:53 AM
My cwp webserver is getting hacked , can somebody guide me to make it more secure. Thanks


Also install maldet together (for speeding the scan up with clamscan) see https://www.rfxn.com/projects/linux-malware-detect/
and schedule a regular scan through cron.
It can help you find malware . It does not find everything but can be helpful.

(edit) I believe clamscan is already installed on CWP panels.

alafurtanfuni

Quote from: Sandeep on April 20, 2016, 05:52:19 PM
their is no virtual entry for your server ip create one

with your server ip:2031

and with certs

I changed cp.domain.com to the private ip (not the public ip).
It's work great! Thank you.

tshetumd

 I have installed letsencrypt on cwp and here is my  /usr/local/apache/conf.d/vhosts-ssl.conf

ServerName tshetum.bt
ServerAlias www.tshetum.bt
DocumentRoot /home/tshetumb/public_html
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/tshetum.bt.cert
SSLCertificateKeyFile /etc/pki/tls/private/tshetum.bt.key
SSLCertificateChainFile /etc/pki/tls/certs/tshetum.bt.bundle
<IfModule mod_suexec.c>
    SuexecUserGroup tshetumb tshetumb
</IfModule>

<IfModule mod_suphp.c>
    suPHP_UserGroup tshetumb tshetumb
    suPHP_ConfigPath /home/tshetumb
</IfModule>

<Directory "/home/tshetumb/public_html">
    AllowOverride All
</Directory>

And when  I open my domain as https://tshetum.bt , its not working , please help


Thanks

Sandeep

#20
add Port : listen 443

add the ip :

<VirtualHost x.x.x.x:443>

tshetumd

i did that too...

# vhost_start tshetum.bt
<VirtualHost 202.144.128.217:443>

Igor S.

Hello.

Try to add
Listen 443
NameVirtualHost 202.144.128.217:443



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

tshetumd

#23
Thanks, it worked ..

tshetumd

I am getting following while restarting the mysql, please help me :


Warning: Error while sending SET_OPTION packet. PID=1229 in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php(1) : eval()'d code(1) : eval()'d code on line 5
MySQL server has gone away
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php(1) : eval()'d code(1) : eval()'d code on line 5


Thanks

Sandeep

what version of mysql you're running ?

tshetumd

mysql version is 5.1.73

and moreover I am getting following error while using mod Security :

Forbidden

You don't have permission to access /phpMyAdmin/import.php on this server.

Sandeep

#27
do you know about mariadb ?

Mariadb have all the functions of mysql and easy to manage as mysql commands

ModSecurity :
check the error log file and white list the ID

tshetumd

yes i did hear but i didn't use so far.

can you guide me how go about the mod security white listing .


Thanks

Sandeep

when you're restarting mysql from cwp GUI then the error code is normal just ignore it

Modsecurity :
http://forum.centos-webpanel.com/mod_security/mod_security-config/