Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Administrator

Pages: 1 ... 3 4 [5] 6
61
This are instructions for ProFTPd, CWP dose not use ProFTPd anymore


FTP Server Error: (Error in "MLSD" command While Connecting FTP to Server)

example:
Code: [Select]
Command: PASV
Response: 227 Entering Passive Mode (SERVER_IP,235,240).
Command: MLSD

This is CSF firewall blocking passive ports and you need to whitelist your ip or change some settings

You need to add passive ports in yours ProFTPd config: /etc/proftpd.conf
Code: [Select]
PassivePorts 30000 35000
in CWP go to Security --> CSF Firewall ==> Firewall Configuration
Under TCP_IN at end of the line add port range for FTP passive ports like: ,30000:35000

example of allowed tcp passive ports from: 30000:35000
Code: [Select]
# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,2030,30000:35000"

now restart CSF firewall and you are ready to go.

More detailed info from CSF website
http://www.configserver.com/techfaq/faqlist.php?catid=6&faqid=67

62
FTP / ProFTPd can not login to FTP account
« on: December 21, 2013, 02:43:17 PM »
ProFTPd is no longer part of the CWP

If you can not login to your ProFTPd server and the server is started then you need to change/comment this option in proftpd config.

This is how this need's to look in config file: /etc/proftpd.conf
Code: [Select]
# Use pam to authenticate (default) and be authoritative
#AuthPAMConfig                  proftpd
#AuthOrder                      mod_auth_pam.c* mod_auth_unix.c

Now restart ProFTPd in CWP and test login to your user account.

63
Information / How to transfer website from cPanel server to CWP
« on: December 19, 2013, 11:32:55 PM »
How to transfer website from cPanel server to CWP (CentOS Web Panel server)?

First and most important install CWP by following this instructions:
http://centos-webpanel.com/installation

Configuration of WebPanel
- Setup nameservers (CWP *- > DNS Functions -*> Edit Nameservers IPs)
- Setup shared ip (CWP --> WebPanel Settings - -> WebPanel Settings)
- Setup at least one hosting package (CWP --> Accounts --> Add a Package)
- Setup root email (CWP --> WebPanel Settings - -> WebPanel Settings)

How to Setup NameServers?
You can setup your own nameserver but then you need to have at least two IPs or you can use FreeDNS:

You can use one of the Free DNS server providers like:

http://freedns.centos-webpanel.com/
http://freedns.afraid.org/

When you register on Free DNS providers site there you will get Nameservers that you can use for yours domains.
Nameservers you need to add in: CWP - > DNS Functions -> Edit Nameservers IPs
* This nameservers you enter here will be used in all configs and account setups


If you are using FreeDNS service than you will need to point yours domain to nameservers that you get on FreeDNS  website.
On FreeDNS Website you need to point domain to your server IP address.
This changes will need up to 24 hours to be visible for you.


Create New Account
- Accounts --> New Account
- SQL Services --> MySQL Manager (New Database & User)

Download Data from cPanel server
- Download all files from yours cPanel servers /home/username/public_html folder
- Download MySQL Database with phpMyAdmin from cPanel server

Upload Data to CWP server and import MySQL database
- with FTP or SSH uplaod all files to your CWP server in /home/username/public_html folder you created before with new account
- with phpMyAdmin on CWP import database you downloaded (with logins details of mysql user)
* You can zip .sql file and import it much faster

Edit yours config files that connects to MySQL database on CWP
eg. for wordpress /home/public_html/wp-config.php  (check: host, username, database and password)

and that is it, test your website.

If you use mod rewrite and .htaccess for your website than you will need to add this in your vhost file (change USERNAME)
/etc/httpd/conf/httpd_webpanel_vhosts.conf
Code: [Select]
<Directory "/home/USERNAME/public_html">
AllowOverride All
</Directory>
add this config beffore </VirtualHost> for your domain

64
Updates / How to update from version 0.1 and 0.2
« on: December 18, 2013, 02:35:05 AM »
In yours CWP first update yours CWP and then when you are up to date install mail server.

You must enter MySQL root password!!!
Code: [Select]
wget http://centos-webpanel.com/webpanel/main.php?dl=mail_installer_03
mv main.php?dl=mail_installer_03 mail_installer_03
chmod +x mail_installer_03
./mail_installer_03 YOUR_MYSQL_ROOT_PASSWORD

65
Updates / AutoUPDATER
« on: December 18, 2013, 02:26:50 AM »
CentOS Web Panel (CWP) Auto updater is now avaliable in all CWP installations and you can update your CWP installation easy with one click within your CWP.


66
MySQL / Another MySQL daemon already running with the same unix socket
« on: December 15, 2013, 04:14:23 AM »
Fix for error: Another MySQL daemon already running with the same unix socket.

To prevent the problem from occurring, you must perform a graceful shutdown of the server from the command line rather than powering off the server.
Code: [Select]
shutdown -h now
This will stop the running services before powering down the machine.
Based on Centos, an additional method for getting it back up again when you run into this problem is to move mysql.sock:

Code: [Select]
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
Code: [Select]
service mysqld start

67
PHP / PHP short tags do not work?
« on: December 15, 2013, 12:12:51 AM »
If you have problem that your short tags in php do not work like eg. <? and ?> you can fix this with this command: run it as root:

Code: [Select]
sed -i "s|short_open_tag = Off|short_open_tag = On|" /etc/php.ini
and restart your apache server over CentOS Web Panel (CWP) or with command:
Code: [Select]
service httpd restart

68
DNS / Free DNS services
« on: December 10, 2013, 12:05:33 AM »
If you have Dedicated server, VPS server, only one ip, you don't want or don't know how to setup DNS server than you can use free DNS services.

Tested providers
http://freedns.centos-webpanel.com/    (Free CWP DNS Manager)
http://freedns.afraid.org/

How to setup free DNS:
- You will need to point your domain to DNS servers from FreeDNS service provider you selected
eg. ns1.centos-webpanel.com, ns2.centos-webpanel.com

69
SSL / SSL certificate generator bash script
« on: December 01, 2013, 05:50:43 PM »
Here’s a handy shell script for creating SSL certs for use in things like Apache, Exim, Dovecot, etc – it can handle creating a local certificate authority to self-sign as well if you aren’t using an official CA. In typical usage one would run makekey, makecsr and send server.csr to a CA to get signed. After receiving server.crt back, run makedh and makepem to make a nice single PEM file that can be used with most software.

sslkeygen.sh
Code: [Select]
#!/bin/sh
 
if [ $# -lt 2 ]; then
  echo "This script takes 2 params"
  echo
  echo "$0 <mode> <key filename>"
  echo
  exit 1
fi
 
SERVER=$2
 
case "$1" in
  makeca)
    /usr/bin/openssl genrsa -des3 -out ca.key 4096
    /usr/bin/openssl req -new -x509 -days 1825 -key ca.key -out ca.crt
    ;;
  makekey)
    /usr/bin/openssl genrsa -des3 2048 > ${SERVER}.key.encrypted
    /usr/bin/openssl rsa -in ${SERVER}.key.encrypted -out ${SERVER}.key
    ;;
  makecsr)
    if [ ! -f ${SERVER}.key ]; then
      echo "${SERVER}.key missing, run \"$0 makekey\" first."
      exit 1
    fi
    /usr/bin/openssl req -new -key ${SERVER}.key -out ${SERVER}.csr
    ;;
  signcrt)
    if [ ! -f ca.key ] || [ ! -f ca.crt ]; then
      echo "ca.key missing, run \"$0 makeca\" first."
      exit 1
    fi
    if [ ! -f ${SERVER}.csr ]; then
      echo "${SERVER}.csr missing, run \"$0 makecsr\" first."
      exit 1
    fi
    /usr/bin/openssl x509 -req -days 1825 -in ${SERVER}.csr -CA ca.crt \
      -CAkey ca.key -set_serial 01 -out ${SERVER}.crt
    ;;
  makedh)
    /bin/dd if=/dev/urandom of=ssldh.rand count=1 2>/dev/null
    /usr/bin/openssl gendh -rand ssldh.rand 512 > ${SERVER}.dh
    ;;
  makepem)
    if [ ! -f ${SERVER}.key ]; then
      echo "${SERVER}.key missing, run \"$0 makekey\" first."
      exit 1
    fi
    if [ ! -f ${SERVER}.crt ]; then
      echo "${SERVER}.crt missing, obtain from CA or run \"$0 signcrt\" first."
      exit 1
    fi
    cat ${SERVER}.key > ${SERVER}.pem
    cat ${SERVER}.crt >> ${SERVER}.pem
    ;;
  *)
    echo
    echo $"Usage: $0 {makeca|makekey|makecsr|signcrt|makedh|makepem} <key filename>"
    echo
    exit 2
esac
 
exit 0

source:
http://tacticalvim.wordpress.com/2010/06/20/sslkeygen-sh-complete-ssl-cert-creation-helper-script/


One more even better script
gencert.sh
Code: [Select]
#!/bin/bash
 
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
 
# Script accepts a single argument, the fqdn for the cert
DOMAIN="$1"
if [ -z "$DOMAIN" ]; then
echo "Usage: $(basename $0) <domain>"
exit 11
fi
 
fail_if_error() {
[ $1 != 0 ] && {
unset PASSPHRASE
exit 10
}
}
 
# Generate a passphrase
export PASSPHRASE=$(head -c 500 /dev/urandom | tr -dc a-z0-9A-Z | head -c 128; echo)
 
# Certificate details; replace items in angle brackets with your own info
subj="
C=<COUNTRY>
ST=<STATE>
O=<COMPANY_NAME>
localityName=<CITY>
commonName=$DOMAIN
organizationalUnitName=<DEPARTMENT_NAME>
emailAddress=<ADMIN_EMAIL>
"
 
# Generate the server private key
openssl genrsa -des3 -out $DOMAIN.key -passout env:PASSPHRASE 2048
fail_if_error $?
 
# Generate the CSR
openssl req \
-new \
-batch \
-subj "$(echo -n "$subj" | tr "\n" "/")" \
-key $DOMAIN.key \
-out $DOMAIN.csr \
-passin env:PASSPHRASE
fail_if_error $?
cp $DOMAIN.key $DOMAIN.key.org
fail_if_error $?
 
# Strip the password so we don't have to type it every time we restart Apache
openssl rsa -in $DOMAIN.key.org -out $DOMAIN.key -passin env:PASSPHRASE
fail_if_error $?
 
# Generate the cert (good for 10 years)
openssl x509 -req -days 3650 -in $DOMAIN.csr -signkey $DOMAIN.key -out $DOMAIN.crt
fail_if_error $?

source:
https://gist.github.com/bradland/1690807

70
Addons / Team Speak 3 - Manager
« on: November 13, 2013, 10:08:46 PM »
TeamSpeak3 control panel module


We don't support TeamSpeak anymore and we also don't recommend others to use it.
Reason: If you get late with the payment you could get a penalty of $100 or more.


Now you can easily install TeamSpeak3 server with one click in CentOS WebPanel.

TeamSpeak3 control panel Features
- install & delete server (with one click)
- start, stop, restart & check teamspeak3 server status (with one click)
- display query admin login details and token (encrypted data for security)

How to install and start TS3 server?
Check that you do not have ts3 user installed on your linux system as TeamSpeak3 server creates ts3 user and runs server under ts3 username.
1. Click on install TeamSpeak3 server button
2. Click on start TeamSpeak3 server button
3. After you started Team Speak 3 server you can click on Check Admin Data button to get admin login details
*Admin login details are encrypted for security but they are all the time available by clicking on Check Admin Data button.

How to delete TeamSpeak3 server and ts3 user?
1. Click on Stop TeamSpeak 3 server button.
2. Click on Delete Team Speak 3 server button.
*this will delete server files and remove ts3 user from the server.


How to Team Speak3 module to CentOS-WebPanel menu?
It’s easy, go to include folder and make new file named 3rdparty.php ,in this file you add links one per line.
eg.
<a href="index.php?module=ts3_manager">TS3 Manager</a>

Files are included in installations from version 0.2


71
Information / Version 0.2 BUG
« on: November 13, 2013, 09:58:34 PM »
Version 0.2 has litle mistake it's displays as version 0.1, this problem will be fixed with version 0.3

Version 0.3 is expected to be published at 01/12/2013.
Upgrade option will be avaliable in your Control Panel when new version is released.

CRON Bug
Cron Autoupdate and Backups don't works in version 0.1 - 0.2 you need to chmod +x cron file
chmod +x /etc/cron.daily/webpanel

72
DNS / Securing BIND with DNSSEC on EL6 and bind 9
« on: November 07, 2013, 08:40:15 PM »
How to Secure BIND with DNSSEC on EL6 ( CentOS 6 )

https://www.crc.id.au/configuring-dnssec-on-el6-and-bind-9/

73
DNS / securing DNS server BIND (open DNS resolver)
« on: November 06, 2013, 09:27:44 PM »
Simple way to secure dns server using one line comand.
Code: [Select]
sed -i 's/recursion yes/recursion no/g' /etc/named.conf



Bind 9.x Authoritative

For BIND 9.x authoritative servers, apply the following global options, config file /etc/named.conf :

Code: [Select]
  options {
      recursion no;
      additional-from-cache no;
  };



Bind 9.x Caching

For BIND 9.x caching servers, additionally create access control lists and use "views" to explicitly permit a limited set of source addresses from your trusted network issue queries to your caching server:

Code: [Select]
  # example only, replace 192.0.2.0/24 a list of your CIDR blocks
  acl "trusted" {
      192.0.2.0/24;
  };

  options {
      recursion no;
      additional-from-cache no;
      allow-query { none; };
  };

  view "trusted" in {
      match-clients { trusted; };
      allow-query { trusted; };
      recursion yes;
      additional-from-cache yes;
  };

74
E-Mail / How to track and stop outgoing SPAM?
« on: November 01, 2013, 08:50:06 PM »
How to track and stop outgoing SPAM?

For outgoing mail you can track it with this script
save file as: spam_track.sh
Code: [Select]
while true
do
    sudo lsof -i | grep smtp
    sleep 5
done
run script: sh spam_track.sh



If you find that spam sender is php user than you can track this user and PHP SPAM file location with script
save file as: php_spam_track.sh
Code: [Select]
while true
do
    ps -aux|grep USERNAME
    sleep 1
done
don't forget to replace USERNAME in script with username you think sends spam!
run script: php_spam_track.sh


Check posible spam files
Download script
wget http://cbl.abuseat.org/findbot.pl

Run script
perl findbot.pl FOLDER_LOCATION

eg. perl findbot.pl /home/testuser1/public_html

75
Installation / How do I create a new domain account in CentOS Web Panel ?
« on: November 01, 2013, 03:03:09 AM »
How do I create a new domain account in CentOS Web Panel ?

You need to have installed CentOS Web Panel!

Configuration of WebPanel
When you login for the first time in CentOS WebPanel you need to set some settings in Web Interface.
- Setup nameservers (ns1 & ns2 with IPs)
- Setup shared ip (this ip is used for domains)
- Setup at least one hosting package (eg. default)
- Setup root email
& now you are ready to host domains…

If you have set shared ip, nameservers and at least one hosting package now you can create new domain account with CentOS Web Panel.

Adding new Domain Account
go to Accounts in left menu --> New Account
- Enter Domain name (eg. mydomain.com)
- Enter username  (make it similar to domain eg. mydomain)
- Copy random generated password from CentOS Web Panel to safe place or set your password
- Select Package you created previously
- Setup domain/account owner email address
& Click on button Create

That is it! your domain is active & online.

Don't forget that you need to setup nameservers for your domain to work!
   

Pages: 1 ... 3 4 [5] 6