Posts from the ‘POSTS’ Category
To change user password in hosting controller panel :
goto hosting controller panel >> User Manager >> Click Username
goto hosting controller panel >> User Manager >> Click Username
Categories: POSTS
=======================
/usr/local/nagios/etc/hosts
servername.cfg
/usr/local/nagios/etc/objects
hostgroups.cfg
=========================
/usr/local/nagios/etc/hosts
servername.cfg
/usr/local/nagios/etc/objects
hostgroups.cfg
=========================
http://www.unixmen.com/linux-tutorials/285-add-linux-host-to-nagios-server
Categories: POSTS
Note : cpanel versions 11.X differs from
their predecessors’ behaviour.
Tried once : vi /var/cpanel/cpanel.config and change entry
“maxemailsperhour=200″ as you wish.
you can change the default maximum emails per hour by updating
the file via SSH accessing the server.
[root@server ~]#vi /var/cpanel/maxemailsperhour
or
/var/cpanel/maxemailsperdomain
=====
You can change from path /var/cpanel/users/username for particular user.
or
From whm tweak settings(for all)
or
from whm, “configserver mail manage” plugin.
You can change from path /var/cpanel/users/username for particular user.
or
From whm tweak settings(for all)
or
from whm, “configserver mail manage” plugin.
Categories: POSTS Tags: max mail per hour
On following url, online speller is available :
Alpha
Bravo
Charlie
Delta
Echo
Foxtrot
Golf
Hotel
India
Juliet
Kilo
Lima
Mike
November
Oscar
Papa
Quebec
Romeo
Sierra
Tango
Uniform
Victor
Whiskey
X-ray
Yankee
Zulu
Categories: POSTS
Author : Christopher Negus
Book :
Fedora 6 and Red Hat Enterprise Linux Bible
http://flylib.com/books/en/4.99.1.2/1/
Categories: POSTS
Commands for exim :
• To view mailque list : exim -bp
• Print count only : exim –bpc
• cd /var/spool/exim/input It gives path of mailque.
• /usr/sbin/ Contains the exim command.
• /var/log/exim directory Contains the log file and temporary files associated with the messages in the mail queue.
• exim configuration file /etc/exim.conf
• exim -qf command to force mailque run
exim -bp mailq — The mailq is relevant as it gives your the email IDs.
exim -M emailID force delivery of one message
exim -qf Force another queue run
exim -qff Force another queue run and attempt to flush frozen messages
exim -Mvl messageID View Log for message
exim -Mvb messageID View Body for message
exim -Mvh messageID View Header for message
exim -Mrm messageID Remove message (no errors sent)
exim -Mg messageID Give up and fail message, message bounces to sender
• Print count only : exim –bpc
• cd /var/spool/exim/input It gives path of mailque.
• /usr/sbin/ Contains the exim command.
• /var/log/exim directory Contains the log file and temporary files associated with the messages in the mail queue.
• exim configuration file /etc/exim.conf
• exim -qf command to force mailque run
exim -bp mailq — The mailq is relevant as it gives your the email IDs.
exim -M emailID force delivery of one message
exim -qf Force another queue run
exim -qff Force another queue run and attempt to flush frozen messages
exim -Mvl messageID View Log for message
exim -Mvb messageID View Body for message
exim -Mvh messageID View Header for message
exim -Mrm messageID Remove message (no errors sent)
exim -Mg messageID Give up and fail message, message bounces to sender
•
Commands for sendmail :
·
To view mailque list : mailq OR sendmail -bp
·
Print list of mailque ID list only : sendmail –bp
·
cd /var/spool/mqueue/ It gives path of
mailque.
·
/usr/sbin/mailq Contains
the mailq command.
·
/var/spool/mqueue directory Contains the log file and
temporary files associated with the messages in the mail queue.
·
sendmail configuration file sendmail.cf
·
sendmail -v –q : This command will
force sendmail to become verbose so that debugging turns into an easy job.
Categories: POSTS
file name :
my.cnf
Categories: POSTS
Limit receiving message size using filter
For limiting a receiving message size on cPanel servers we can
make use of account level exim filters .
You will need to edit them manually as there is no option for
limiting size of the message through cPanel interface.
Following filter script has been tested and it worked
successfully.
Edit file /etc/vfilters/yourdomain.com and paste the following
rule :
Code:
# Exim filter
#Rule1
if
$message_body_size is above 3M then
mail
to $sender_address
from bounce@yourdomain.com
subject “RE: $header_subject:”
fail “Your message was over 3MB size limit and so it was not delivered.”
seen finish
endifSave changes and exit.
# Exim filter
#Rule1
if
$message_body_size is above 3M then
to $sender_address
from bounce@yourdomain.com
subject “RE: $header_subject:”
fail “Your message was over 3MB size limit and so it was not delivered.”
seen finish
endifSave changes and exit.
Now edit /home/username/.cpanel/filter.yaml and paste the
following rule :
Code:
—
filter:
-
actions:
-
action: fail
dest: Your message was over 3MB size limit and so it was not delivered.
filtername: Rule1
rules:
-
match: is
opt: or
part: “$message_body_size:”
val: 3MSave changes and exit.
—
filter:
-
actions:
-
action: fail
dest: Your message was over 3MB size limit and so it was not delivered.
filtername: Rule1
rules:
-
match: is
opt: or
part: “$message_body_size:”
val: 3MSave changes and exit.
You can now send a test email of size more than the specified
limit in the filter , here it is 3M and then send it to the emailuser set under
yourdomain.com (example : receiver@yourdomain.com).
The exim logs will show the following message :
Code:
2010-07-20 18:00:00 1ObGml-0007Q6-BJ ** receiver@yourdomain.com R=central_filter: Your message was over 3MB size limit and so it was not delivered.And the sender will receive the mail delivery failed message :
2010-07-20 18:00:00 1ObGml-0007Q6-BJ ** receiver@yourdomain.com R=central_filter: Your message was over 3MB size limit and so it was not delivered.And the sender will receive the mail delivery failed message :
Code:
This message was created automatically by mail delivery software.
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of
its
recipients. This is a permanent error. The following address(es) failed:
recipients. This is a permanent error. The following address(es) failed:
bounce@yourdomain.com
Your message was over 3MB size limit and so it was not delivered.
Your message was over 3MB size limit and so it was not delivered.
**************************************************
*********** message body which was sent**************
**************************************************
*********** message body which was sent**************
**************************************************
################################################################
===================
===================
http://forums.cpanel.net/f43/account-level-spam-filter-redirect-spam-box-138185.html
Unchecked script :
if $local_part_suffix is “support” and $message_size is above 3m
then
mail
to $sender_address
from Support@mydomain.com
subject “RE: $h_subject:”
test “$sender_address , $h_subject: , $tod_ful \n\nYour message was over our 3MB size limit and was not processed please try truncating your message and send again.
seen finish
endif
to $sender_address
from Support@mydomain.com
subject “RE: $h_subject:”
test “$sender_address , $h_subject: , $tod_ful \n\nYour message was over our 3MB size limit and was not processed please try truncating your message and send again.
seen finish
endif
Categories: POSTS
take backup of /var/lib/rpm
remove __db.00*
rpm –rebuilddb
remove __db.00*
rpm –rebuilddb
Note : Unchecked
Categories: POSTS
vi /etc/csf/csf.conf
#IP to allow remote MySQL##
tcp|in|d=3306|s=123.345.789.123
tcp|in|d=3306|s=123.345.789.123
BCC Facility
Add this code to /etc/exim_……_
##———————————————————————————————
# The below catches all incoming as well as outgoing messages for a domain “remunance.com”
# The below catches all incoming as well as outgoing messages for a domain “remunance.com”
if first_delivery
and (“$h_to:, $h_cc:” contains “abc.xyz.com”)
or (“$h_from:” contains “abc.xyz.com”)
then
unseen deliver “destination@jkl.com”
endif
##———————————————————————————————
and (“$h_to:, $h_cc:” contains “abc.xyz.com”)
or (“$h_from:” contains “abc.xyz.com”)
then
unseen deliver “destination@jkl.com”
endif
##———————————————————————————————
Categories: POSTS
Perfect Document For Shell Scripting Beginners
Categories: POSTS
Redhat Guide
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4/html/System_Administration_Guide/index.html
http://www.ucertify.com/certifications/RedHat/redhat-linux-system-administration.html
Categories: POSTS
Joomla Component Error
404 – Component not foundYou may not be able to visit this page
because of:an out-of-date bookmark/favouritea search engine that has an
out-of-date listing for this sitea mistyped addressyou have no access to this
pageThe requested resource was not found.An error has occurred while processing
your request.Please try one of the following pages:
Try :
Global configuration -> SEO settings -> Search engine
friendly URLs -> No
Read more: http://magneticmerchandising.com/cms153/joomla-questions/joomla-page-error/html#ixzz1Ojdhsu5G
Categories: POSTS
Recover Password For Cube Cart Admin Section
goto cpanel >> phpmyadmin
edit table CubeCart_admin_users
enter password directly and set password function to MD5 and
save.
Categories: POSTS
Memory / Cache
Drop Command
echo -1 > /proc/sys/vm/drop_caches
Categories: POSTS
Ntsysv : Linux /
Unix Command
NAME
ntsysv – simple interface for configuring runlevels
SYNOPSIS
SYNOPSIS
ntsysv [--back] [--level ]
DESCRIPTION
DESCRIPTION
ntsysv is a simple interface for configuring runlevel services
which are also configurable through chkconfig. By default, it configures the
current runlevel. If the user would like to configure other runlevels, those levels
can be specified on the command line by listing the levels after –levels,
without any spaces. For example, the option –levels 016 edits runlevels 0, 1,
and 6.
A service is considered to be started in the runlevel set if it is started in any of the runlevels which are being edited.
A service is considered to be started in the runlevel set if it is started in any of the runlevels which are being edited.
The ntsysv window normally contains a Cancel button. If –back is
specified, a Back button appears instead.
RETURN CODES
ntsysv returns 0 on success, 2 on error, and 1 if the user
cancelled (or backed out of) the program.
SEE ALSO
chkconfig(8), serviceconf(8)
Categories: POSTS
Command To List Size Of All Files In A Directory And
Its Subdirectories
du 0sch *
Categories: POSTS
Http Not Working ( Delete Apache Resources And Restart
Apache Command)
ipcs -s | grep nobody | perl -e ‘while () { @a=split(/\s+/);
print `ipcrm sem $a[1]`}’
Categories: POSTS
Moodle Error
CASE :
Solution used for installing moodle through fantastico :
Once moodle was installed, it showed error “Web server software (Web Server) is not supported, sorry.”
————
I tried the change, “Change if (stripos($_SERVER['SERVER_SOFTWARE'], ‘apache’) !== false) {
Once moodle was installed, it showed error “Web server software (Web Server) is not supported, sorry.”
————
I tried the change, “Change if (stripos($_SERVER['SERVER_SOFTWARE'], ‘apache’) !== false) {
to:
if (stripos($_SERVER['SERVER_SOFTWARE'], ‘webserverx’) !==
false) {“
Moodle works afterwards.
Hidden Files Are Not Showing In
File Manager
goto cpanel >> click “file manager” icon >> an alert
window will open, check option “show hidden files”
Categories: POSTS
Databases Not Showing In Cpanel
Just run script /scripts/upcp
It should fix the issue.
It should fix the issue.
Categories: POSTS
How To Install Fantastico On CPanel/WHM
Just SSH to your server and enter following commands (you may
also copy/paste):
cd /usr/local/cpanel/whostmgr/docroot/cgi
wget -N http://files.betaservant.com/files/free/fantastico_whm_admin.tgz
tar -xzpf fantastico_whm_admin.tgz
rm -rf fantastico_whm_admin.tgz
wget -N http://files.betaservant.com/files/free/fantastico_whm_admin.tgz
tar -xzpf fantastico_whm_admin.tgz
rm -rf fantastico_whm_admin.tgz
NOW GO TO YOUR WHM -> Add-Ons (Plugins on v11.x or higher)
-> Fantastico De Luxe WHM Admin (scroll down the left menu).
Categories: POSTS
How To Find Out If Harddisk Failing
There are a few ways to check for signs of drive failure on a
CentOS/Cpanel server. The easiest is as root user run the command
“/scripts/smartcheck”. This will check the disk for errors using Cpanel’s built
in script if there are no errors returned here no further investigation is
required. If an error is returned the command to investigate further is
“smartctl -a /dev/[disk]” were [disk] is the disk with the reported error. If
the server is using a RAID array the first command listed will not work. The
only way to check for errors on a RAID array server is the smartctl command but
the syntax is different. The command for RAID array servers is “smartctl -a
/dev/twa0 -d 3ware,[X]” or “smartctl -a /dev/twe0 -d 3ware,[X]” were [X] is a
number 0-3. The number represents the disk in order from p0 to p3.
The smartctl command presents a lot of information and the
values it shows can vary depending on the drive. For more information on the
SMART values wikipedia has a lot of good information about each one.
http://en.wikipedia.org/wiki/S.M.A.R.T.
Categories: POSTS
Redirect Users To Use Www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.mt-example\.com$ [NC]
RewriteRule ^(.*)$ http://www.mt-example.com/$1 [L,R=301]
Categories: POSTS
RVSitebuilder
Licence Error
Run these commands :
rm -f /var/cpanel/rvglobalsoft/rvsitebuilder/rvsitebuilder.lic
rm -f /var/cpanel/rvglobalsoft/rvsitebuilder/rvsitebuilder-pro.lic
perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi
rm -f /var/cpanel/rvglobalsoft/rvsitebuilder/rvsitebuilder-pro.lic
perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi
Categories: POSTS
Mod Security File Path
vi /usr/local/apache/conf/modsec2.user.conf
If changes made, restart apache service.
Categories: POSTS
Ajax Failure Error
In Cpanel
most probable solution :
/scripts/upcp
Try this also,
/etc/init.d/cpanel restart
Categories: POSTS
How To Install Csf
On Server?
http://www.configserver.com/free/csf/install.txt
STEPS :
1.Uninstallation
1.Uninstallation
==============
Removing csf and lfd is even more simple:
On cPanel servers:
cd /etc/csf
On cPanel servers:
cd /etc/csf
sh uninstall.sh
2.Installation
============
Installation is quite straightforward:
rm -fv csf.tgz
rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
3.csf.conf some parameters value :
CT_LIMIT = “150″TESTING = “1″TCP_IN = “……..,5666,………….”
note : 5666 nagios port
4. csf -r
note : 5666 nagios port
4. csf -r
Categories: POSTS
How To Completely Clean Your Hacked WordPress Installation
Note : Here we are reinstalling the wordpress.
1. Backup The Site And The Database.
Even a hacked copy of your blog still probably contains valuable
information and files. You don’t want to lose this data if something goes wrong
with the cleanup process. Worst case scenario you can just restore things back
to their hacked state and start over.
2. Make A Copy Of Any Uploaded Files, Such As Images,
That Are Referenced.
Images are generally exempt from posing a security risk, and
ones that you uploaded yourself (as opposed to ones included with a theme, for
instance) will be harder to track down and replace after things are fixed
again. Therefore it is usually a good idea to grab a copy of all the images in
your upload folder so as to avoid broken images in posts later. If you have any
non-image files that could potentially have been compromised, such as zip
files, plugins, or php scripts that you were offering people, then it is a good
idea to grab fresh copies of those from the original source.
3. Download A Fresh Version Of WP, All Of The Plugins
You Need, And A Clean Template.
Using the WordPress automatic upgrade
plugin does make it easier to upgrade every time a new version comes out.
However, it only replaces WordPress specific files, and does not delete
obsolete ones. It also leaves your current themes and plugins in place, as is.
This means that if used to upgrade a blog that has already been compromised, it
can very well leave the attackers a way back in. It is best to start over from
scratch as far as the files portion of your installation goes. Note that if you
use the EasyWP
WordPress Installer script
that I wrote it saves you from having to download, unzip, and then upload all
of the core WordPress files, although you will still need to grab fresh copies
of the themes and plugins that you want to use.
4. Delete All Of The Files And Folders In The WP
Directory, Either Through FTP (Slower) Or Through CPanel’s File Manager
(Faster).
Now that you have fresh copies of all the files you need, and
copied all of your uploaded images, completely delete the entire directory
structure your blog is in. This is the only surefire way to completely remove
all possibly infected files. You can do this through FTP, but due to the way
that FTP handles folder deletion (ie. it walks the directory structure, stores
each and every file name that needs to be deleted, and then sends a delete
command for each one), this can be slow and in some instances cause you to get
disconnected due to flooding the server with FTP commands. If available it is
much faster to do this through either cPanel’s File Manager, or via command
line if you happen to have shell access.
5. Re-Upload The New Fresh Copies You Just Grabbed.
This step should be self explanatory,
but I would like to mention that if your FTP client supports it (I use FileZilla, which does) and your
host allows it, then increasing the number of simultaneous connections you use
to upload can greatly reduce your overall transfer time, especially on servers
or ISP’s where latency is more of an issue than bandwidth. In FileZilla this
setting is found by going to “Edit -> Settings -> File transfer settings”:

Also, if not using the EasyWP
WordPress Installer script,
don’t forget to edit and rename your wp-config.php file (when freshly unzipped
this is named wp-config-sample.php).
6. Run The Database Upgrade (Point Your Browser At
/Wp-Admin/Upgrade.Php).
This will make any necessary changes to your database structure
to support the newest version of WordPress.
7. Immediately Change Your Admin Password.
If you have more than one admin
(meaning any user with editing capabilities), and cannot get the others to
change their passwords right then, I would change their user levels until they
can change their passwords as well. If there is anyone in your user list that
has editing capabilities, and you do not recognize them, it’s probably best to
just delete them altogether. If changing passwords is something you hate doing,
then maybe my new memorable password generator can make that a little less stressful
for you. 
8. Go Through The Posts And Repair Any Damage In The
Posts Themselves.
Delete any links or iframes that were inserted, and restore any
lost content. Google and Yahoo’s caches are often a good source of what used to
be there if anything got overwritten. The following query run against the
database can help you isolate which posts you want to look at:
SELECT * FROM wp_posts WHERE post_content LIKE '%<iframe%'
UNION
SELECT * FROM wp_posts WHERE post_content LIKE '%<noscript%'
UNION
SELECT * FROM wp_posts WHERE post_content LIKE '%display:%'
If you did not change the default prefix for WordPress tables,
than you can copy and paste that directly into a query window and run it, and
it should pull up any posts that have been modified to hide content using any
of the methods I have come across so far (iframes, noscript tags, and
display:none style attributes). To get to a query window in cPanel, you would
click on the MySQL® Databases icon, scroll to the bottom of the page, and then
click on phpMyAdmin. Once the new window or tab opens, you would click on the
database in the left hand side that your blog was in, and then in the right
side at the top click on the SQL tab. Then just paste the query into the large
text area and hit the Go button.
Note, however, that there may be other types of injected content
that I haven’t seen yet, and that a manual inspection looking for the types of
patterns that first alerted you to the fact that your blog was hacked is always
a good idea.
UPDATE: 9. If You Are Having Issues Cleaning The
Installation Yourself
When I wrote this post back in 2008 I
intended it to be a do it yourself guide for the non-techie. However, I do
realize that some people would still rather a professional programmer perform
many of the steps I outlined here. If anyone has had their WordPress
installation hacked, and either is uncomfortable attempting to clean it on
their own, or has tried to do so with no success, I am available on a case by
case basis. Most cleanings can be performed in about one hour, two at the most.
The time can vary depending on the size of the blog, the amount of
customization to the original theme, and the number of plugins installed. Feel
free to contact me here if you feel like you could benefit
from my help. Please include the site and any details that you think might be
relevant (pro theme, anything you may have tried on your own, etc.) in the
contact form.
UPDATE #2: 10. A Note On Hosting.
This past year (2010) has seen
multiple waves of attacks on people’s websites that happened not due to
insecurities within the WordPress platform itself, as has historically been the
issue, but rather due to vulnerabilities with the actual hosts. Some of the
bigger names that were hit include GoDaddy, Rackspace
Cloud, MediaTemple, and Network
Solutions, for instance. It is very important that you use a host
that is not only well versed in security, but one that is stable and has
knowledgeable tech support as well.
My personal recommendation for shared
hosting is HostGator. It is where this blog
and many other sites of mine are currently hosted. Yes, that is an aff. link,
but I would recommend them even if it wasn’t. For a dedicated solution that is
both affordable and robust I use The
Planet, which is where I host Bad Neighborhood. Both companies
are ones that I have been using for years without issues, and that I do
recommend to my own clients when they find themselves dissatisfied with their
current hosts. If you were hacked, and your WordPress was up to date when it
happened, then a change of hosts is something you should consider looking into.
Malwares Checking In Files
grep -ilr “iframe” *
grep -ilr “eval(base64_decode” *
most probably search : grep -ilr “eval(unescape” *
grep -ilr “eval(base64_decode” *
most probably search : grep -ilr “eval(unescape” *
Categories: POSTS
Cron Jobs
You can set cronjob directly in your account or through cpanel.
Through cpanel :
Goto cpanel >> cronjobs >> select time and then add
the path of cron file which must be saved in your hosting account.
The cronjob will be executed when the time trigger is met/fired.
Through file :
You will need to add code in cron file of account directly.
Open cron file : crontab -e -u clubbttm
Add code like,
* * * * * /usr/bin/wget
http://download.rvglobalsoft.com/rvsitebuilderinstaller.tar
This command will download the file rvsitebuilderinstaller.tar
in your home directory every minute.
Syntax Of Crontab (Field Description)
1 2 3 4 5 /path/to/command arg1 arg2
Where,
· 1: Minute (0-59)
· 2: Hours (0-23)
· 3: Day (0-31)
· 4: Month (0-12 [12 == December])
· 5: Day of the week(0-7 [7 or 0 == sunday])
· /path/to/command - Script or command name to schedule
How Do I Disable Email Output?
By default the output of a command or a script (if any
produced), will be email to your local email account. To stop receiving email
output from crontab you need to append >/dev/null 2>&1. For example:
0 3 * * * /root/backup.sh >/dev/null 2>&1
REFERENCE :
http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/ ( very good explanation here )
Categories: POSTS
Httpd.Conf File Changes Retention Script
/usr/local/cpanel/bin/apache_conf_distiller –update
Categories: POSTS
Domain Masking
Index.Html Code
<html>
<head>
<title>yourname</title>
<meta name=”description” content=”your description”>
<meta name=”keywords” content=”keyword1, keyword2″>
</head>
<frameset rows=”100%,0″ border=”0″>
<frame src=”http://yourforwardingurl” frameborder=”0″>
<frame frameborder=”0″>
</frameset>
</html>
<head>
<title>yourname</title>
<meta name=”description” content=”your description”>
<meta name=”keywords” content=”keyword1, keyword2″>
</head>
<frameset rows=”100%,0″ border=”0″>
<frame src=”http://yourforwardingurl” frameborder=”0″>
<frame frameborder=”0″>
</frameset>
</html>
Categories: POSTS
Set Redirect
Using .Htaccess
# This allows you to redirect your entire website to any other
domain
Redirect 301 / http://kb.mediatemple.net/
# This allows you to redirect index.html to a specific subfolder
Redirect /index.html http://mt-example.com/newdirectory/
# Redirect old file path to new file path
Redirect /olddirectory/oldfile.html
http://mt-example.com/newdirectory/newfile.html
# Provide Specific Index Page (Set the default handler)
DirectoryIndex index.html
Useful urls :
Categories: POSTS
Rvsitebuilder Issue ( “Cannot Connect To Domain-Name Using
Fsockopen, Please Make Sure Huntersdojho.Com Resolve To The Server Correctly
And Outgoing TCP Port 80 Is Opened.”
Check whether it is resolving to server correctly and if still
issue persists, flush firewall i.e.
#csf -r
Categories: POSTS
Nobody Mails Not Working ( Php Mail Not Working )
Things to check :
First, make the form page mail.html (you may call it whatever you like)…
<html>
<head><title>Mail sender</title></head>
<body>
<form action=”mail.php” method=”POST”>
<b>Email</b><br>
<input type=”text” name=”email” size=40>
<p><b>Subject</b><br>
<input type=”text” name=”subject” size=40>
<p><b>Message</b><br>
<textarea cols=40 rows=10 name=”message”></textarea>
<p><input type=”submit” value=” Send “>
</form>
</body>
</html>
<head><title>Mail sender</title></head>
<body>
<form action=”mail.php” method=”POST”>
<b>Email</b><br>
<input type=”text” name=”email” size=40>
<p><b>Subject</b><br>
<input type=”text” name=”subject” size=40>
<p><b>Message</b><br>
<textarea cols=40 rows=10 name=”message”></textarea>
<p><input type=”submit” value=” Send “>
</form>
</body>
</html>
==========
When the user fills in the form and hits the Send button,
the mail.php file
is called…
<html>
<head><title>PHP Mail Sender</title></head>
<body>
<?php
<head><title>PHP Mail Sender</title></head>
<body>
<?php
/* All form fields are
automatically passed to the PHP script through the array $HTTP_POST_VARS. */
$email = $HTTP_POST_VARS['email'];
$subject = $HTTP_POST_VARS['subject'];
$message = $HTTP_POST_VARS['message'];
$email = $HTTP_POST_VARS['email'];
$subject = $HTTP_POST_VARS['subject'];
$message = $HTTP_POST_VARS['message'];
/* PHP form validation: the script
checks that the Email field contains a valid email address and the Subject
field isn’t empty. preg_match performs a regular expression match. It’s a very
powerful PHP function to validate form fields and other strings – see PHP
manual for details. */
if (!preg_match(“/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/”, $email)) {
echo “<h4>Invalid email address</h4>”;
echo “<a href=’javascript:history.back(1);’>Back</a>”;
} elseif ($subject == “”) {
echo “<h4>No subject</h4>”;
echo “<a href=’javascript:history.back(1);’>Back</a>”;
}
if (!preg_match(“/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/”, $email)) {
echo “<h4>Invalid email address</h4>”;
echo “<a href=’javascript:history.back(1);’>Back</a>”;
} elseif ($subject == “”) {
echo “<h4>No subject</h4>”;
echo “<a href=’javascript:history.back(1);’>Back</a>”;
}
/* Sends the mail and outputs the
“Thank you” string if the mail is successfully sent, or the error string
otherwise. */
elseif (mail($email,$subject,$message)) {
echo “<h4>Thank you for sending email</h4>”;
} else {
echo “<h4>Can’t send email to $email</h4>”;
}
?>
</body>
</html>
elseif (mail($email,$subject,$message)) {
echo “<h4>Thank you for sending email</h4>”;
} else {
echo “<h4>Can’t send email to $email</h4>”;
}
?>
</body>
</html>
================
Then check whether the script sends mail to the email address
specified in form.
================
================
Check in WHM :
goto whm >> tweak settings >> ensure following
option is disabled.
Prevent the user “nobody” from sending out
mail to remote addresses (PHP
and CGI scripts generally run as nobody if you are not using PHPSuexec and
Suexec respectively.)
|
Categories: POSTS
Installing Poweradmin
Refer : (unchecked solution)
Categories: POSTS
Digital Millennium Copyright Act (DMCA) Complaint And
Counter Application
Refer :
Categories: POSTS
IPTABLES : BASIC
CHECK FROM IP BLOCK :
iptables -nL | grep IP
iptables -L -n |grep IP
ALLOW AN IP IN IPTABLES
iptables -A INPUT -s IP -j ACCEPT
SAVE CHANGES IN IPTABLES
service iptables save
EXAMPLE :
# route -nKernel IP routing tableDestination
Gateway Genmask Flags
Metric Ref Use Iface67.23.226.130 0.0.0.0
255.255.255.255 UH 0 0
0 eth076.102.169.186 -
255.255.255.255 !H 0 -
0 -67.23.226.131 0.0.0.0
255.255.255.255 UH 0 0
0 eth067.23.226.134 0.0.0.0
255.255.255.255 UH 0 0
0 eth067.23.226.135 0.0.0.0 255.255.255.255
UH 0 0 0
eth067.23.226.132 0.0.0.0 255.255.255.255 UH
0 0 0
eth067.23.226.133 0.0.0.0 255.255.255.255 UH
0 0 0
eth072.29.95.172 -
255.255.255.255 !H 0 -
0 -67.23.226.138 0.0.0.0
255.255.255.255 UH 0 0
0 eth067.23.226.136 0.0.0.0
255.255.255.255 UH 0 0
0 eth067.23.226.137 0.0.0.0
255.255.255.255 UH 0 0
0 eth067.23.226.0 0.0.0.0
255.255.255.0 U 0 0
0 eth0169.254.0.0 0.0.0.0
255.255.0.0 U 0 0
0 eth00.0.0.0 67.23.226.1
0.0.0.0 UG 0
0 0 eth0# ip route del 72.29.95.172# ip
route del 76.102.169.186# iptables -nL | grep 76.102.169.186# iptables -nL |
grep 72.29.95.172 all –
72.29.95.172 0.0.0.0/0DROP
all – 72.29.95.172
0.0.0.0/0ACCEPT all – 72.29.95.172
0.0.0.0/0ACCEPT all – 0.0.0.0/0
72.29.95.172# csf -a 72.29.95.172add failed:
72.29.95.172 is in already in the allow file /etc/csf/csf.allow# vim
/etc/sysconfig/iptables# /etc/init.d/iptables saveSaving firewall rules to
/etc/sysconfig/iptables: [ OK ]#
/etc/init.d/iptables restartFlushing firewall rules:
[ OK ]Setting chains to policy ACCEPT: mangle
filter [ OK ]Unloading
iptables modules:
[ OK
]Applying iptables firewall rules:
SSL
Certificate Installation
SSL Certificate Installation
__________________________________________________________________________
Introduction
Refers to the digital certificate used with the most popular
security protocol on the Internet. When you make a purchase on the Web and
notice the closed lock icon at the top or bottom of your browser or the
HTTPS:// prefix in the URL, it means you have established a secure SSL
connection.
Your browser has examined the signed certificate received from
the Web site, determined it to be authentic and secret keys have been computed
at both ends of the connection. All the information you enter online is encrypted
before being sent to the server
1 – SSL
Certificate creation with cPanel WHM
a. Open a Web browser and navigate to:
https://serverIP:2086
b. Enter your root user name and the password that you specified
when you set up your account
c. Click OK.
d. Click Generate a SSL Certificate and Signing Request through the Web SSL/TLS menu
e. Enter the following information:
-Email address (where cert is sent)
-Host name
-Country
-State
-City
-Company Name
-Company Division
-Email address (displayed in cert)
-Password
f. Click Create. Your certificate information will display. Copy the RSA private key output into a text file so that you are able to use your certificate. Save this information carefully.
g. Click SSL Manager through SSL/TLS menu
h. Click the floppy drive icon of the appropriate certificate signing request in the CSRS column. Your certificate request information will display.
i. Get your cert signed using the certificate request information through SSL signing authority. The signing authority will send you a signed CRT and CA file. This file is referred to as an intermediate certificate or chaining file.
c. Click OK.
d. Click Generate a SSL Certificate and Signing Request through the Web SSL/TLS menu
e. Enter the following information:
-Email address (where cert is sent)
-Host name
-Country
-State
-City
-Company Name
-Company Division
-Email address (displayed in cert)
-Password
f. Click Create. Your certificate information will display. Copy the RSA private key output into a text file so that you are able to use your certificate. Save this information carefully.
g. Click SSL Manager through SSL/TLS menu
h. Click the floppy drive icon of the appropriate certificate signing request in the CSRS column. Your certificate request information will display.
i. Get your cert signed using the certificate request information through SSL signing authority. The signing authority will send you a signed CRT and CA file. This file is referred to as an intermediate certificate or chaining file.
Notes:
2 – SSL
Certificate installation with cPanel WHM
a.Open a Web browser and navigate to:
https://serverIP:2086
b. Enter your root user name and the password you specified when
you set up your account.
c. Click OK.
d. Click Install a SSL Certificate and Setup the Domain through Web SSL/TLS menu
e. Paste your signed SSL certificate from the signing authority into the crt text box.
f. Paste your RSA private key info saved from the previous procedure into the key text box.
g. If received from the signing authority, paste the CA bundle (or intermediate certificate) into the ca text box.
h. Confirm the domain, user, and IP address, and then click Do it
c. Click OK.
d. Click Install a SSL Certificate and Setup the Domain through Web SSL/TLS menu
e. Paste your signed SSL certificate from the signing authority into the crt text box.
f. Paste your RSA private key info saved from the previous procedure into the key text box.
g. If received from the signing authority, paste the CA bundle (or intermediate certificate) into the ca text box.
h. Confirm the domain, user, and IP address, and then click Do it
Categories: POSTS
How To Install Ioncube ?
cd /usr/local
wget
http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.
tar.gztar -zxvf gz-file-which-was-downloaded-using-wget-command
Categories: POSTS
How To
Install RVSiteBuilder?
1.
After get the license confirmation,
SSH to your cPanel server as root and run command
/scripts/makecpphp
2.
download the installer using the
command below:
cd
/usr/local/cpanel/whostmgr/docroot/cgi/
rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/
rm -f rvsitebuilderinstaller.tar
wget http://download.rvglobalsoft.com/rvsitebuilderinstaller.tar
tar -xvf rvsitebuilderinstaller.tar
chmod 755 addon_rvsitebuilder.cgi
rm -f rvsitebuilderinstaller.tar
rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/
rm -f rvsitebuilderinstaller.tar
wget http://download.rvglobalsoft.com/rvsitebuilderinstaller.tar
tar -xvf rvsitebuilderinstaller.tar
chmod 755 addon_rvsitebuilder.cgi
rm -f rvsitebuilderinstaller.tar
3.
Open root WHM, at the bottom left
menu under Plugins section, you will find RVSiteBuilder Installermenu.
4.
Click RVSiteBuilder Installer to
begin the installation process.
5.
After complete the installation, you
will be sent to RVSiteBuilder Manager automatically. Please configure RV
SiteBuilder immediatly.
Categories: POSTS
Changing Index File Priority Order In Httpd.Conf
You can do it by changing the statement for file list in
the httpd.conf as you desire.
DirectoryIndex at_domains_index.html index.html index.htm
index.php index.php3 index.html.var index.shtml index.cfm
===============
Using .htaccess file :
It is possible to change the default directory index page. Say,
for example, you wanted visitors to go to notice.html instead of index.html.
All you have to add to your .htaccess file is
DirectoryIndex notice.html
This can be extended so that the server looks for other files if
it cannot find the first one.
DirectoryIndex notice.html index.cgi index.php index.html
Priority goes from left to right. So the server would look for
notice.html. If that file is not there it will look for index.cgi, then
index.php and then index.html.
Categories: POSTS
Load Is Not Showing On Server Statistics Page
(Solution for specifically configured linux servers)
cd /usr/local/apache/htdocs/
chmod 755 serverstats_inc.php
and
restart csf service
Categories: POSTS
Symbolic Links
What Are They?
Symbolic links are like shortcuts or references to the actual
file or directory. Most of the time these links are transparent when working
with them through other programs. For example you could have a link to a
directory to one hard drive inside a directory that lies on a different hard
drive and an application will still treat it the same.
Symbolic links are used all the time to link libraries and make
sure files are in consistent places without moving or copying the original.
Links are often used to “store” multiple copies of the same file in different
places but still reference to one file.
Creating A Symbolic Link
To create a symbolic link in Linux we use this syntax:
ln -s /path/to/original/
/path/to/linkName
What happens if I edit the link? Any modifications to the linked file will be changed on the
original file.
What happens if I delete the link? If you delete the link the original file is unchanged. It will still exist.
What happens if I delete the original file but not the link? The link will remain but will point to a file that does not exist. This is called an orphaned or dangling link.
What happens if I delete the link? If you delete the link the original file is unchanged. It will still exist.
What happens if I delete the original file but not the link? The link will remain but will point to a file that does not exist. This is called an orphaned or dangling link.
Creating A Hard Link
You can create a hard link like so:
ln /path/to/original.file
/path/to/link.file
The Difference Between Soft And Hard Links
Hard Links
·
Only link to a file not a directory
·
Can not reference a file on a
different disk/volume
·
Links will reference a file even if
it is moved
·
Links reference inode/physical
locations on the disk
Symbolic (Soft) Links
·
Can link to directories
·
Can reference a file/folder on a
different hard disk/volume
·
Links remain if the original file is
deleted
·
Links will NOT reference the file
anymore if it is moved
·
Links reference abstract
filenames/directories and NOT physical locations. They are given their own
inode
Practice Makes Perfect
To really grasp the concept of symbolic links lets give it a
shot.
Go into the tmp directory:
cd /tmp
Make a directory
mkdir original
Copy over the host.conf file or any file to test with.
cd original
cp /etc/host.conf .
cp /etc/host.conf .
List the contents and take note of the inode (first column)
ls -ila
Create a symbolic link to host.conf called linkhost.conf
ln -s host.conf linkhost.conf
Now do list out the inodes
ln -ila
Notice how the inode for the link is different.
Now create a hard link to the same file
ln host.conf hardhost.conf
Now list the inoes one more time
ln -ila
Notice how the inode numbers are exactly the same for the hard
link and the actual file.
Lets try some file operations now
Open up linkhost.conf and edit it and save it
Now look in host.conf and notice that the changes were made
Lets move host.conf now and see if it causes any problems
mv host.conf ../
Uh oh, now when we list the directory our link turned red lets
see what is in side it
cat linkhost.conf
cat: linkhost.conf: No such file or
directory
It looks like our symbolic link is now broken as it linked to a
file name and not the inode. What about our hard link?
cat hardhost.conf
Looks like our hard link still works even though we moved the
original file. This is because the hard link was linked to the inode the
physical reference on the hard drive where the file resides. The soft link
(symbolic link) on the other hand was linked to the abstract file name and was
broken the moment we moved the file.
This leads to an interesting question. What happens if I delete
a hard link? Even though the hard link is referenced to the physical location
of the file on the hard drive though an inode, removing a hard link will not
delete the original file.
Symbolic links will remain intact but will point to a non
existent file.
Is Employee Bond Legal In India ?
Answer is NO. The complications of issue can be studied on
this link :
Outstanding post you share the great information I really like it RVsitebuilder license
ReplyDelete