LinuxBabu ………..

Author Archive

Enable Root Password in Leopard

by on Jul.03, 2011, under OS X


You got a Mac running on Leopard (probably out of the box). You created your account, add in some personal info, and an admin password. Later in life (8 hours gap), you would open your terminal and simply type “su -” for purposes of scripting etc.  just root stuff. This reminds you, “Did i ever had one? I don’t recall any root password.” *did i mention this was me?* 
Well to let you off the hook, it’s not enabled by default. Here’s how to go about enabling root.

Go to: Applications -> Utilities -> Directory Utility

(Be sure to click the padlock to allow you to perform edits.)

Click Edit -> Enable Root Password

Type a new password and retype to confirm.

You are done.. :)


Leave a Comment more...

How to track which site is using the apache processes.

by on Jul.03, 2011, under Basics, cPanel, DirectAdmin

For apache 1.3, edit your /etc/httpd/conf/httpd.conf and add

ExtendedStatus On <Location /httpd-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 </Location>

 

 

 

just after the code that says “ServerSignature On”. Save, exit, then restart apache. You can access the stats page by going to http://1.2.3.4/httpd-status where 1.2.3.4 is your server’s IP.

If you’re running apache 2.x , then it’s already in the file:
/etc/httpd/conf/extra/httpd.conf
Change the “Allow from” lines to include your IP.

Under cPanel servers the code is already present but you need to uncomment it or just add the code :

<Location /whm-server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
Leave a Comment more...

cPanel : Rvsitebuilder installation

by on Jul.02, 2011, under cPanel

cPanel : Rvsitebuilder installation

1. If the server has RVSkin installed, update RVSkin to v6.75 up. (Skip this step if you don’t have it).

perl /root/rvadmin/auto_rvskin.pl

2. After getting the license confirmation, SSH to the cPanel server as root, download the installer using the command below:

cd /usr/local/cpanel/whostmgr/docroot/cgi/
rm -f rvsitebuilderinstaller.tar
wget http://download.rvglobalsoft.com/rvsitebuilderinstaller.tar
tar -xvf rvsitebuilderinstaller.tar
chmod 755 addon_rvsitebuilder.cgi

3. Open WHM as root user, at the bottom left menu under Plugins section, you can find RVSiteBuilder Installer menu.

4. Click RVSiteBuilder Installer to begin the installation process.

5. After complete the installation, you will be sent to RVSiteBuilder Manager automatically.

Leave a Comment more...

Need to change IP address in FreeBSD

by on Jul.02, 2011, under Uncategorized

Issue: A change of IP address is needed in FreeBSD.

Solution: If you do not have the root password boot into Single User mode [option 4]. Procced to step 1.

If you have the root password procced to step 2.

1. mount -o (if you get a read-only error, you will have to run fschk -y)

2. vi /etc/rc.conf (If vi is unavailable use ee)

at this point simply edit the IP Address lines that will need to be corrected.

Leave a Comment : more...

How to bind IPs on a Windows Server

by on Jul.01, 2011, under Uncategorized

1. Start -> Settings -> Control Panel -> Network Connections
2. Right click and go to properties of the enabled/active NIC
3. Highlight on TCP/IP and click on properties
4. Select ” Use the following IP address ”
5. Enter your IP information for the server.
6. Click on Advanced
7. Click Add on the IP Settings tab.
8. Enter the usable IP range along with the netmask. ( ie 255.255.255.0 )
9. Click OK.

Leave a Comment :, more...

DNS Overview

by on Jul.01, 2011, under Basics

Most records will be A records. This allows the greatest versatility in pointing your domain names where you want them go. Each record consists of a host name and an IP address.

Host field: The host name for that particular A record. The host name should be what precedes the .domain.com in your FQDN (fully qualified domain name). For instance, on www.domain.com, “www” is the host (without the quotation marks). Whatever is listed here, the lookup will automatically append “.domain.com” to the query. A blank A record ( domain.com rather than host.domain.com) is created by putting a ‘@’ sign in the host name field.

Common “A” records include: www.domain.com, ftp.domain.com, mail.domain.com, webmail.domain.com, mysql.domain.com

Points to field: This is where you list the IP address to which the host name should point.

CNAME section:

CNAME records point to domain names instead of IP addresses. The benefit to using a CNAME record is you can point a host to a particular domain name then only modify the target domain name’s A records to have the change take place on both domains. This is commonly used by those who own several TLD versions (.com, .net, .org, etc.) of the same domain.

For example, you own domain.com and you also own domain.net and you want the records to point to the same IP. You can create CNAME records for the www host of domain.net that point to www.domain.com. Then all you have to do to change the www host of domain.net is modify the A record of www.domain.com to point to its new IP address and www.domain.net is automatically changed:

A common mistake to using this method is that you can accidentally modify the records for several domains when you only intend to change one. I.E. – you have to make a note of which domains point to each other

Host field: The host name for that particular CNAME record. The host name should be what precedes the .domain.com in your FQDN. For instance, on www.domain.com, “www” is the host (without the quotation marks). Whatever is listed here, the lookup will automatically append “.domain.com” to the query. A blank A record ( domain.com rather than host.domain.com) is created by putting a ‘@’ sign in the host name field.

Points to field: The name that the record points to. This must be a domain name, and not an IP address. The domain name must also end with a dot. Otherwise, the domain record will wrap down when queried to the next period in the zone file.

MX section:

The MX section is the area that handles the direction of mail.

Priority field: This allows you to select your preference for an individual MX records. Records are procesed in order starting with the lowest priority and working to higher priorities. What this means is, if you have two mailservers or a mailserver and a mail spooler, set the lower priority to your main mailserver and a higher priorty to your backup mailserver or mail spooler.

Host field: You can specify a mail host name here, but in most cases it is not necessary. What is recommended is to create a blank host (use a ‘@’ for the host name) and point it to your mail server.

Goes to field: The address of the mail server. What is commonly done here is using the mail hostname you created in the A record section to point your mail.

It is highly recommended that you point MX records to a domain name, and that domain name (just like a CNAME record) must end with a dot.

TXT section:

A TXT record generally is a record that you can query which return information about a domain. These can be used for SPF indicators, crafting port an protocol connections, or just returning information about a domain. These are most commonly used with the spf protocol.

Name: The host that the TXT record can be queried by.

Value: What the TXT record will return, placed in quotes.

Leave a Comment : more...

Error: Cannot find SSL binaries under /usr

by on Jun.30, 2011, under Basics, DirectAdmin, Uncategorized

This happens with the configure script for apache cannot find the “openssl” (or “ssleay”) binaries in any of
/usr/bin/openssl
/usr/sbin/openssl
/usr/apps/openssl

The usual location for “openssl” is /usr/bin/openssl

On a debian system, run

apt-get install openssl

Leave a Comment more...

DirectAdmin : Apache stops responding but is running

by on Jun.30, 2011, under DirectAdmin

A few things that could cause that are:

Possible Causes:
1) MaxClients set to a value too low
2) If you have over about 800 sites, the ErrorLog files open too many file descriptors and apache won’t be able to log the errors and may stop responding.

Solutions:
1) edit /etc/httpd/conf/httpd.conf and increase the MaxClients setting to something like 200 or 300.
2)

cd /usr/local/directadmin/data/templates
cp virtual_host*.conf custom
cd custom

# remove all the ErrorLog lines (or comment them out) from the 4 virtual_host*.conf files that are in the custom directory.

echo “action=rewrite&value=httpd” >> /usr/local/directadmin/data/task.queue

Apache should be restarted automatically after a few minutes later (rewrite might take a while with over 800 sites).

3) Other possible information:
Edit /usr/include/bits/typesizes.h and set
#define __FD_SETSIZE 32768 
and then recompile with customapache or custombuild.

On FreeBSD, it’s /usr/include/sys/select.h or /usr/include/sys/types.h
Change:
#define FD_SETSIZE 1024U
to
#define FD_SETSIZE 32768U

then recompile apache/php

4) edit /etc/sysctl.conf and add:
fs.file-max = 32768

and run:

/sbin/sysctl -w fs.file-max=32768

then recompile apache/php

Other possible entires for the sysctl.conf:
kern.maxfiles = 32768
kern.maxfilesperproc = 32768

5) Another way to free up FileDescriptors (FDs) is to disable ssl on any domain that does not require it.
A quck way to check is to type:

ls -la /home/*/domains/*/private_html/index.html

quickly scan the list for any index.html that isn’t betwen 200-300 bytes in size. Any that are not in that range will have been edited and the user is probably using ssl, so take note of those usernames and domains. Now, the quick way to do a mass SSL shutoff for domains is to type:

perl -pi -e ‘s/ssl=ON/ssl=OFF/’ /usr/local/directadmin/data/users/*/domains/*.conf

Then turn ssl=ON back on for any users who need it. Note that this is an end user level setting, so they have the ability to turn it back on themselves via Domain Setup. Then type the action=rewrite&value=httpd command as mentioned in step 2 above.
What this does is reduced the number of FD’s by 50%. Since many people rarely use SSL, disabling it reduceds half of all virtualhosts, since all domains, subdomains, etc.. have 2 virtualhosts each with ssl, and only 1 each without ssl.

6) Openssl bug. Either update openssl and recompile apache, or patch apache 2:
http://issues.apache.org/bugzilla/show_bug.cgi?id=43717


Related error messages:
[error] System: Too many open files in system (errno: 23)

host: isc_socket_create: not enough free resources socket.c:2117: REQUIRE(maxfd <= (int)1024) failed.
host: isc_socket_create: not enough free resources

 

DirectAdmin FAQ

Leave a Comment more...

DirectAdmin : Updating Apache to the latest version

by on Jun.29, 2011, under DirectAdmin

Updating Apache to the latest version

You can check the current version of apache by running

httpd -v

If you wish to update your 1.3 version of apache to the most recent, run the following:

cd /usr/local/directadmin/customapache
./build clean
./build update
./build apache_mod_ssl

If you’re using apache 2.x, use “./build apache_2″ isntead of apache_mod_ssl.
This should update both the configure options and the version of apache to the most recent version. Once the update has completed, you’ll need to restart apache:

RedHat:

/sbin/service httpd restart

FreeBSD:

/usr/local/etc/rc.d/httpd restart

Leave a Comment :, , more...

Crontab basics

by on Jun.29, 2011, under Basics, Command Line

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.


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).

Crontab Example

min      hour      day/month      month      day/week       Execution time
30     0     1     1,6,12     *     — 00:30 Hrs  on 1st of Jan, June & Dec.

0     20     *     10     1-5     –8.00 PM every weekday (Mon-Fri) only in Oct.

0     0     1,10,15     *     *     — midnight on 1st ,10th & 15th of month

5,10     0     10     *     1     — At 12.05,12.10 every Monday & on 10th of every month


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


To collect the cron execution execution log in a file :

30 18  *    *   *    rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log

Leave a Comment more...