You need to use htaccess to make a single file password protected and add these lines in to it.
AuthName “Restricted Area”
then run command
htpasswd -b .htpasswd username password
To login (from unix shell) use -h only if needed.
# [mysql dir]mysql -u username -p
Create a database on the sql server.
mysql> create database [databasename];
List all databases on the sql server.
mysql> show databases;
Switch to a database.
mysql> use [db name];
To see all the tables in the db.
mysql> show tables;
To see database’s field formats.
mysql> describe [table name];
To delete a db.
mysql> drop database [database name];
To delete a table.
mysql> drop table [table name];
Show all data in a table.
mysql> SELECT * FROM [table name];
Returns the columns and column information pertaining to the designated table.
mysql> show columns from [table name];
Show certain selected rows with the value “whatever”.
mysql> SELECT * FROM [table name] WHERE [field name] = “whatever”;
Show all records containing the name “Bob” AND the phone number ’3444444′.
mysql> SELECT * FROM [table name] WHERE name = “Bob” AND phone_number = ’3444444′;
Show all records not containing the name “Bob” AND the phone number ’3444444′ order by the phone_number field.
mysql> SELECT * FROM [table name] WHERE name != “Bob” AND phone_number = ’3444444′ order by phone_number;
Show all records starting with the letters ‘bob’ AND the phone number ’3444444′.
mysql> SELECT * FROM [table name] WHERE name like “Bob%” AND phone_number = ’3444444′;
Show all records starting with the letters ‘bob’ AND the phone number ’3444444′ limit to records 1 through 5.
mysql> SELECT * FROM [table name] WHERE name like “Bob%” AND phone_number = ’3444444′ limit 1,5;
Use a regular expression to find records. Use “REGEXP BINARY” to force case-sensitivity. This finds any record beginning with a.
mysql> SELECT * FROM [table name] WHERE rec RLIKE “^a”;
Show unique records.
mysql> SELECT DISTINCT [column name] FROM [table name];
Show selected records sorted in an ascending (asc) or descending (desc).
mysql> SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;
Return number of rows.
mysql> SELECT COUNT(*) FROM [table name];
mysql> SELECT SUM(*) FROM [table name];
If you get message “qmailadmin was not found on this server” while browsing qmailadmin then it must be something with script alias. add this in your httpd.conf and restart the service
ScriptAlias /cgi-bin/ “/usr/lib/cgi-bin/”
Allow from all
1. Download the perl from below command
2. Unzip it
tar -xzf perl-5.14.2.tar.gz
3. Change working directory to perl
4. Configure it with below commands
./Configure -des -Dprefix=/usr/bin/perl
5. Once you have done this you can check your new version of perl by typing
Perl –V or perl –v
6. to make this the default perl, you’d probably want to add to your .bashrc
1 login to user in which you want to set command completion.
2 after that check its shell by typing following command
3 If you get /bin/sh than you need to change its shell and if you get /bin/bash than no need to do anything
4 change shell for user
5 chsh -s /bin/bash username
6 this will change the usermae user shell to /bin/bash
7 logout and login again to check
Here are the steps to install Cpanel on CentOS server. It is recommended to have clean OS installation before you start installing Cpanel.
chmod +x latest
I can take 30 mins to 3 hours based on your server configuration.
Here are the quick steps to install clamav on Debian.
1) Login to your server
2) Edit /etc/apt/sources.list and add this line at the bottom of the file.
deb http://volatile.debian.org/debian-volatile stable/volatile main contrib non-free
3) Then run “apt-get update; apt-get install clamav”
If you need clamd, you may also want to run apt-get install clamav-daemon
Problem configuring mssql 2005 backup schedule.
TITLE: Microsoft SQL Server Management Studio
Property accessor ‘ScheduleDates’ on object ‘Microsoft.SqlServer.Management.SqlMgmt.SimpleJobSchedule’ threw the following exception:’Specified time is not supported in this calendar. It should be between 04/30/1900 00:00:00 (Gregorian date) and 05/13/2029 23:59:59 (Gregorian date), inclusive.
Parameter name: time’ (System)
This is happening because of the timezone issue. Correct the time zone and try to make it English if possible.
Here are the steps.
Login to your server.
# vi /etc/mysql/my.cnf
Then add these lines in the config line.
max_connections = 100
max_user_connections = 10000
Save and exit from the configuration file and restart mysql using this command.
1) Login to your cpanel control panel.
2) You will find a main tab called “Databases”
3) Under that you will find a link called “Mysql Databases”. Just click on it and it will take you to the next page.
4) In the next page you will find a button called “Create Database” with a text box.
5) You need to type database name in the text box and click on “Create Database”
6) Then go to “Add New User” on the same page and type “Username” and “Password” for the database and click on “Create User”
7) Then go to “Add User To Database” and select database and username you created and click on “Add”.
8) That is it. You are done with database creation.
After that you will have to assign permission to that user on the database based on your requirement.