Sunday, May 30, 2010
Mysql Crash Recovery
1) Verify the current process and status
========================================
ps auxf | grep mysql By this command we can find any mysql process in the server.
ps -aux | grep mysql
The -a option tells ps to list the processes of all users on the system rather than just those of the current user, with the exception of group leaders and processes not associated with a terminal. A group leader is the first member of a group of related processes.
The -u option tells ps to provide detailed information about each process.
The -x option adds to the list processes that have no controlling terminal, such as daemons, which are programs that are launched during booting (i.e., computer startup) and run unobtrusively in the background until they are activated by a particular event or condition.
The output of the command is
>ps -aux | grep mysql
root@cpmouse [/var/lib/mysql]# ps auxf | grep mysql
root 16673 0.0 0.0 61128 712 pts/1 S+ 18:30 0:00 \_ grep mysql
root 11142 0.0 0.0 10796 1160 ? S 06:24 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/cpmouse.ecdsystem.com.pid
mysql 11163 39.2 1.4 442900 59584 ? Sl 06:24 284:47 \_ /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/cpmouse.ecdsystem.com.pid --skip-external-locking
To check the mysql current processes
ps -ef |grep mysql|awk '{print $2}'
This command will grep the second column only.
2)Verify /etc/my.cnf settings
[mysqld]
safe-show-database
old-passwords = 1
skip-name-resolve
skip-locking
set-variable = max_connections=2000
set-variable = interactive_time=30
set-variable = wait_timeout=30
set-variable = max_connect_errors=2000
3)Have a look out the mysqld Permission settings
=================================================
The Permission should be in mysql format
chown mysql.mysql /var/run/mysqld
We have to change the ownership for all the mysql processes.
chown -R mysql.mysql /var/run/mysqld
root@cpmouse [/var/lib/mysql]# ll
total 20556
drwxr-xr-x 4 mysql mysql 4096 May 30 04:29 ./
drwxr-xr-x 29 root root 4096 May 30 04:21 ../
-rw-rw---- 1 mysql root 5378 May 30 04:29 cpmouse.ecdsystem.com.err
-rw-rw---- 1 mysql mysql 5 May 30 04:29 cpmouse.ecdsystem.com.pid
-rw-rw---- 1 mysql mysql 5 May 30 04:28 cpmouse.pid
-rw-rw---- 1 mysql mysql 10485760 May 30 04:29 ibdata1
-rw-rw---- 1 mysql mysql 5242880 May 30 04:29 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 May 30 04:26 ib_logfile1
drwx--x--x 2 mysql mysql 4096 May 30 04:22 mysql/ - contain mysql user privilege
srwxrwxrwx 1 mysql mysql 0 May 30 04:29 mysql.sock=
drwxr-xr-x 2 mysql mysql 4096 May 30 04:21 test/
/var/lib/mysql - remove
/usr/sbin/mysqd - remove
grant all privileges on virus_UC.* to virus_UC@localhost identified by '04241988';
/scripts/mysqlup --force
/var/cpanel/cpanel.config
Ps Process command Usage with options
The ps (i.e., process status) command is used to provide information about the currently running processes, including their process identification numbers (PIDs).
A process, also referred to as a task, is an executing (i.e., running) instance of a program. Every process is assigned a unique PID by the system.
The basic syntax of ps is
ps [options]
The four items are labeled PID, TTY, TIME and CMD. TIME is the amount of CPU (central processing unit) time in minutes and seconds that the process has been running. CMD is the name of the command that launched the process.
TTY (which now stands for terminal type but originally stood for teletype) is the name of the console or terminal (i.e., combination of monitor and keyboard) that the user logged into, which can also be found by using the tty command. This information is generally only useful on a multi-user network.
A common and convenient way of using ps to obtain much more complete information about the processes currently on the system is to use the following:
ps -aux | less
The -a option tells ps to list the processes of all users on the system rather than just those of the current user, with the exception of group leaders and processes not associated with a terminal. A group leader is the first member of a group of related processes.
The -u option tells ps to provide detailed information about each process.
The -x option adds to the list processes that have no controlling terminal, such as daemons, which are programs that are launched during booting (i.e., computer startup) and run unobtrusively in the background until they are activated by a particular event or condition.
As the list of processes can be quite long and occupy more than a single screen, the output of ps -aux can be piped (i.e., transferred) to the less command, which lets it be viewed one screenful at a time. The output can be advanced one screen forward by pressing the SPACE bar and one screen backward by pressing the b key.
Among the information that ps -aux provides about each process is the user of the process, the PID, the percentage of CPU used by the process, the percentage of memory used by the process, VSZ (virtual size in kilobytes), RSS (real memory size or resident set size in 1024 byte units), STAT (the process state code), the starting time of the process, the length of time the process has been active and the command that initiated the process. The process state codes include D, uninterruptable sleep; N, low priority; R, runnable (on run queue); S, sleeping; T, traced or stopped; Z, defunct (zombie).
In contrast to most commands, the hyphen preceding ps's options is optional, not mandatory. Thus, the following could be (and sometimes is) used in place of the above command:
ps aux | less
An alternative set of options for viewing all the processes running on a system is
ps -ef | less
The -e option generates a list of information about every process currently running. The -f option generates a listing that contains fewer items of information for each process than the -l option.
Among the columns displayed by ps -ef, UID contains the username of the account that owns the process (which is usually the same user that started the process) and STIME displays the time the process started, or the starting date if it started more than 24 hours ago.
The processes shown by ps can be limited to those belonging to any given user by piping the output through grep, a filter that is used for searching text. For example, processes belonging to a user with a username adam can be displayed with the following:
ps -ef | grep adam
The -l option generates a long listing, and when used together with the -e and -f options creates a table with 15 columns:
ps -efl
The additional columns of most interest are NI and SZ. The former shows the nice value of the process, which determines the priority of the process. The higher the value, the lower the priority. The default nice value is 0 on Linux systems.
The latter displays the size of the process in memory. The value of the field is the number of pages the process is occupying. On Linux systems a page is 4,096 bytes.
ps is most often used to obtain the PID of a malfunctioning process in order to terminate it with the kill command. For example, if the PID of a frozen or crashed program is found to be 1125, the following can usually terminate the process:
kill 1125
ps -ef or ps -efl can then be used to confirm that the process really has stopped. If it has not, then the more forceful -9 option should be used, i.e.,
kill -9 1125
The pstree command is similar to ps in that it can be used to show all of the processes on the system along with their PIDs. However, it differs in that it presents its output in a tree diagram that shows how processes are related to each other and in that it provides less detailed information about each process than does ps.
Saturday, May 29, 2010
VBulletin upgradation
=====================
1) Unzip the update file after that you will found the two newly created
folders "upload" and "do not upload", From this delete the folder "do
not upload" and need to rename(move) the folder "upload" to forum after
that change the appropriate ownership for this folder.
.2) Edit the file vi /home/username/public_html/forum/includes/config.php
and mention the below steps
(i) Mention the database name.
['Database']['dbname'] = 'DBNAME';
(ii) Mention the technical e-mail address.
['Database']['technicalemail'] = 'customer e-mail ID';
(iii) Mention the DATABASE USERNAME & PASSWORD.
['MasterServer']['username'] = 'DB Username';
['MasterServer']['password'] = 'Passwd';
3 Go to /home/username/public_html/forums/install/ then you will find the
file name like upgrade.php
4 Access upgrade.php file in the web browser to install VBulletin ex://
http://domainname.com/forums/install/upgrade.php
(You need to mention the customer number and its password to continue the
installation, You need to click many "Next".... buttons to complete the
installation.
5.While this upgradation is going on the user name and password prompt
will occur to create the admincp login detail. So, mention the admincp
username as "admin" and password as anything that what you want.
CSR Generation and Certificate Installation through Command for windows Servers
We can generate CSR and Install SSL through Command Line Interface for
windows Servers. The Steps are as below.
Save the following file as request.inf on your server editing the subject
according to the comment:
;----------------- request.inf -----------------
[Version]
Signature="$Windows NT$"
[NewRequest]
;Change to your,country code, company name and common name
Subject = "C=US, O=Acme Safe Co, CN=store.acmesafe.com"
KeySpec = 1
KeyLength = 2048
; Can be 1024, 2048, 4096, 8192, or 16384.
; Larger key sizes are more secure, but have
; a greater impact on performance.
Exportable = TRUE
MachineKeySet = TRUE
SMIME = False
PrivateKeyArchive = FALSE
UserProtected = FALSE
UseExistingKeySet = FALSE
ProviderName = "Microsoft RSA SChannel Cryptographic Provider"
ProviderType = 12
RequestType = PKCS10
KeyUsage = 0xa0
[EnhancedKeyUsageExtension]
OID=1.3.6.1.5.5.7.3.1 ; this is for Server Authentication / Token Signing
;-----------------------------------------------
then run:
c:\>certreq -new request.inf request.csr
This will generate your csr.. When your certificate is issued you'll
receive a file called store_acmesafe_com.cer. Save it on the server and
from the same directory run:
C:\>certreq -accept store_acmesafe_com.cer
This will install the cert in the Windows certificate store and it will be
available in IIS, MMC, Exchange, LDAP/Active Directory, Terminal Services
etc...
Webhosting Terms
DNS ISSUE
1.Updating nameserver for the domain
2.checking and modifing MX for a domain
3.setup url forwarding for a domain
4.Creating subdomains
5.Ponting IP for a domain
EMAIL ISSUE
1. checking account quota for the domain
2. checking the mail quota and correcting
3. Correcting the nmaeserver mismatch error
4. checking and correcting the MX for the domain
5. Checking and correcting the catch all problem for an account via cpanel
6. Updating the step to create emial account via cpanel
7. Updating the step to checkthe mail quota via cpanel
8. Updating the step to configure the outlook express
9. Updating the step to use the mail filter option via cpanel
10. Updating the step to configure spam assassin via cpanel
11. Updating the step to enable spam assasin for the account via cpanel
12. clearing frozen messages in mail queue for the eamil to work
13. Clearing or removing session files in tmp folder to email access error problem
14. Empty the mail account that consumes space as per the customer request
APACHE ISSUES Turn automatic directory listings on or off
To set up Apache to require a username and password to access certain documents
To prevent people from "stealing" the images from my web site
set up a virtual host in Apache
Directives in Apache
Setup SSL
Log analyze in apache
Redirect rules in apache
Scriptalias
.htaccess rules
Apache error codes
GENERAL ISSUE
1. Sending welcome mail fro the login details
2. Suspending and unsuspending an account via WHM
3. Terminate an Account via WHM
4. Quota Modification for an account via WHM
5. Checking the space usage of the account
MYSQL ISSUE
6. Update step to "Changing your cPanel account password"
7. Install FrontPage Extensions via WHM
8. UNInstall FrontPage Extensions via WHM
9. View Bandwidth Usage and correcting the bandwidth for a domain via WHM
10. Password modification for an account via WHM
Basic Issues 11. Modify an Account via WHM
12. Checking ssl access for a account via WHM
13. Update step to "Creating additional FTP accounts"
14. Update step to "Creating a subdomain"
1.Update the step to "Creating a MySQL database"
2.Update the step to "Managing a MySQL database in PHPMyAdmin"
3.Checking mysql access
4.Giving privileges to database
1. Enabling Shell access for a domain.
Heading 2. Enabling Awstats, webaliazer and analog stats.
3. Changing Username for a domain.
General Installations/Up gradation. 4. Increasing diskquota and bandwidth for a domain.
5. Reset Cpanel passsword for particular domain.
6. Suspend/unsuspend an Account.
7. Enable/disable reseller privileges.
8. Adding/deleting subdomain and parked domain
Level II Issues
Issues
a. Installing Chkrootkit
b. Installing Rootkit Hunter
c. Installing APF and BFD
d. Installing SIM (System Integrity Monitor)
e. Installing PRM (Process Resource Monitor)
f. Installing LES (Linux Environment Security)
g. LSM (Linux Socket Monitor)
h. Installing Mod_Throttle on cPanel server
Apache i. Imapd Installation
j. Streaming server Installations
k. Securing the /tmp Directory
l. Php Installation/Upgradation
j. Reseting the admin password in plesk Manually
k. eaccelerator Installation
l. Various types of quota Issues.
m. Enabling/Disabling phpsuexec
h. Installations of 3rd party tool via fantastico.
a. Upgrading the apache
Mail b. Configuring the modules in plesk server
c. Compiling the modules in apache
d. General Apache Tweaking
e. Internal server error
f. Page not found error
g. Redirecting a page to some other page using htaccess
i. Enabling and disabling mod_security using htaccess
j. Enable/disable safe_mode , allow_url_fopen, upload_max_filesize,
l. register_globals for php using .htaccess
a. Tweaking the exim configuration file
b. Handling issue like Maximum mails per/hr for a domain
c. Preventing the user "nobody" from sending out mail to remote addresses
FTP d. RBL configuration
e. Local delivery error
f. Mail delivery failed error
g.Clearing frozen mails and mails older than 5days using exim commands
DNS h.Enabling BoxTrapper Spam Trap in the server
i.Enabling SpamAssassin Spam Filter options in server
j.Creating Spam filter rule, enabling spamassasin and Configuring spam assasin to control the amount of Spam mails
k.Blacklisting a domain and adding a domain in white list
l.Email timing out
Mysql a. Converting pro-ftp to pure-ftp and vice versa
b.Creating ftp user for a particular directory
c.FTP - 550 login error
a. Updating the bind ver.
b. SPF Record Creation
c. Creating a new DNS Zone
d. Changing A record Entry
e. Nameserver mismatch error.
General Issues
a. Upgrading Mysql
b. Handling version conflict error
c. Handling Privileges Issues'
d.Creating mysql backup
e.Restoring Mysql backup
f.Repairing tables using Myisamchk
g.Mysql connection error
h.Deleting a table in database
a. Generating CSR
b. Installing SSL Cert
Heading c. Handling some critical cpanel/plesk related Issue's
Exim + Sendmail + Qmai d. Deleting unwanted logs and reduce disk space.
e. Domain not listed in WHM
f. Blocking/unblocking IP via apf & iptables.
g. Restore backup for a domain
h. Updating awstats manually.
Level III Issues (Server Administration)
Issues
a. Editing configuration files
b. Reinstalling
c. Changing Outgoing port number
d. Integrating RBL with mail servers
e. Modifying Open relay and closed relay
f. Editing configuration files of Anti Spam softwares( MailScanner,ClamAv,SpamAssassin)
FTP Servers g.Proving and Protecting Email Sender Identity using Domainkeys
h. Imap configuration
i.Dovecot configurationMail service not working:
DNS Servers j.exim corruption
k.DNS issues
l.Permission issues
m.localhost errors due to corrupted sendmail.mc/sendmail.cf.
Apache n.Email authentication problem in outlook, unable to login horde or squirrel mail in cpanel servers
a. Enabling Ftp Resume Uploads
b. Enable FXP with PureFTP
a. Open DNS
b. Unable to start/stop named due to /etc/named.conf or zone file misconfiguration
FreeBSD c. Named not loading due to RNDC
a. Editing configuration which affects serverwide
Installations b. Upgradation
c. Configuring Dual httpd
d. Lighttpd configuration
e. Tweaking apache
f. Internal server error due to file extension configuration in apache
g.Unable to start/stop apache due to corrupted httpd.conf.
a. To configure a FreeBSD IPFW firewall
b. Kernel setup
a. Imapd
b. Nagios Installation and configuration
c. Installing Bind
d. Installing Apache
e. Installing Mysql
f. Installing PHP
g.Installing Qmail
h. Squirrelmail, webmin installations
I.Installing Shoutcast (Streaming software)
j.Icecast Installation
k.APF, BFD installation
l.SIM, PRM installation
m.ntegrating various modules with Apache
n.Installing Nagios
Other tasks o.Installing Lighthttpd
p.MRTG, Eaccelerator, Zendoptimizer installations
q.Installing LAMP
r.Installing Apache, PHP, Mysql in a Directadmin server
s.Upgrading/degrading PHP, Mysql
u.Installing Rkhunter, chkrootkit for checking server vulnerabilities
t.Configuring multiple interface in the server
v.Cpanel server setup
w.Installing perl modules for cpanel servers using CPAN or WHM
a. Server Migration
b. Taking backups and restoring
c. Mounting second drive
d. Cluster setup
e. Server Intial Setup
PHP f. Mysql Synchronization
g. Load Balancer configuration
h. Synchronization of two servers
Mysql I. Roundrobin Configuration
j. Tweaking sysctl conf, Apache, Mysql, FTP
k. rsync
l. Adding gateway and ips
Cpanel errors m. Load Monitoring Script
n. MRTG, RTG
Server Wide General issues
a. Recompiling PHP
b. PHP issues in plesk server
a. Unable to start/stop Mysql
b. Mysql tweaking
Mail Servers c. Error while upgrading/degrading Mysql
a. Unable to run /scripts/upcp
a. Unable to load the domains outside the server/network
b. Server tweaking
c. Kernel tweaking
d. debugging dos attack servers
e. debugging hacked servers
Server Security:(Linux,Freebsd)
a. Tuning the configuration files.
b. Reinstalling the already installed mail servers.
c. Working with the mail redirections
d. Installing and upgrading the addon modules
e. Configuring POPb4SMTP and SMTPb4POP
f. Installing DOVECOT and configuring it.
g.Trouble shooting in all the above-mentioned topic.
h. Up gradation of the already installed addon modules.
a. Ugrading the latest available packages.
b. Tuning the linux kernel.
c. Checking the services and servers installed in the primary server.
d. Kernel upgradation - recompilation.
e. Checking the server's performance.
f. Identifying the vulnerable scripts in the server.
g. Disabling the unwanted services.
h. Using proper security chains.
I. Checking the server's open ports.
j. Installing and configuring the 3rd party security modules.
k. Tuning various installed services like mysql, ftp etc...
l. Log analysis and Securing ssh etc..
m. Monitoring the server's resource usage.
n. Server crash analysis.
o. Server hack analysis.
Outlook Configuration Settings
1.In Microsoft Outlook, from the E-mail Accounts menu, select Tools.
2.On the E-mail Accounts wizard window, select Add a new e-mail account,
and then click Next.
3.For your server type, select POP3 or IMAP, and then click Next.
4.On the Internet E-mail Settings (POP3/IMAP) window, enter your
information as follows:
-->Your Name
Your first and last name.
-->E-mail Address
Your email address.For example (test@atake.com.cn)
-->User Name
Your email address, again.
-->Password
Your email account password.
-->Incoming mail server (POP3)
POP, Pop.secureserver.net or IMAP, imap.secureserver.net.
-->Outgoing mail server (SMTP)
Smtpout.secureserver.net
Click More Settings.
5. On the Internet E-mail Settings window, go to the Outgoing Server tab.
6. Select My outgoing server (SMTP) requires authentication.
7. Select Use same settings as my incoming mail server.
8. Click Ok. Click Next. Click Finish.
Good Link for Learning IIS
http://www.iis.net/
Make Win Server administration easier using Windows Power Shell.
http://technet.microsoft.com/hi-in/library/ee221100%28en-us%29.aspx
http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx
http://support.microsoft.com/kb/968929
Windows Power Shell is available for Win2003 and Win2008R2
A very nice way to start learning Windows.
Commands for Remove the Mail queues in Exim
exiqgrep -i -f | xargs exim -Mrm
exim -bp | grep "frozen" | awk {'print$3'} | xargs exim -Mrm
exim -bp | grep "<>" | awk {'print$3'} | xargs exim -Mrm
exim -bp | grep "nobody" | awk {'print$3'} | xargs exim -Mrm
exim -bp | grep "bounce" | awk {'print$3'} | xargs exim -Mrm
exiqgrep -i -f | xargs exim -Mrm
exim -bp | grep "frozen" | awk {'print$3'} | xargs exim -Mrm
exim -bp | grep "<>" | awk {'print$3'} | xargs exim -Mrm
exim -bp | grep "nobody" | awk {'print$3'} | xargs exim -Mrm
exim -bp | grep "bounce" | awk {'print$3'} | xargs exim -Mrm
Free SSL Certificate - StartSSL
valid for a year. Usually we purchase SSL certs from vendors like
Verisign, Thawte etc. For more info just follow the link
http://www.h-online.com/security/features/SSL-for-free-step-by-step-906862.html
Wednesday, May 26, 2010
MYSQL Password Reset
=======================
mysql -V
mysql Ver 14.12 Distrib 5.0.86, for pc-linux-gnu (i686) using readline 5.1
Reset Mysql Password for mysql Ver 14.12
=========================================
mysql>set password for 'teachersdb_Ads'@'localhost' = password('98m4@9er');
For some other versions
=======================
UPDATE user SET Password=PASSWORD('1q2w3e4r') WHERE User=’teachersdb_Ads’;
For mysql login:
================
mysql -u username -p password
To set All privileges to My sql DB
===================================
GRANT ALL PRIVILEGES ON teachersdb_Ads.* TO teachersdb_Ads @'174.37.6.90' IDENTIFIED BY '4645bvg6dgdr'
You will start by logging into your server via ssh and logging into your MySQL entering the following:
mysql –uadmin –p`cat /etc/psa/.psa.shadow`
Grant Privilege
GRANT SELECT ON database.* TO username@'localhost' IDENTIFIED BY 'password';
To enable more options you would separate them with a comma. So to enable SELECT, INSERT, and DELETE your syntax would look like this;
GRANT SELECT, INSERT, DELETE ON database.* TO username@'localhost' IDENTIFIED BY 'password';
Once you have given the desired privileges for your user, you will need to run this command within the MySQL command prompt;
FLUSH PRIVILEGES;
To see a list of the privileges that have been granted to a specific user;
select * from mysql.user where User='user' \G
Sunday, May 23, 2010
Virtuozzo Panel Issues
Issue:
In Parallels Virtuozzo panel all the cPanel accounts shows that their disk usage is Zero.
Fix:
vi /etc/vz/conf/101.conf
QUOTAUGIDLIMIT="0"
change it to QUOTAUGIDLIMIT="1000"
then,
vzctl restart 101
Saturday, May 22, 2010
Use of .htaccess file
How to deny IP specific addresses?
# vi /home/user/public_html/.htaccess
Order allow, deny
Deny from 192.168.0.10
Deny from 212.155.
Deny from 1.2.3.4 5.6.7.8 127.0.0.1
Allow from all
How to prevent or allow directory listing?
The following line enables Directory listing.
Options +Indexes
The following disables directory listing for your web site.
Options –Indexes
With .htaccess file you can control which files to be ignored when creating a directory list.
For example:
IndexIgnore *.gif *.zip *.txt
Will make the apache server to skip all gif, zip and txt files from the directory list.
IndexIngnore *
Will just create an empty directory list.
You can use custom error pages for any error as long as you know its number (like 404 for page not found) by adding the following to your .htaccess file:
ErrorDocument errornumber /file.html
For example if I had the file notfound.html in the root direct
ory of my site and I wanted to use it for a 404 error I would use:
ErrorDocument 404 /notfound.html
Protecting a folder:
cd /home/user/public_html/
htpasswd -c .htpasswd username
the above command will create .htpasswdfile
To password protect a folder on your site, you need to put the following code in your .htaccess file:
AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName "My Secret Folder"
Require valid-user
Hotlink Protectection:
You can prevent the hot-linking of your images by creating a .htaccess file with the following content:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?your-domain.com/.*$ [NC]
RewriteRule \.(gif|jpe?g|png)$ - [F]
To block other type of files, just add their extension to the list above. For example to block movie files:
RewriteRule \.(mov|avi|wmv|mpe?g)$ - [F]
The Hot-Linking prevention is based on an Apache module called ModRewrite.
Redirection:
The Apache web server provides several way for setting up redirects.
The most simple one is using the “Redirect” directive:
Redirect /folder
http://www.example.com/newfolder
With such a line in your .htaccess if a visitor tries to load
http://www.example.com/folder
he will be redirected to
http://www.example.com/newfolder
You can add a status code to the Redirect directive. For example for Permanent 301 redirect you can use:
Redirect permanent /folder
http://www.example.com/newfolder
Another useful directive is the RedirectMatch. With it you can use regular expressions in the redirect condition. For example
RedirectMatch "\.html$"
http://www.example.com/index.php
This will redirect all requests to files that end with .html to the index.php file.
Introduction to mod_rewrite and some basic examples:
Create easy to remember URLs or also known as COOL URIs, other call them Search Engine Friendly URLs. For example you have some complicated site driven by some server-side scripting language: PHP, Perl, etc. In general its URLs will look like
http://www.example.com/view.php?cat=art ... 20&lang=en
It is not easy to remember such URL.
Using ModRewrite you can make the URL look like:
http://www.example.com/en/articles/10-2
Here is the code:
RewriteEngine On
RewriteRule ^([a-z]*)/([a-z]*)/([1-9]+)(-[1-9]+)? $
Issue: Unable to view the images from php based website
Error:
PHP Fatal error: Call to undefined function imagecreatefromstring()
Fix:
Install the following packages OR recompile your PHP with gd libraries.
gd-2.0.33-9.4.el5_4.2 (Example version only)
gd-devel-2.0.33-9.4.el5_4.2
php-gd-5.2.12-3.el5
Then Restart the httpd,
/etc/init.d/httpd restart
Thursday, May 20, 2010
My SQL Privilege setting for table
This can be done from control panel itself.
Insertion Denied Error
Please follow below guide for this:
http://www.psoft.net/HSdocumentation/user/mysql_support.html#userprivileges
Thanks,
Wednesday, May 19, 2010
Ip Block and Unblock
Through IP tables
iptables -nL |grep 96.252.13.66
The above command used to grep the particular ip from the iptables.
iptables -A INPUT -s 96.252.13.66 -j ACCEPT
The above command used to ALLOW the IP for our server
iptables -D INPUT -s 96.252.13.66 -j DROP
The above command used to DROP the IP for our server
Through CSF firewall
You can do the same operation through CSF firewall also
csf -r --> Used to Restart the CSF firewall>
csf -d ip -->Used to Deny the IP for our server
csf -a ip -->Used to Allow the IP for our Server
Invalid maildirsize file Error in cpanel
If you see the error "Invalid maildirsize file" when trying to update your email account password, or change the quota, or if you are just having issues with logging in you should try this:
Log into cPanel, click on File Manager, click on the folder icon next to the mail folder, click on the folder icon next to the domain name, click on the folder icon next to the email user name, then click on the file called maildirsize in that folder (don't click on the icon but the file's name itself). In the upper right hand list of links, click to delete the file. Once you delete it, it will reform for the account automatically and it should then have the correct quota size.
Sample Server php mail script
$to = "testsimp@gmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("
Message successfully sent!
");} else {
echo("
Message delivery failed...
");}
?>
Monday, May 17, 2010
Online Tools
Find your public IP:
http://whatismyip.com
http://myipaddress.com
performance check of Websites:
http://www.websiteoptimization.com/services/analyze/
http://alertra.com/spotcheck.php
http://www.siteuptime.com/users/quickcheck.php
http://host-tracker.com/
Black Listing Check for IP:
http://www.mxtoolbox.com/blacklists.aspx
http://www.au.sorbs.net/
http://dsbl.org/main
http://spamblock.outblaze.com/
http://www.spamcop.net/
http://www.spamhaus.org/index.lasso
http://njabl.org/lookup.html
PING test
http://network-tools.com/
http://www.websitepulse.com/help/testtools.ping-test.html
http://www.selfseo.com/ping_test.php
http://www.buildtelligence.com/online-ping-test.htm
Network Information of Website:
http://who.is/
http://checkdns.net/
http://intodns.com/
Zone NS Lookups
http://www.zoneedit.com/lookup.html
To visually Trace Route your IP
http://www.yougetsignal.com/tools/visual-tracert/
IP Location Tool
http://www.yougetsignal.com/tools/network-location/
To check Open port Of a connection
http://www.yougetsignal.com/tools/open-ports/
To check the websites residing in a Web server
http://www.yougetsignal.com/tools/web-sites-on-web-server/
Proxy-Links
http://anonymouse.org/anonwww.html
http://cowspy.com/
http://www.megaproxy.com/