EMC VPS Homepage
VPS Hosting and Web Hosting Services by EMC VPS
  Support Center  |  Web Mail  
 
  Dedicated Servers
 
Quick Links
  Sep 10, 2010
Why aren't my CGI and Perl scripts working ?

This is a very common problem, with a wide array of reasons. For this example, we have a cgi called admin.cgi that won't run from the browser. First, you want to make sure the cgi is executable. Almost all cgi's should be chmod 755. To find out, log into the shell (as the user with the cgi problem or as root) and go to the directory the cgi is in. Type "ls -al admin.cgi"; this will show you what the permissions are for the cgi in question.

Where do I find things ?

If you are trying to find a program, log into the shell.
Typing "whereis program", where 'program' is the program you are looking for, will show you one or more possibilities for what you are looking for. If you have more than one copy of a program, say one in /usr/bin and another in /usr/local/bin/ , typing "which program" will show you which one will be called first. If you can't find it at all, typing "locate program" will show you everyfile that matches "program".

Some of the most common programs :
/usr/sbin/sendmail
/usr/bin/perl
/bin/mail
/usr/bin/php

Default locations for most commonly used configuration files and important directories:

Exim
/etc/exim.conf
/var/log/exim_mainlog
/var/log/exim_rejectlog
/etc/valiases/
/etc/vfilters/
/home/username/.forward

MySQL
/root/.my.cnf
/etc/my.cnf
/var/lib/mysql/

Apache
/usr/local/apache/conf/httpd.conf
/usr/local/apache/domlogs/

System
/var/log/messages
/var/log/dmesg

Proftpd
/etc/proftpd.conf
/var/log/xferlog
/etc/proftpd/

sshd
/etc/ssh/sshd_config

Client has problem uploading and publishing with MS Frontpage ?

There are far too many reasons for this to even try to document, however if the client is using Windows XP and FP 2002, the following might help.

Have the customer add this registery setting under
HKEY_LOCAL_MACHINESOFTWARE/Microsoft/Shared Tools/Web Server Extentions

Right click Web Server Extentions
make new DWORD value
change name of new DWORD to "wecctlflags"
edit the value of "wecctlflags" to 2

Seems sometimes Front Page does not detect the proxy settings of Internet Explorer 5.0 and later

How do I find all SETUID root files on my server ?

This will show all SETUID and SETGID files on the server (assuming a good integrity of the 'find' binary):

find / -type f \( -perm -04000 -o -perm -02000 \) \-exec ls -lg {} \;

Where is the exim antivirus config file?

/etc/antivirus.exim

Suexec is breaking my cgi scripts ?

Fix cgi scripts that are returning a 500 error because of permissions :
/scripts/fixsuexeccgiscripts

This reads /usr/local/apache/logs/suexec_log and looks for errors and tries to fix them, though if you still get errors, tail that log file and see what the error is.

Trying to troubleshoot perl scripts ?

edit perl / cgi script, at top of file ...

#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);

then errors should be redirected to browser rather then getting a 500 error.

ALSO, check if the script runs on the command line,
perl -w ./scriptname.cgi and see if it gives you errors.

How do I keep my crontab from sending an email every time it runs ?

Add " >/dev/null 2>&1 " after the entry in the crontab, so that it might looks like
0 * * * * /home/uesr/backup.pl >/dev/null 2>&1

I use MS Windows, how can I log in to my server ?

You will need to download an SSH client.

We recommend one called PuTTY, which is free and may be downloaded from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

The actuall SSH client is a single binary (not an installer)
http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

For the installer, download the installer package.

How can I see all running processes from the shell ?

ps –auxww
Or
ps –cef

`man ps` for more information.

What is a quick way to see all users with the UID of 0 on the shell ?

grep :0 /etc/passwd

Whenever I setup a domain it says ndc can't connect, connection refused ....what is this?

ndc is the name daemon control program.
If you are getting that error, you should run /scripts/fixndc as root on the shell via SSH.
If the problem persists, fill out a support request to have the named configuration lookup at.

View webalizer stats without login to cpanel

cd /home/username/www
ln -s ../tmp/webalizer stats
chown username.username stats
cd ../tmp
chmod 755 ./
chmod 755 ./webalizer

----------------

Will allow domain.com/stats/ for viewing stats without logging in to cpanel

How can I find out where all a user's files are ?

If there is a discrepancy between quotas and a du -sh /home/username , chances are some other files on the system are owned by that user's UID. To find these:
find / -user username –ls

Run that and you will get a long list of all files owned by that user. It might be wise to redirect the output to a file to browse through later.

Depending on the files, it's usually better to chown them to the root user rather than delete them.

Quotas are not working, how can I fix them ?

Check for quota support on the mounted filesystems -

FreeBSD :
Output of `mount` , look for "with quotas".
/dev/ad0s1h on /home (ufs, local, with quotas, soft-updates)
In /etc/fstab
/dev/ad0s1h /home ufs rw,userquota,groupquota 2 2

Linux :
Output of `mount` , look for "usrquota".
/dev/hda6 on /var type ext3 (rw,usrquota)
In /etc/fstab
LABEL=/var /var ext3 defaults,usrquota 1 2

If the entries are missing from /etc/fstab , add them. If they are present, verify that there is support for quotas in the kernel and that any relevant modules are loaded.

Check that the quota files are present and not zero byte files -
FreeBSD :
-rw-r----- 1 root operator 2097120 Apr 30 16:19 quota.user
Linux :
-rwxr--r-- 1 root root 8192 Dec 26 20:18 aquota.user*
-rwxr--r-- 1 root root 2097120 Apr 30 04:19 quota.user*

If these files do not exists, run /scripts/initquotas . If they do exist, but quotas are not working, you can either delete the quota files and run initquotas or run /scripts/fixquotas .

After this `repquota -a` should print out the soft/hard limits with grace periods for all users.

If quotas are still not reporting anything in WHM and/or CPanel, check /var/cpanel/cpanel.config for
disablequotacache=0

If that is set to 0, try setting it to 1 and see if that fixes it.

If a user's quota shows more space being used than is in their home directory, chances are there are stray files on the system owned by their UID. To find these files, run the following as root:
find / -user username –ls

In Cpanel, under stats, the error log link shows a blank page, what gives ?

What happens when the error log report page is opened is CPanel tails the last 2000 lines from /usr/local/apache/logs/error_log and prints out any matching lines with the user's home directory in the error path. If there are no errors for that user, it will simply be blank.

Why do I see the following errors on my freebsd server ? kvm_nlist failed swapinfo: undefined symbol: _numvnodes

Most likely you have /boot on it's own partition. On FreeBSD, /boot should be on the root (/) partition, otherwise it will not be able to use /boot/loader(8) and force the system to fall back directly on the /kernel .

To fix this, you need to copy the data out of /boot/ to a directory on / , unmount /boot, remove it from /etc/fstab , then move the contents that were in /boot to the (now plain directory) /boot/ . Once you reboot it should be working normally.

How to authorize a remote IP to relay throught Exim

Create a file with your host IP or IPs and named it something like
/etc/privaterelay

Next, located the following entry at the top of the /etc/exim.conf file:
hostlist relay_hosts = lsearch;/etc/relayhosts : \
localhost

and change it to this:

hostlist relay_hosts = lsearch;/etc/relayhosts : \
localhost : lsearch;/etc/privaterelay

Apache crashes whenever an account is created or deleted ? I'm running RedHat 7.3

RedHat 7.3 shipped with a broken psmisc rpm that turned a SIGUSR into a SIGPWR, which kills apache instantly with no logging (sigpwr says that the power went off and to close everything as fast as possible)

You can fix it by upgrading to the latest fixed RPM:
root@server [~]# cat /etc/redhat-release
Red Hat Linux release 7.3 (Valhalla)
root@server [~]# rpm -qa |grep -i misc
psmisc-20.2-2
root@server [~]# rpm -Uvh http://ftp.cpanel.net/redhat/updates/7.3/en/os/i386/psmisc-20.2-3.73.i386.rpm

Retrieving http://ftp.cpanel.net/redhat/updates/7.3/en/os/i386/psmisc-20.2-3.73.i386.rpm

Preparing...
1:psmisc
root@server [~]#

If that does not fix it there may be another configuration problem a tech will need to look at.

I need to create an login on my web site. How do I accomplish this?

You can use the Password Protect Directories function to accomplish this. Simply enable password protection and then add the users that you wish to give access.

How do i fix the error "License File Expired" ?

First, check the license on http://verify.cpanel.net/ to ensure it is still licensed. If it is not, please contact who you purchase the license from directly.

If it says it is valid, try the following as root via SSH:
# rdate -s rdate.cpanel.net
# /usr/local/cpanel/cpkeyclt

Why am I receiving groupadd/useradd errors when attempting to create a new account?

Make sure your /etc/passwd and /etc/group file does not have the +i (immutable flag). You can check by running lsattr /etc/group and lsattr /etc/shadow. If it does have a +i flag, remove it by executing chattr -i /etc/passwd and/or chattr -i /etc/group.

It is also possible that your group shadow file is corrupt. To fix this, move /etc/gshadow to /etc/gshadow.corrupted and run grpconv to rebuild the file. You may need to remove grshadow.lock and/or group.lock if either exist.

Java / JSP

You can use either the Tomcat or mod_resin addon to serve Java Servlet and Java Server pages with Apache.

These can be enabled in WHM >> cPanel >> Addon Modules

More information about Tomcat can be found at: http://tomcat.apache.org/

I see this error message: [a fatal error or timeout occurred while processing this directive][

Check /usr/local/cpanel/logs/error_log for the specific error. You may need to submit a support request to get this issue resolved.

How can I change the mail port 25 to another port number

You can run exim on another port by going to the 'Service Manager' in WebHost Manager and then enabling 'exim on another port' and choosing the port number.

How do I make sure that my server is running the latest version of cPanel?

You can find out what version of cPanel you are using by logging into the WHM (Web Host Manager). The version will be displayed in the upper right hand corner. You can also find out the version by running /usr/local/cpanel/cpanel -V from the command prompt. To check to see what the latest cPanel version is available in the tree (STABLE/RELEASE/CURRENT/EDGE), please visit http://layer2.cpanel.net.

If you wish to update cPanel through the WHM Manager, under the cPanel cateogry select Upgrade to Latest Version. If you wish to update cPanel from the command prompt as root, run /scripts/upcp --force.

If you would like your server to automatically update to the latest version every morning, in the WHM Manager go under Server Configuration >> Update Config and make sure you have Automatic dotted in for the tree you are using.

How I can know the path of a file on the server

You'll need to check the statistics area of cPanel for your home directory. That directory (usually /home/username/) contains your files. For example, if your username is joe and you put a file in public_html called index.php the file may be located at /home/joe/public_html/index.php

I need to know how to copy and paste HTML code to my web site.

You can edit the HMTL code by using the File Manager in cPanel. Select the file you wish to add the code to in the File Manager and click on 'Edit with Code Editor'. Then, you can copy and paste the code into the HTML where it should go.

We recommend testing this process on a test page so that you do not make any unwanted changes to your live web site.

I am getting a message unable to add the user, when trying to create an account.

Login to your server with SSH and check /home/username to see if the user has a home directory. Also check the contents of\ /etc/passwd to see if there is an entry for that user.

How can i link a webpage to the main page of my website?

If you are looking to just direct the visitor of that page to your home page with a hyperlink, use something similar to My Home Page.

If you wish to have multiple domains "point" to your home page, you can add parked domains for those domains and all the domains will go to your home page when accessed.

How I can change stylesheet for cPanel in WHM?

You can edit a theme's stylesheet in the 'Universal Theme Manager' in WHM. Select the theme, and then choose the 'edit live' option to edit style sheets, images, etc.

Why can't I tell which EasyApache options are checked on the command line?

If your terminal program's color dictates that the cursor and text are the same color, you may not be able to distinguish which options are checked when using /scripts/easyapache. To fix this, in your terminal preferences, make sure to set the text color and cursor color to something contrasting.

Manage your VPS or Web Hosting Account
  Email:
 
  Password:
 
  Sign up for an account

Register Domains | Web Hosting | Virtual Dedicated Hosting | Servers | Hsphere User Help | Plesk User Help | HSPC User Help
Terms of Service | Support Center | Web Mail Login | Submit a Trouble Ticket | Contact Us

Copyright © 1995 - 2010 Earth Media Coporation All rights reserved.

Earth Media Corporation and its affiliated websites offer Web Hosting, Design and Development Services and are not related to or affiliated in any way to
EMC Corporation ® the Information Management and Storage Company. If you need to contact the EMC Corporation, please visit their website at www.emc.com