Apache status
lynx –dump http://localhost/whm-server-status;
lynx –dump http://localhost/whm-server-status > /root/apache_status
NiyasHussain.comSchool Of Linux
Drug preguntas
Jun 12
Apache status lynx –dump http://localhost/whm-server-status; lynx –dump http://localhost/whm-server-status > /root/apache_status Jun 12
root@server [~]# apf –help usage /usr/local/sbin/apf [OPTION] -s|–start ……………………. load all firewall policies -a HOST CMT|–allow HOST COMMENT … add host (IP/FQDN) to allow_hosts.rules and immediately load new rule into firewall -d HOST CMT|–deny HOST COMMENT …. add host (IP/FQDN) to deny_hosts.rules and -u|–unban HOST ……………….. remove host from [glob_]deny_hosts.rules -o|–ovars ……………………. output all conifguration options root@server [~]# /usr/local/sbin/apf -u 59.176.108.175 Jun 12
Create a mail.php file using the script below and then call the file using the browser. A mail will be send to serverhelp1_24×7@yahoo.com is the php mail function works fine. mail (’serverhelp1_24×7@yahoo.com’, ‘test subject’, ‘test mail’); Jun 12
root@xxx [~]# /usr/local/cpanel/3rdparty/mailman/bin/mailmanctl start Make sure that Mailman is enabled in CPanel Tweak Settings Wink. How to fix this error in Mailing list We\’re sorry, we hit a bug! If you are the server administrator, proceed with the following steps: 1. Go to /usr/local/cpanel/3rdparty/mailman 2. ls -al 3. chmod -R 2775 ./* Check if this has fixed the issue. 4. /scripts/fixmailman Jun 12
How to Enable “Update Now” Button in Cpanel Awstats Tired of bugging your host to update Cpanel awstats? You can generate stats, update it by your own by clicking the ‘update now’ link at the top of the main page in the awstats. You can place this “update now” by yourself . Follow these steps: This applies for any subdomain as well Jun 12
How to access Awstats From Outside the control panel Accessing Awstats from outside the control panel is easy. Jun 12
Please make sure that the domain entry in the following files. /etc/userdomains (domain name and username should be present in this file) /etc/localdomains /etc/trueuserdomains Jun 12
You should configure the following in your WHM (CPanel): Main >> Server Configuration >> Tweak Settings [x] 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.) [x] Track the origin of messages sent though the mail server by adding the X-Source headers (exim 4.34+ required) Main >> Security >> Fix Insecure Permissions (Scripts) Main >> Security >> Tweak Security “Compilers are disabled for unpriviledge users” Main >> Service Configuration >> Enable/Disable SuExec suexec Status “enabled” Main >> Account Functions >> Disable or Enable Demo Mode Select from “Users” the “demo” account and click “Modify” then click “Disable” if it exists Jun 12
To setup a streaming server first you need ffmpeg installed in the server . Not only that you need associated software’s installed to and you need to custom compile to make the server a complete streaming server . you need ffpeg-php also . Login to your server as root, then: wget http://prdownloads.sourceforge.net/faac/faad2-2.0.tar.gz?download Verify that you have these components are installed If any are missing than simply yum install (packagename), if you dont have a package Installing Faac Installing Faad2 cd common/mp4ff && nano mp4ffint.h Save file and cd ../.. Download the sources to your server: LibOgg: # echo ‘extension=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so’ >> /usr/local/Zend/etc/php.ini There is a script for installing ffmpeg in the server . Please check this link http://www.cihilt.com/ffmpeg_installation_in_5min Jun 12
Howto Upgrade Perl on cPanel ============================ Automatic cPanel updates does not update Perl, instead you have to download them from http://layer1.cpanel.net Login to your server as root and run the install such as: # wget http://layer1.cpanel.net/perl587installer.tar.gz # tar -xzf perl587installer.tar.gz # cd perl587installer # ./install How to test to see if you need to upgrade or not: # perl -V Jun 12
Hi All,
Script to create userdomains and trueuserdomains in a cpanel server from /var/cpanel/users.
Put the following code in the vi /root/domains.sh
change the permission to execute the script. chmod 700 /root/domains.sh
#!/bin/sh
if [ -d /root/supportpro/ ]; then
cd /root/supportpro/
else
mkdir /root/supportpro/
cd /root/supportpro/
fi
echo > /root/supportpro/alldomainlist
echo > /root/supportpro/domainlist
echo > /root/supportpro/trueuserdomains
echo > /root/supportpro/userdomains
grep DNS /var/cpanel/users/* > /root/supportpro/alldomainlist
cat /root/supportpro/alldomainlist|\
while read line
do
echo `echo $line | awk -F = {'print $2'}`: `echo $line | awk -F : {'print $1'} | awk -F / {'print $5'}` >> /root/supportpro/userdomains
done
grep DNS= /var/cpanel/users/* > /root/supportpro/domainlist
cat /root/supportpro/domainlist|\
while read line
do
echo `echo $line | awk -F = {'print $2'}`: `echo $line | awk -F : {'print $1'} | awk -F / {'print $5'}` >> /root/supportpro/trueuserdomains
done
Jun 12
To print a count of the messages in the queue Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient) Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals): Generate and display Exim stats from a logfile: Same as above, with less verbose output: Same as above, for one particular day: Print what Exim is doing right now: Searching the queue Search the queue for messages from a specific sender: Search the queue for messages for a specific recipient/domain: To Print just the message-id of the entire queue: Managing the queue Start a queue run: Start a queue run for just local deliveries: Remove a message from the queue: Freeze a message: Deliver a specific message: Force a message to fail and bounce: Remove all frozen messages: Freeze all queued mail from a given sender: View a message’s headers: View a message’s body: View a message’s logs: Jun 12
Fantastico SSH to your server(s) and enter following commands: 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 Now go to WHM, login as root and follow the link WHM -> Add-Ons -> Fantastico De Luxe WHM Admin. Upon loading, Fantastico De Luxe WHM Admin will auto-update your existing installation. All admin files (masterfiles, tarballs, settings etc) will be moved to /var/netenberg. Also your IP need to be licensed. Fantastico Upgrading is same as the fresh installation as I described above. Jun 12
Cpanel Installation cPanel Installation Instructions: cPanel now uses a universal install script which can be found at http://layer1.cpanel.net/. You can use the following commands in the root shell to download and start the installation script: mkdir /home/cpins cd /home/cpins wget http://layer1.cpanel.net/latest sh latest Jun 12
?When I try to delete a message from webmail it fails with: ‘There was an error deleting messages from the folder “Inbox”. This is what the server said: [TRYCREATE] Mailbox does not exist.’RESOLUTIONThe most probalby you have switched to “When deleting messages, move them to your Trash folder instead of marking them as deleted?” in Horde IMP preferences under “Options” -> “Deleting and Moving Messages”. Please make sure that trash folder was created and selected under “Trash folder:” option. Steps *Login to Horde ?HORDE ERROR IN CPANELReset Horde is a solution /scripts/resethorde ?HORDE LOGIN PROBLEMHope you would have got this issue often. The client cannot able to login to his Horde account to check his mail. He would have reached till the login screen and if he click “Login” it will stay back in the same screen instead of going to his inbox. Here is the fix for it, Check the following first, 1. goto ” cd var/lib/mysql/horde ” and check if there is a file named ” horde_sessionhandler.frm ” 2. move all the file named “horde_sessionhandler” with other name 3. Or you can goto mysql and can drop the table “horde_sessionhandler”. It will show error message some times. If so use the step 2, so that the table gets moved automatically.(Remember that if you are using step2 skip the step 3) 4. Now type in shell “mysql” 5. It will take to mysql prompt . type “use horde”; 6. copy this command and paste there : CREATE TABLE horde_sessionhandler (session_id VARCHAR(32) NOT NULL, session_lastmodified INT NOT NULL, session_data LONGBLOB, PRIMARY KEY (session_id)) ENGINE = InnoDB; 7. quit from mysql and restart mysql. 8. Try now… Your issue is fixed!!!!! Jun 12
Installing RPMForge rpmforge for centos4.4 http://wiki.centos.org/Repositories/RPMForge RPMForge is a collaboration of Dag, Dries, and other packagers. They provide over 2600 packages for CentOS, including mplayer, xmms-mp3, and other popular media tools. It is not part of RedHat or CentOS but is designed to work with these major distributions. Packages are supplied in RPM format and in most cases are ready to use. Beware that some packages are newer than the official CentOS version and you should not blindly install those packages. Before you replace a CentOS package you should make sure that will not break anything important. In most cases you can revert any mistakes but it is best to avoid the mess. You should make sure that you have ProtectBase installed. Assuming you have centos extras enabled in your current yum configuration yum install yum-plugin-protectbase Edit the file /etc/yum.conf and add the following line to the [main] section: plugins=1 Edit the file /etc/yum.repos.d/CentOS-Base.repo and add the following line to the [base] and [update] section: protect=1 Edit /etc/yum.repos.d/CentOS-Base.repo and add the following line to the other sections protect=0 rpmforge Download the rpmforge-release package. Choose one of the two links below, depending on your architecture. If you are unsure of which one to use you can check your architecture with the command uname -i * i386 http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm x86_64 http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.x86_64.rpm (You can find a complete list of rpmforge-release package packages at http://dag.wieers.com/packages/rpmforge-release/ but it is recommended that you use one of the two listed above). Install DAG’s GPG key rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt Verify the package you have downloaded rpm -K rpmforge-release-0.3.6-1.el4.rf.*.rpm Security warning: The rpmforge-release package imports GPG keys into your RPM database. As long as you have verified the package and trust Dag then it should be safe. Install the package rpm -i rpmforge-release-0.3.6-1.el4.rf.*.rpm This will add a yum repository config file and import the appropriate GPG keys. Test with this command: yum check-update It should output these two lines: Loading “protectbase” plugin If so then it looks like things are working so try installing something like this yum install mplayer Hope that it works Does not have protectbase. Does have a rpmforge-release package but you don’t want it enabled Jun 12
Setting up cronjobs in Unix and Solaris
cron is a unix, solaris utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon. These tasks are often termed as cron jobs in unix , solaris.
Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times.
1. Crontab Restrictions
____________
You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use
crontab if your name does not appear in the file /usr/lib/cron/cron.deny.
If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab. The allow/deny files consist of one user name per line.
2. Crontab Commands
__________
export EDITOR=vi ;to specify a editor to open crontab file.
crontab -e Edit your crontab file, or create one if it doesn't already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.)
3)3. Crontab file
___________
Crontab syntax :-
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
* in the value field above means all legal values as in braces for that column.
The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range).
Note: The specification of days can be made in two fields: month day and weekday. If both are specified in an entry, they are cumulative meaning both of the entries will get executed .
4. Crontab Example
_______
A line in crontab file like below removes the tmp files from /home/someuser/tmp each day at 6:30 PM.
30 18 * * * rm /home/someuser/tmp/*
5. Crontab Environment
___________
cron invokes the command from the user's HOME directory with the shell, (/usr/bin/sh).
cron supplies a default environment for every shell, defining:
HOME=user's-home-directory
LOGNAME=user's-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh
Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry.
6. Disable Email
____________
By default cron jobs sends a email to the user account executing the cronjob. If this is not needed put the following command At the end of the cron job line .
>/dev/null 2>&1
7. Generate log file
________________
To collect the cron execution execution log in a file :
30 18 * * * rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log
User Cron
---------
1)/var/spool/cron
2)tail -f /var/log/cron
eg:
with this command
30 18 * * * rm /home/user/public_html/tmp/*
we can delete all files in tmp folder at 18.30 daily
Jun 12
Please check to see the packages that are not needed on a web server. You can use the command rpm -qa to list all the installed rpm packages on the server. From the list remove packages choose the packages that are not required. mtools These packages are specific to RHEL 3. It varies in different distributions. Jun 12
The command chkconfig –list will display the list of services on all runlevels. You can turn off the specific services by chkconfig off . Eg: Above are some examples of unwanted services commonly running in a server. You can stop these services immediately by using service command. service nfs stop Jun 12
Installation
Installation is quite straightforward: rm -fv csf.tgz sh disable_apf_bfd.sh That’s it. You can then configure csf and lfd in WHM, or edit the files CSF is pre configured to work on a cPanel server with all the standard cPanel You should ensure that kernel logging daemon (klogd) is enabled. Typically, VPS
Removing csf and lfd is even more simple: |
Recent Comments