Sunday, December 25, 2011

Adding Users in Mysql and Granting Privileges

You can add users to this database and specify the databases to which they will have access with the grant command, which has the syntax. sql> grant all privileges on database.* to username@"servername" identified by 'password'; Example: sql> grant all privileges on data1.* to dbuser@"localhost" identified by 'secdat'; Where data1 is the database name dbuser is the user name who has to access the db / name of new user. secdat is the password If you want to restrict that user from full privilege on a db you can use the following syntax: sql> grant CREATE,INSERT,DELETE,UPDATE,SELECT on data1.* to dbuser2@localho...

Thursday, December 22, 2011

Fix wampserver when the icon stays on orange

Below is the solution on how to fix wampserver when the icon stays on orange 1. Open Control Panel then Network Connections. 2. Right click on Local Area Connection and select Properties 3. Double click on the Internet Protocol (TCP/IP) line to open the Properties 4. On the General tab, click the Advanced button 5. Click the wins tab and uncheck the Enable LMHOSTS Lookup ...

Wednesday, December 21, 2011

rsync with port number

 rsync is a software application and network protocol for Unix-like and Windows systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion. Trouble with rsync while transfering to a server with port number ?? Here is the correct syntax : There are 2 ways to use this command. 1. If you are trying to transfer the files from remote server to your system then use the syntax below: ----- rsync...

Awstat not Updating in cPanel and Combined error Log

Yesterday I found a strange issue with awstat as it suddenly stopped reporting the data. I could get the past data but not able to get the current data. As usual as a part of debugging i opened the errorlogs and domlogs. I found something strange in the domlogs.  The word "combined" was repeating in the logs:  # vi /usr/local/apache/domlogs/ combined combined combined combined combined combined combined combined After hours of searching and testing i found the solution. I am sharing it below: Open the apache conf with your favorite editor. #vi /usr/local/apache/conf/httpd.conf Search for the line -------- ErrorLog /usr/local/apache/logs/error_log -------- Beneth that line add the following: -------- LogFormat "%h %l %u...

Sunday, December 18, 2011

Wordpress Hacked and Prevention

Hackers are hack for many reasons. Some of the common reasons why hackers hack are to get some Sensitive Information or to Steal Bandwidth to Distribute Illegal Content or may be for fun. Since there are many hackers around its our duty to keep our websites safe. Since your site is wordpress, i will suggest some steps to prevent this in future: 1. Always update your wordpress to the latest version. 2. Configure a firewall on your server. 3. Always use complex passwords instead of simple ones. 4. Use an anti virus and update the virus database regularly. 5. Always take backup of your site on a weekly / monthly basis so that we cam restore it if anything happen...

Thursday, December 15, 2011

Three ways to prevent DDOS

DDOS attack, also called denial of service attack simply means creating a massive virtual visitor to a website address at the same time it was intended to "demolish" host storage makes it run slowly or can not run anymore. A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer or network resource unavailable to its intended users.  Method 1: Anti iframe Code: if (top.location != self.location) {top.location = self.location}    if (top.location != self.location) {top.location = self.location}   if (top.location != self.location) {top.location = self.location}  Method 2: Anti-reload malicious website If you are...

Wednesday, December 14, 2011

Traffic Summary in Plesk

There are several types of control panels, and each of them offers something unique to the user. cPanel and Plesk are two popular choices. Plesk was released in 2003. The company is originally a product of SWsoft (after SWsoft acquired Plesk Inc.) but it’s now shipped under Parallels Inc. Plesk can be used for Windows as well as Linux which is missing in cpanel :) In my opinion, Plesk control panel is in the top 3 of control panels that are available to dedicated web hosting users. Open Plesk in browser and navigate to this window. Plesk > Home > Logs & Statistics > summary report > view traffic hist...

Increase the traffic of my web site

Search engine optimization is about ways to get your website to the top of search engines. Offer free, original, and quality content on your site also update your site everyday. Keep adding new stuff and interesting topics. Improve your search engine ranking by focusing your content on keywords related to your topic. Advertise your presence. Be patient. Search engines need a lot of time to index a new website and domain. They need time to index all your content; it's worth the wait. All the best...

Friday, December 9, 2011

cPanel Log File Locations

This is a shortlist of various log files for various applications on your Cpanel server. I have listed the application / service name and the location of the log files associated with it. cPanel Installation Logs: /var/log/cpanel-install-thread0.log Apache: /usr/local/apache/logs/access_log /usr/local/apache/logs/error_log Apache domlogs: /usr/local/apache/domlogs/example.com Apache SUEXEC Logs: /usr/local/apache/logs/suexec_log MySQL /var/lib/mysql/hostname.err BIND (named) Log: /var/log/messages Exim /var/log/exim_mainlog /var/log/exim_paniclog /var/log/exim_rejectlog Courier or Dovecot IMAP /var/log/maillog Tomcat Logs: /usr/local/jakarta/tomcat/logs/catalina.err /usr/local/jakarta/tomcat/logs/catalina.out cPanel Access Log: /usr/local/cpanel/logs/access_log cPanel...

Wednesday, December 7, 2011

Install the SSL Server Certificate

Install the SSL Server Certificate Files -------------------------------------------------- Login to cPanel Click SSL/TLS Manager > Certificates (CRT) > Generate, view, upload or delete SSL certificates In the Upload a New Certificate section click the Browse button and locate your SSL Server Certificate file your_domain_com.txt. Click the Upload button. Click the Go Back link to return to SSL/TLS Manger. Setup the Domain ------------------------- Click SSL/TLS Manager > Setup a SSL certificate to work with your site. If this option is not available to you your ISP may have disabled it and you will need to contact them to complete your SSL setup. From the Domain drop down menu select the domain that will use the SSL Certificate....

Tuesday, December 6, 2011

How to Block an IP in Windows

I did this in windows server 2003 not sure if these steps will work in other versions of windows. Take Start menu and take Run else you can press windows key and R in your keyboard. Type MMC in the box and press OK or hit enter. Now a console windows will open up. Navigate through  'File' > 'Add/Remove Snap in'. In the 'Standalone Tab' click The 'add' button. Seclect 'IP Security Policy Managment' > 'ADD' > 'Local Computer' > 'finish' > 'close' > 'ok'. After this you will be back to the console. In the left frame right click 'IP security policies on local computer' > 'Create IP security policy' Click Next and then name your policy 'Block IP' and type a description. Click 'Next' then leave 'activate' ticked...

Monday, December 5, 2011

Installing rkhunter

Rkhunter is a very useful tool that is used to check for trojans, rootkits, and other security problems. Is a security scanning tool which will scan for rootkits, backdoors, and local exploits. I will show you how to install it and set it up to send daily reports: wget -c http://downloads.rootkit.nl/rkhunter-1.1.1.tar.gz tar -zxvf rkhunter-1.1.1.tar.gz cd rkhunter-1.1.1 ./installer.sh We have now successfully installed it. To run a complete scan of the server /usr/local/bin/rkhunter -c Now setting up the daily report. Open a new file using your favourite editor. vim /etc/cron.daily/rkhunter.sh Add this script to the new file (rkhunter.sh). Replace abc@xyz.com with your e-mail address. #!/bin/bash (/usr/local/bin/rkhunter...

Sunday, December 4, 2011

TCP Wrapper

TCP Wrapper is used to filter network access to Internet and it can also be used to GRANT or DENY access to various services on your machine to the outside network or other machines on the same network. You must note that the wrappers do not work with RPC services over TCP. Common services such as pop3, ftp, sshd, telnet, r-services are supported by TCP Wrappers. In linux its actually done by writing simple rules to two files: 1.  /etc/hosts.allow 2. /etc/hosts.deny When the request for ssh comes it first checks the /etc/hosts.allow file if any rule for the sshd daemon is set in it else it will check for the same in /etc/hosts.deny file. Examples: /etc/hosts.allow file [root@dedico ~]# cat /etc/hosts.allow ## hosts.allow  ...

Friday, December 2, 2011

Install LAMP and phpMyAdmin on Ubuntu 11.10 Easy Way

Open terminal and type the command given below. Please note that we have to give "^" at the end and its not a typo. Many prompts will pop up during installation to set password or asking for the server password. Please give them when asked for. sudo apt-get install lamp-server^ After Installation open a web browser and enter the address http://localhost/. You should see a page that says "It Works!" Hence you can confirm that apache is working perfectly. Create a file in the /var/www directory called info.php. Enter the following command in the terminal to create the file. echo "" | sudo tee /var/www/info.php Now open a web browser again and enter the address http://localhost/info.php . You will get a php info page. If you are not...

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews