Recent Posts

Pages: 1
1
Tutorials / How tos? / How to enable private PHP Error Logging using .htaccess file
« Last post by KTCHost on August 02, 2018, 10:29:21 AM »
We can enable the private PHP error logging by using following code in the .htaccess file

Code: [Select]
# enable PHP error logging
php_flag log_errors on
php_value error_log /home/path/public_html/domain/PHP_errors.log

Note : The PHP_errors.log file needs to be permission 755 or 777.

If you have any questions, simple make a reply to this thread and will help you to resolve all queries.
2
Web Hosting Related Offers & Requests / KTCHost server location expansion
« Last post by KTCHost on August 02, 2018, 10:17:44 AM »
KTCHost like to introduce continent based Dedicated server in affordable rates.
Reduce server response time and speed up your website using servers from your country continents

3
Enjoy Colors of Holi with KTCHost Special Offer



E3-1230 Server,
2x1TB HDD, 32GB RAM,
5 IPS in $99/m or Rs 5000/m.


In case of any questions or doubts, you can approach our Sales Department through 24*7 Live chat support available at https://www.ktchost.com/dedicated-server.html or E-mail us at info@ktchost.com
4
KTCHost Announcements / KTCHost Launched First School Management Hosting
« Last post by KTCHost on June 26, 2017, 01:46:37 PM »
We are glad to inform you that we have launched first School Management System HOSTING which is useful not only for Big Schools/Colleges but also Small Coaching classes,Playgroup / Nursery.

You can launch your own School/College Mobile App in GOOGLE Play store in affordable price , price starts from $3 or INR 100 per student for three years. Yes, its true pricing for THREE years. If you have any questions or queries, contact us on live chat support.
5
50% Discount on cPanel license with ALL Dedicated Servers

Why #KTCHost #Dedicated #server?

#Dedicated #Server with following Powerful Key features made #KTCHost best Dedicated server provider

* Powerful control Panel
* Cloudflare Support
* Let's Encrypt SSL Support
* Softaculous script installer
* R1Soft Remote Backup
* 24x7 Unlimited support instance
* 24x7 Server Monitoring

For more information, E-mail Us : info@ktchost.com | Visit - https://www.ktchost.com/dedicated-server.html

#KTCHost - A Reliable Hosting Provider
6
Tutorials / How tos? / Load alert script
« Last post by KTCHost on May 11, 2017, 01:21:57 PM »
Get the process status report through e-mail for server load, you can try to add additional info to the code, to get more info through e-mail.

Simply create new file add following code in a /root/loadalert file and configure as per your requirement.

vi   /root/loadalert

   
Code: [Select]
#!/bin/bash
    #Created on October 15th, 2015
    EMAIL="your email 1"
    # For multiple E-mails.
    EMAIL1="your email 2"
    SUBJECT="Alert $(hostname) load average is $L05"
    TEMPFILE="/tmp/$(hostname)"
    echo "Load average Crossed allowed limit." >> $TEMPFILE
    echo "Hostname: $(hostname)" >> $TEMPFILE
    echo "Local Date & Time : $(date)" >> $TEMPFILE
    echo "| Uptime status: |" >> $TEMPFILE
    echo "-------------------------------------------" >> $TEMPFILE
    /usr/bin/uptime >> $TEMPFILE
    echo "-------------------------------------------" >> $TEMPFILE
    echo "| Top 20 CPU consuming processes: |" >> $TEMPFILE
    ps aux | head -1 >> $TEMPFILE
    ps -auxf | sort -nr -k 3 | head -20 >> $TEMPFILE
    echo "| Top 10 memory-consuming processes: |" >> $TEMPFILE
    ps aux --no-headers| sort -rn +3 | head >> $TEMPFILE
    echo "-------------------------------------------" >> $TEMPFILE
    echo "| Memory and Swap status: |" >> $TEMPFILE
    /usr/bin/free -m >> $TEMPFILE
    echo "-------------------------------------------" >> $TEMPFILE
    echo "| Active network connection: |" >> $TEMPFILE
    echo "-------------------------------------------" >> $TEMPFILE
    /bin/netstat -tnup | grep ESTA >> $TEMPFILE
    echo "-------------------------------------------" >> $TEMPFILE
    echo "| Disk Space information: |" >> $TEMPFILE
    echo "-------------------------------------------" >> $TEMPFILE
    /bin/df -h >> $TEMPFILE
    echo "-----------------THE END-------------------" >> $TEMPFILE
    L05="$(uptime|awk '{print $(NF-2)}'|cut -d. -f1)"
    if test $L05 -gt 5
    then
    mail -s "$SUBJECT  $L05" "$EMAIL" < $TEMPFILE
    # For multiple E-mails.
    #mail -s "$SUBJECT  $L05" "$EMAIL1" < $TEMPFILE
    fi
    rm -f $TEMPFILE

By default we recommend every minute cron to avoid any load alerts.

* * * * * /root/loadalert >/dev/null 2>&1

Let us know, if you required any further information.
7
Tutorials / How tos? / Increase memory limit for Wordpress
« Last post by Anant on February 24, 2017, 05:45:38 PM »
While running Wordpress websites, we are receiving memory error message but while checking server main php.ini file memory limit settings, we found out that enough memory limit is set but still we are receiving the memory related error message.

Wordpress local level memory need to be increase to resolve issue. For permanent solution add following code in wp-config.php as per memory requirement.

Code: [Select]
define('WP_MEMORY_LIMIT', '64M');
8
Tutorials / How tos? / How to set default page for website using htaccess file
« Last post by Anant on February 24, 2017, 05:38:31 PM »
Many time we want to set different files as a default page for website but server side setting allows index.php, index.html or index.htm as a default page. We can use following simple htaccess code to set default index page as per requirement.

htaccess file code for single default page

Code: [Select]
#Alternate default index page
DirectoryIndex mypage.html

htaccess file code for multiple index page

Code: [Select]
#Alternate default index pages
DirectoryIndex mypage.html index.htm index.html index.php
9
Tutorials / How tos? / Default htaccess file for CodeIgniter
« Last post by Anant on February 24, 2017, 05:27:40 PM »
Many time users faces issue to set rewrite rules for CodeIgniter project but we can use following CodeIgniter htaccess file to set search-engine and human friendly URL for CodeIgniter project.

Code: [Select]
<IfModule mod_rewrite.c>
  RewriteEngine On
  # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
  #  slashes.
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.
  # Submitted by: ElliotHaughin

  ErrorDocument 404 /index.php
</IfModule>
10
Tutorials / How tos? / Default htaccess file for Magento
« Last post by Anant on February 24, 2017, 05:17:10 PM »
Default htaccess file for Magento store to set the default permalink for Magento store for better SEO result.

Code: [Select]
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

############################################
## GoDaddy specific options

#   Options -MultiViews

## you might also need to add this line to php.ini
##     cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

############################################
## default index file

    DirectoryIndex index.php

<IfModule mod_php5.c>

############################################
## adjust memory limit

    php_value memory_limit 512M
    php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

    php_flag magic_quotes_gpc off

############################################
## disable automatic session start
## before autoload was initialized

    php_flag session.auto_start off

############################################
## enable resulting html compression

    #php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

    php_flag suhosin.session.cryptua off

###########################################
# turn off compatibility with PHP4 when dealing with objects

    php_flag zend.ze1_compatibility_mode Off

</IfModule>

<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload

    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter on all content
    ###SetOutputFilter DEFLATE
    # Insert filter on selected content types only
    #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

    # Netscape 4.x has some problems...
    #BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    #BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    # Don't compress images
    #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    #Header append Vary User-Agent env=!dont-vary

</IfModule>

<IfModule mod_ssl.c>

############################################
## make HTTPS env vars available for CGI mode

    SSLOptions StdEnvVars

</IfModule>

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

    #RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>


############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead

    AddDefaultCharset Off
    #AddDefaultCharset UTF-8

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

    ExpiresDefault "access plus 1 year"

</IfModule>

############################################
## By default allow all access

    Order allow,deny
    Allow from all

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

    #FileETag none
Pages: 1