Problem With Solutions

Something Different In Linux

Home » Archive by category 'How to' (Page 2)

mysql connection in jsp

Posted by Rishikesh Vispute Categories: Email Marketing Series, How to, mysql, Tomcat

Database Connection by using jsp page . The URL based mysql connection  is ================================= jdbc:mysql://serverip address/DATABASENAME?user=USERNAME&password=PASSWORD ================================= OR ================================= <!– Database connection settings –> <property name=”connection.driver_class”>com.mysql.jdbc.Driver</property> <property name=”connection.url”>jdbc:mysql://localhost/database_name</property> <property name=”connection.username”>databses_user</property> <property name=”connection.password”>password</property> <!– configuration pool via c3p0–> ================================= OR ================================= try { Class.forName(“com.mysql.jdbc.Driver”).newInstance(); // here we are connecting to localhost, port 3306. Change it to  [ Read More ]

How to update webalizer?

Posted by Rishikesh Vispute Categories: cpanel, How to, Knowledge

Some time the webalizer is not updated automatically , at that time you need to update the webalizer manually by using following command. /usr/local/cpanel/3rdparty/bin/english/webalizer  -N  10  -D  /home/username/tmp/webalizer/dns_cache.db -R 250 -p -n domain.com -o  /home/username/tmp/webalizer   /usr/local/apache/domlogs/domain.com Note : Replace username equal to correct username and domain.com equal to correct domain name.

Redirection from http to https

Posted by Rishikesh Vispute Categories: How to, htaccess

How to Redirect from http to https URL. If the ssl is installed on the server and you want to all the request redirected to https then you need to add the folloing code in .htaccess file. ============================ RewriteEngine on Options +FollowSymLinks RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] ============================ or ============================ RewriteEngine on Options  [ Read More ]

Accessing perl file without .pl extention

Posted by Rishikesh Vispute Categories: How to, Knowledge

How to Access  perl script file without .pl extention for example: http://192.168.o.2/~test/cgi-bin/testperlpath.pl here in this case client want to access testperlpath.pl file without .pl extention like http://192.168.o.2/~test/cgi-bin/testperlpath then you need to add handler in .htaccess file <Files ~ ‘^[^.]*$’> SetHandler cgi-script </Files> Done

How to disable Core file generation

Posted by Rishikesh Vispute Categories: How to, Knowledge

How to disable Core file generation first of all delete the core files which are preset on the server or under any account then vi /etc/init.d/httpd and below the “ulimit -n 16384″ you need to put ulimit -c 0 And Command to delete core files #find ./ -name “core.*” -exec rm -f {} \;

How to compress CSS with gZIP

Posted by Rishikesh Vispute Categories: How to, Knowledge, PHP

How to compress my CSS with gZIP? To compress your CSS files with gZIP there are two things that you should do. First, add the following line to the .htaccess file in your public_html folder: AddHandler application/x-httpd-php52 .css By doing this, you allow the server to process .css files through PHP. Next, add the following  [ Read More ]

How to disabled the suhosin for the perticular domain search suhosin in php.ini file ============================= extension=”suhosin.so” ; Filtering Options suhosin.get.max_vars = 114096 suhosin.post.max_vars = 114096 ================================ and change it to ========================== ;extension=”suhosin.so” ; Filtering Options ;suhosin.get.max_vars = 114096 ;suhosin.post.max_vars = 114096 ==============================

How to Upgrade from moodle 1.8 to 1.9

Posted by Rishikesh Vispute Categories: How to, Knowledge

Upgrade from moodle 1.8 to 1.9 (with Nwiki upgrade) A very quick how to to upgrade moodle 1.8 to moodle 1.9 (with Nwiki upgrade from 1.8 to 1.9): 1. Stop you moodle 1.8 (mantainence mode) 2. Copy your moodle BD (ispconfig is great for this) to a new one (here is dbmoodle19) 3. cp /home/public_html/moodle18  [ Read More ]

How to Redirect a Web Page Using a 301 Redirect

Posted by Rishikesh Vispute Categories: How to, Knowledge

How to Redirect a Web Page Using a 301 Redirect You’ve just edited or modified some pages of your web site and those pages have high search engine rankings that you don’t want to lose. How can you safely redirect web site traffic from your old pages to the new pages without losing your rankings?  [ Read More ]

Perl script run without .pl extension.

Posted by Rishikesh Vispute Categories: cpanel, How to

Perl script run without .pl extension. If client want to run perl script without .pl extension then add the following rule in the .htaccess file under the public_html folder. ============== <Files ~ ‘^[^.]*$’> SetHandler cgi-script </Files> ==============

check gzip compression is enable or not

Posted by Rishikesh Vispute Categories: How to, Uncategorized

How to check gzip compression is enable on the server or domain. The gzip compression required mod_gzip.c or mod_deflate.c module installed on the server. How you can check this module installed on  the server root@server [~]# /usr/local/apache/bin/httpd -l or root@server [~]# httpd -l If one of the module is installed on the server then, you  [ Read More ]

How to enable https for tomcat

Posted by Rishikesh Vispute Categories: How to, Tomcat

If you are looking to enable HTTPS in Tomcat first thing you will have to do is generating a server certificate for your website. A key tool command which comes with your JRE( Java Runtime Environment). Open a command shell which should know how to find your Java runtime environment properly. If you are using  [ Read More ]

How to disable banner for server.

Posted by Rishikesh Vispute Categories: How to

How to disable banner for server. anter server ip address in centralops.net/com then click on —- you will see server naem and operating system : this you need to disable vi /usr/local/apache/conf/modsec.conf add one line in the file SecServerSignature “IIS admin”

Add SPF records (Sender Policy Framework)

Posted by Rishikesh Vispute Categories: How to

Add SPF records (Sender Policy Framework) “v=spf1 a mx ip4:91.186.0.8 ~all” Configuring SPF records in WHM 1. Login to WHM and select “Edit DNS Zone” on the left hand menu. 2. Select the domain that you wish to load and SPF record for. 3. If there is an existing SPF record then edit it as  [ Read More ]

Images not loading

Posted by Rishikesh Vispute Categories: How to

If images do not load using https://domian.com # vi .htaccess just add a comment to following line: (RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ – [F,NC]) #RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ – [F,NC]

Checking the port if open or not

Posted by Rishikesh Vispute Categories: How to

Checking the port if open or not [ telnet, nmap ] telnet TELNET (TELecommunication NETwork) is a network protocol used on the Internet. TELNET is a client-server protocol, based on a reliable connection-oriented transport. This command will help us to find if a particular port on the server is open or not. Example: root@server [~]$  [ Read More ]

cronjob

Posted by Rishikesh Vispute Categories: How to

If you want to  particular user do not run cron job 1] Enter that user name in cron.deny file 2] make all permission 000 of directory /var/spool/cron/username To restart cron #/etc/init.d/crond restart How to Setup Crontab for specific Domain. #crontab -e -u USERNAME To find out the crons set for the particular user: => #  [ Read More ]

How to check mail logs :

Posted by Rishikesh Vispute Categories: How to

How to check mail logs : 1] tail -f /var/log/exim_mainlog 2] grep few domains which are present in mail logs to check whether domain is on our server. and if domains are not present on our server then check with the mail IDs e.g. mail ID is => 1J9ZRu-0003Zx-Kf-H 3] cd /var/spool/exim/input/u       //there are 0  [ Read More ]

Change permissions for all files/folders

Posted by Rishikesh Vispute Categories: How to

You can change the files and folders permission at a time into the current folder by using following commands. for files find -type f -exec chmod 644 {} \; For Folders find -type d -exec chmod 755 {} \;

How To Update Awstats

Posted by Rishikesh Vispute Categories: How to

# /scripts/runweblogs (USERNAME) How to enable “UPDTAE OPTION” on awstas field # cd ~username/tmp/awstats // In this directory You will get domain.conf file, in that file just change AllowToUpdateStatsFromBrowser=0     to   AllowToUpdateStatsFromBrowser=1

How to block IP

Posted by Rishikesh Vispute Categories: How to

To find out whether any particular IP is blocked or not on the server => # route -n |grep <IP Address>  :: for example: #route -n |grep  58.8.66.156 To unblock an IP => # route del <IP Address> reject ::for example: #route del 58.8.66.156 reject To block an IP => # route add <IP Address>  [ Read More ]

Restart Tomcat via SSH :

Posted by Rishikesh Vispute Categories: How to

To start up 1] # cd /usr/local/jakarta/jakarta-tomcat-5.5.9/bin/ # ./startup.sh To shutdown 2] # cd /usr/local/jakarta/jakarta-tomcat-5.5.9/bin/ # ./shutdown.sh

operation not permitted error

Posted by Rishikesh Vispute Categories: How to

If you are trying to change the permission say admin folder by chmod 755 admin/ but it is giving you  operation not permitted error  then  check for imutable #  lsattr                        // it will show you all attributes under the current folder , so check if  folder is imutable or not  o/p :”  —-i——– ./admin” #  [ Read More ]

How to make tar ,GZ AND ZIP file.

Posted by Rishikesh Vispute Categories: How to

How to make tar ,GZ AND ZIP file. tar -zcvf  index.tar.gz  index.html gzip -c file1  > foo.gz How to make UNtar ,UNGZ AND UNZIP file. tar -zxvf  index.tar.gz gunzip filename.gz unzip filename.zip create: tar -cvf mystuff.tar mystuff/ tar -czvf mystuff.tgz mystuff/ extracting: tar -xvf mystuff.tar tar -xzvf mystuff.tgz testing/viewing: tar -tvf mystuff.tar tar -tzvf mystuff.tgz

To disable Squirlmail for any specific domain

Posted by Rishikesh Vispute Categories: How to

To disable Squirlmail for any specific domain add following rule the /var/cpanel/users/USERNAME skiphorde=1 skipsqmail=0 skipneomail=1 then service cpanel restart

How to check DDOS attach

Posted by Rishikesh Vispute Categories: How to

How to check DDOS attach netstat -n | grep :80 |wc -l                  // show the number of active connections that are open    to your server netstat -n | grep :80 | grep SYN |wc -l  //connection of any IP more that 100 then block that IP netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ |  [ Read More ]

How to Setup Crontab for specific Domain.

Posted by Rishikesh Vispute Categories: How to

How to Setup Crontab for specific Domain. #crontab -e -u USERNAME

Optimized by SEO Ultimate