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 - darkness

Pages: 1 [2]
16
Installation / After a fresh install on minimal CentOS 6.8 I get ...
« on: April 03, 2017, 08:49:11 AM »
This page isn’t working

192.168.32.38 is currently unable to handle this request.
HTTP ERROR 500
Why? Where? How?

17
Scripts / Not a bad MOTD script
« on: April 02, 2017, 07:13:09 PM »
First of all to install few things needed for the script (mostly needed if you have minimal install):
Code: [Select]
yum -y install bc lm_sensorsThis script was made very long time ago for one of my FreeBSD servers. Now it`s changed a bit with added functions.
Now the script:
Code: [Select]
#!/bin/bash
#Server Status Script
#https://www.born2host.com
#CPU info
cpumodel=`cat /proc/cpuinfo | head -20 | grep "model name"| awk '{print $4, $5, $6, $7, $8, $10 }'`
core0=`sensors -u | head -11 |grep "temp1_input"| awk '{print $2 }' |awk '{printf("%d\n",$1 + 0.5);}'`
core1=`sensors -u | head -20 |grep "temp2_input"| awk '{print $2 }' |awk '{printf("%d\n",$1 + 0.5);}'`
core2=`sensors -u | head -30 |grep "temp3_input"| awk '{print $2 }' |awk '{printf("%d\n",$1 + 0.5);}'`
core3=`sensors -u | head -40 |grep "temp4_input"| awk '{print $2 }' |awk '{printf("%d\n",$1 + 0.5);}'`
Load1=`cat /proc/loadavg | awk {'print $1'}`
Load5=`cat /proc/loadavg | awk {'print $2'}`
Load15=`cat /proc/loadavg | awk {'print $3'}`
#Users info
user=`whoami`
psa=`ps -Afl | wc -l`
psu=`ps U $user h | wc -l`
#System update need
yum=`yum list updates -q | grep -vc "Updated Packages"`
#Uptime
btime=`last -x | grep reboot | tail -n 1 | awk '{print $1, $2, $6, $7, $8}'`
uptime=`cat /proc/uptime | cut -f1 -d.`
upDays=$((uptime/60/60/24))
upHours=$((uptime/60/60%24))
upMins=$((uptime/60%60))
upSecs=$((uptime%60))
#RAM
mfr=`free -m | head -n 2 | tail -n 1 | awk {'print $4'}`
mfc=`free -m | head -n 3 | tail -n 1 | awk {'print $3'}`
mtc=`free -m | head -n 2 | tail -n 1 | awk {'print $2'}`
swap=`free -m | tail -n 1 | awk {'print $3'}`
#Disk
raid=`cat /proc/mdstat |grep Personalities`
disk=`df -h | awk '{ a = $4 } END { print a }'`
echo -e "
                       \e[96mSystem Server Status
   
\e[39m- \e[31mServer Name                  \e[35m= \e[92m`hostname`
\e[39m- \e[31mPublic IP                    \e[35m= \e[92m`dig +short myip.opendns.com @resolver1.opendns.com`
\e[39m- \e[31mOS Version                   \e[35m= \e[92m`cat /etc/redhat-release`
\e[39m- \e[31mPlatform                     \e[35m= \e[92m`uname -orpi`
\e[39m- \e[31mCPU model                    \e[35m= \e[92m$cpumodel
\e[39m- \e[31mCPU Usage                    \e[35m= \e[92m$Load1 (1 min) \e[93m>> \e[92m$Load5 (5 min) \e[93m>> \e[92m$Load15 (15 min)
\e[39m- \e[31mUsers logged                 \e[35m= \e[92mCurrently `users | wc -w` users logged on
\e[39m- \e[31mCurrent user                 \e[35m= \e[92m$user
\e[39m- \e[31mSystem boot                  \e[35m= \e[92m$btime
\e[39m- \e[31mSystem Uptime                \e[35m= \e[92m$upDays days $upHours hours $upMins minutes $upSecs seconds
\e[39m- \e[31mSystem Update                \e[35m= \e[31m$yum \e[92mpackages can be updated
\e[39m- \e[31mTotal Memory(RAM)           \e[35m= \e[92m$mtc Mb
\e[39m- \e[31mMemory free (real)           \e[35m= \e[92m$mfr Mb
\e[39m- \e[31mMemory free (cache)          \e[35m= \e[92m$mfc Mb
\e[39m- \e[31mSwap in use                  \e[35m= \e[92m$swap Mb
\e[39m- \e[31mProcesses                    \e[35m= \e[92mYou are running $psu of $psa processes
\e[39m- \e[31mRAID                         \e[35m= \e[92m$raid
\e[39m- \e[31mDisk Space Used              \e[35m= \e[92m$disk
\e[39m- \e[31mCPU Temperature              \e[35m= \e[92mCore1 $core0 °C ; Core2 $core1 °C ; Core3 $core2 °C ; Core4 $core3 °C ;
\e[39m
" > /etc/motd
#exit 0
The script will put all the information in /etc/motd and it`s a good idea to put that script in your crontab to run every 1 hour for example(if you want every 5min).
After you run the script you can relog to your server or "cat /etc/motd" to see the output. Should be something similar to this:
Code: [Select]
[root@srv1 ~]# cat /etc/motd

                       System Server Status

- Server Name                  = srv1.born2host.com
- Public IP                        = 77.236.172.141
- OS Version                     = CentOS release 6.8 (Final)
- Platform                        = 2.6.32-642.11.1.el6.x86_64 x86_64 x86_64 GNU/Linux
- CPU model                     = Intel(R) Core(TM)2 Duo CPU T8100 2.10GHz
- CPU Usage                     = 0.14 (1 min) >> 0.04 (5 min) >> 0.01 (15 min)
- Users logged                  = Currently 1 users logged on
- Current user                   = root
- System boot                   = reboot system Dec 17 11:29
- System Uptime               = 106 days 8 hours 16 minutes 47 seconds
- System Update               = 0 packages can be updated
- Total Ram                      = 2886 Mb
- Memory free (real)         = 272 Mb
- Memory free (cache)       = 1716 Mb
- Swap in use                   = 264 Mb
- Processes                      = You are running 113 of 140 processes
- RAID                             = Personalities :
- Disk Space Used             = 1%
- CPU Temperature            = Core1 33 °C ; Core2  °C ; Core3  °C ; Core4  °C ;

[root@srv1 ~]#
I hope you like it.

18
I can build it / OpenVZ with CWP
« on: March 12, 2017, 03:54:42 PM »
Hello people,
As for now that you can use CWP just for shared hosting I decided to create a module for OpenVZ with some functions:
Admin Panel:
1. Install OpenVZ on your system (keep in mind that installing OpenVZ requires reboot for new kernel!!!)
2. Create containers
3. Set IPv4 & IPv6 to the containers
User Panel:
1. Boot container
2. Shutdown container
3. Reboot container
4. Reinstall container
5. SSH Console to the container through CWP
6. Change hostname
7. Change root password
I will also try to make a module where you add more servers and you create/delete containers through just 1 main CWP.
I also have plan to make the same for KVM and Xen, but I`m still waiting for 2x Dell PowerEdge 1950 and 1x Dell PowerEdge 2950(I know they are old rigs, but are good for testing) from UK and for the moment I have a free server which supports only OpenVZ.
All the scripts/modules will be provided for FREE FOREVER from me, but ionCube crypted. Some people will say "I want open source". I don`t agree with that since I saw a post in the forum that somebody want to change the logo of CWP and I don`t like that when somebody is offering something good to you for free you want to change logo/copyright to sign it on your name.I will provide my full source code unencrypted to CWP developers if they want to improve it or add it to a new version(I know that my way of writing PHP code sux, so may be they will rewrite it full, but ... ).
If you have any ideas what else can be added for OpenVZ I will be happy if you share them with me.
Thank you for reading and wait for the first release.

19
I can build it / IPv6 configuration for CentOS 6.8 (Final)
« on: March 09, 2017, 10:20:44 PM »
Ok guys,
Here`s something I`d like to share with you. It`s an IPv6 configuration script for CentOS 6.8 (Final) to make it easy to have IPv6 tunnel on your server. At the moment this is version 0.1 which can only add the IPv6 tunnel configuration to your already running CentOS server. As a first version it`s simple and fast, also has it`s bad sides like: after every reboot you need to run the script again to re-config your IPv6. But this is what I did in 15min with 39 degs temp. In the next version I`m planning to include ping to ipv6.google.com through the script, adding IPv6 addresses through it. In version 0.3 or 0.4 I`ll try to make it able to config your web server, email server, DNS forward and reverse. Just I need time because I`m very busy and atm I`m a bit sick.
Ok, stop fooling you around.
1. Download the script from http://www.born2host.com/born2host.zip and put it in /usr/local/cwpsrv/htdocs/resources/admin/modules
2. Unzip it with "unzip born2host.zip"
3. Open /usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php and add:
3.1 <li><a href="index.php?module=born2host_ipv6"><span class="icon16 icomoon-icon-arrow-right-3"></span>IPv6 Configuration</a></li>
4. Create account in http://www.tunnelbroker.net
5. Log in to your account in tunnelbroker.net
6. Go to User Functions -> Create Regular Tunnel
7. Enter the IPv4 address of the server(your CentOS 6.8 server)
8. Choose one of the available tunnel servers (ping the all one by one and choose the one with less time=... ms)
9. Click on your tunnel to open Tunnel Details
10. Login with root to your CWP and head up to Developer Menu -> IPv6 Configuration
11. From Tunnel Details grab "Server IPv4 Address:" which is normally 216.66.87.14 and paste it in the script in the field called "Please provide your tunnel broker IPv4:   "
12. From Tunnel Details grab "Client IPv6 Address: " which normally starts with 2001:470:xxxx:xx::2/64 (don`t forget to copy it with the /64) and paste it in the script in the field called "Please provide your IPv6 tunnel:"
13. Press "Add IPv6" button
14. Login through SSH to your CentOS server and type: ping6 -c 5 ipv6.google.com If everything is ok you will see something similar to this:
Code: [Select]
[root@msi ~]# ping6 -c 5 ipv6.google.com
PING ipv6.google.com(waw02s05-in-x0e.1e100.net) 56 data bytes
64 bytes from waw02s05-in-x0e.1e100.net: icmp_seq=1 ttl=57 time=62.3 ms
64 bytes from waw02s05-in-x0e.1e100.net: icmp_seq=2 ttl=57 time=63.1 ms
64 bytes from waw02s05-in-x0e.1e100.net: icmp_seq=3 ttl=57 time=61.7 ms
64 bytes from waw02s05-in-x0e.1e100.net: icmp_seq=4 ttl=57 time=61.0 ms
64 bytes from waw02s05-in-x0e.1e100.net: icmp_seq=5 ttl=57 time=63.1 ms

--- ipv6.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4068ms
rtt min/avg/max/mdev = 61.079/62.302/63.156/0.796 ms
[root@msi ~]#
If you see something similar to this you are done and have fun.
If you have any problems activating IPv6 tunnel support feel free to ask(may be you don`t have IPv6 support enabled on your server or something else).
<- check this picture just in case to be sure what to copy and paste from tunnelbroker.net to the script.

Oh yeah. By the way the script is encoded with ionCube Encoder for PHP 5.6.x

20
E-Mail / How to install Horde Webmail
« on: December 17, 2016, 12:05:01 AM »
Here`s how I installed my Horde Webmail. I assume that you already have CWP with Apache, PHP and MySQL.
1. Register Horde PEAR channel:
   pear channel-discover pear.horde.org
2. Set Horde installation directory:
  cd /usr/local/apache/htdocs
  pear install horde/horde_role
  pear run-scripts horde/horde_role
3. Install Horde Groupware Webmail Edition:
  pear install -a -B horde/webmail
4. Run installation script:
  webmail-install
5. Test Horde Groupware Webmail Edition:
  cd /usr/local/apache/htdocs/horde/config/
  nano -w conf.php
  find
Code: [Select]
$conf['testdisable'] = true; and change it to
Code: [Select]
$conf['testdisable'] = false;6. Making it visible
  Go to CWP -> Apache Settings -> Apache Include Conf -> domain-redirects.conf
  Add this line at the end of the file:
Code: [Select]
Alias /horde /usr/local/apache/htdocs/horde  Save and restart Apache
7. Check if everything is ok
  Go to http://your_ip/horde/test.php or http://your_domain/horde/test.php
  If you see everything in green than you are ok. Change back to $conf['testdisable'] = true; and enjoy your new horde webmail.
  If you see something in red install/fix it. Check test.php again until you see everything in green.

When you`re ready with all the stuff in test.php DON`T FORGET to edit again /usr/local/apache/htdocs/horde/config/conf.php and set $conf['testdisable'] = true;
Hope this helps. I`ll try to answer all the questions if you have any.
 

21
DNS / DNS/Bind Working Conf & Zones
« on: December 16, 2016, 11:43:59 PM »
I want to share with my working DNS conf & zones and I will try to explain:
First file is /etc/named.conf
Code: [Select]
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a any DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
        version "Your mom`s version is too old!"; // Good to set something here different from the real version for security
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query     { any; };
allow-transfer  { any; };
allow-recursion { any; };
dnssec-enable yes;
dnssec-validation yes;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
// Reverse zone
zone "172.236.77.in-addr.arpa" in{
type master;
file "/var/named/172.236.77.in-addr.arpa.db";
allow-update { none; };
};
// Reverse zone for localhost
zone "0.0.127.in-addr.arpa" in{
type master;
file "/var/named/0.0.127.in-addr.arpa.db";
};
// Forwarding zone
// zone devilix.org
zone "devilix.org" in{
type master;
file "/var/named/devilix.org.db";
};
// zone_end devilix.org

Second file is /var/named/devilix.org.db
To generate easy your DMARC record go to https://www.unlocktheinbox.com/dmarcwizard/
To generate Google Verification Code in TXT for your DNS go to https://support.google.com/a/answer/183895?hl=en&ref_topic=2716886 and follow the instructions
Code: [Select]
$TTL   14400 // TTL - Time To Live
@        IN      SOA     ns1.abusers.eu. root.devilix.org. ( // ns1.abusers.eu - your main DNS server(this one), root.devilix.org - DNS Server owner/admin
                2016121201      ; serial, todays date+todays // Serial number - YYYYmmddcn - Year(2016)Month(12)Day(12)ChangeNumber(01)
                86400           ; refresh, seconds
                7200            ; retry, seconds
               3600000         ; expire, seconds
               86400 )         ; minimum, seconds
;; NS Records (All this name servers resolve to the same IP address - 77.236.172.141, except ns1.devilix.org)
@ IN NS ns1.abusers.eu. // DNS 1
@ IN NS ns2.abusers.eu. // DNS 2
@ IN NS ns1.devilix.org. // DNS 3
@ IN NS ns2.devilix.org. // DNS 4
@ IN NS dev.abusers.eu. // DNS 5
@ IN NS devil.abusers.eu. // DNS 6
@ IN NS devilix.abusers.eu. // DNS 7
;; A Records // Forwards
@ IN A 77.236.172.141 // Forward devilix.org to 77.236.172.141
ns1 IN A 127.0.0.1 // Forward ns1.devilix.org to 127.0.0.1/localhost
ns2 IN A 77.236.172.141
server IN A 77.236.172.141
mail IN A 77.236.172.141
localhost IN A 127.0.0.1
;; PTR Records // Reverse record (not 100% sure if it`s needed in this file)
77.236.172.141 IN PTR devilix.org.
;; MX Records // Mail eXchange (needed for your Mail Server)
devilix.org. IN MX 10 mail.devilix.org.
;; CNAME Records // Canonical Names(@ is the same like devilix.org but @ is more short)
www IN CNAME @
ftp IN CNAME @
cwp IN CNAME @
;; DMARC Records // Needed for your Mail Server.
_dmarc.devilix.org. IN TXT "v=DMARC1; p=none; sp=none; rua=mailto:postmaster@devilix.org; ruf=mailto:postmaster@devilix.org; rf=afrf; pct=100; ri=86400"
;; DKIM Records // Needed for your Mail Server. Can generate from CWP -> Email -> DKIM Manager(Select SPF also)
default._domainkey IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7A+Opw3Jll87M9ZoevC+UOBwSkbrOSrgSgk3OabrKF7dMshoMDf0LHcS5Zwj/I4eiMTj7vtkoavHAhgW/0/GmH7fyNgKQm942NpvKcLEHTJ1ndDNk0luvXS+E0Rw6wiCyAKwj/LCbZcidhgz1iVn53VZTQCAiMj1V+q3z5ADPIQIDAQAB"
;; SPF Records
devilix.org. IN TXT "v=spf1 +a +mx +ip4:192.168.1.101 ~all"
;; Google Verification // Needed for your Mail Server.
@ IN TXT google-site-verification=_C1V8AhaVWFwNQn4fO5Id7IXbQTgcC67ItmH9r4SABY
Third file is /var/named/0.0.127.in-addr.arpa.db
Code: [Select]
$TTL 3D
@               IN      SOA     ns1.devilix.org. root.devilix.org. (
                                2016111300  ; Serial
                                8H      ; Refresh
                                2H      ; Retry
                                4W      ; Expire
                                1D)     ; Minimum TTL

@    IN   NS      ns1.devilix.org. // Remember that ns1.devilix.org resolves to 127.0.0.1/localhost
1      IN   PTR    localhost.
0.0.127.in-addr.arpa. 14400 IN TXT "v=spf1 +a +mx +ip4:192.168.1.101 ~all" // not sure if it`s needed
Forth file is 172.236.77.in-addr.arpa.db
Code: [Select]
$ORIGIN 172.236.77.in-addr.arpa. //Don`t forget this
$TTL 2d ; default TTL for zone 172800 secs
@ IN SOA dev.abusers.eu. root.devilix.org. (
                         2016121401         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;; NS Records
IN NS dev.abusers.eu.
IN NS devil.abusers.eu.
IN NS devilix.abusers.eu.
IN NS ns1.abusers.eu.
IN NS ns2.abusers.eu.
IN NS ns1.devilix.org.
IN NS ns2.devilix.org.
;; PTR Records // This is your reverse record(if your ISP allows it)
141 PTR devilix.org.

Now let`s see:
Code: [Select]
[root@srv1 ~]# nslookup devilix.org
Server:         77.236.172.141
Address:        77.236.172.141#53
Name:   devilix.org
Address: 77.236.172.141
[root@srv1 ~]#
Code: [Select]
[root@srv1 ~]# dig devilix.org
;; QUESTION SECTION:
;devilix.org.                   IN      A
;; ANSWER SECTION:
devilix.org.            14400   IN      A       77.236.172.141 //We got our forward record!!!
;; AUTHORITY SECTION:
devilix.org.            14400   IN      NS      ns2.devilix.org.
devilix.org.            14400   IN      NS      ns1.abusers.eu.
devilix.org.            14400   IN      NS      devil.abusers.eu.
devilix.org.            14400   IN      NS      dev.abusers.eu.
devilix.org.            14400   IN      NS      ns2.abusers.eu.
devilix.org.            14400   IN      NS      devilix.abusers.eu.
devilix.org.            14400   IN      NS      ns1.devilix.org.
;; ADDITIONAL SECTION:
ns1.devilix.org.        14400   IN      A       127.0.0.1
ns2.devilix.org.        14400   IN      A       77.236.172.141
[root@srv1 ~]#
Code: [Select]
[root@srv1 ~]# dig -x 77.236.172.141
;; QUESTION SECTION:
;141.172.236.77.in-addr.arpa.   IN      PTR
;; ANSWER SECTION:
141.172.236.77.in-addr.arpa. 172800 IN  PTR     devilix.org. // We got our reverse record!!!
;; AUTHORITY SECTION:
172.236.77.in-addr.arpa. 172800 IN      NS      ns2.devilix.org.
172.236.77.in-addr.arpa. 172800 IN      NS      ns2.abusers.eu.
172.236.77.in-addr.arpa. 172800 IN      NS      ns1.devilix.org.
172.236.77.in-addr.arpa. 172800 IN      NS      devilix.abusers.eu.
172.236.77.in-addr.arpa. 172800 IN      NS      devil.abusers.eu.
172.236.77.in-addr.arpa. 172800 IN      NS      ns1.abusers.eu.
172.236.77.in-addr.arpa. 172800 IN      NS      dev.abusers.eu.
;; ADDITIONAL SECTION:
ns1.devilix.org.        14400   IN      A       127.0.0.1
ns2.devilix.org.        14400   IN      A       77.236.172.141
[root@srv1 ~]#
Remember this: It can take up to 1 week for your records to go around the world in all of the DNS servers so it will be visible from everywhere!!!

I`m not 100% sure that everything that I put in the files is 100% needed, but it`s working. I got my A, MX, CNAME, PTR, TXT records working. This is CentOS 6.8(Final) with CWP 0.9.8.128. Hope this can help to somebody. Sorry for my bad english.

22
Hello there,
I was wondering if anybody got managed to run the IPv6 to IPv4 tunneling on CentOS 6.8 (Final). If anybody did it, please tell me exactly the steps you made it, because I already put the pistol on my night desk and more often I start staring at it ... Also any other IPv6 to IPv4 tunnel broker configuration will be appreciated. Thanks in advance.

23
Apache / Apache is running but I can`t access my site on port 80
« on: December 01, 2016, 07:35:48 PM »
Hello people,
First of all I want to introduce myself a bit since this is my first post. I`m 33yo from Bulgaria with a bit more than 15y of XP in FreeBSD, Apache, MySQL, PHP, Perl, JavaScript, CSS, CSH, SH, BASH, Assembler, IPv6 and lots of other stuff. (I`m not a total newbie).
Now why I`m here.
Few weeks ago I decided to try something new and I spoted CentOS. I installed myself CentOS 7 x86on _64 on one old Core 2 Duo laptop without display. I put apache, mysql and php and everything was fine until I saw CWP. After I saw that CWP is up to CentOS 6, directly I put 6.8 and the pain begin. The installation of CWP was clear and everything seemed to be ok. Yes but NO. I cannot access my website on port 80. I was reading on google a bit, created new package, a new user, put the website on the new user, bla bla bla whatever google says ... but still nothing. Ok, I`m going through modem and 2 wifi routers, but ... this is not the problem. When it was CentOS 7 with clean Apache the website was working. And now ...
As I`m new to CentOS and CWP I`m begging you for help.

Pages: 1 [2]