How To Find What Version of PEAR Is Installed in your Linux Apache Server

if you want to know what version of PEAR you have, or simply just want to know if you have PEAR installed, simply run the following command in your linux box shell prompt:

pear list

Once you execute the command above, you should see something like this:

Installed packages
===================
Package
Version
State
Archive_Tar
1.1
stable
Console_Getopt
1.2
stable
DB
1.7.6
stable
HTML_Template_IT
1.1
stable
HTTP
1.3.6
stable
Mail
1.1.8
stable
Net_SMTP
1.2.7
stable
Net_Socket
1.0.6
stable
Net_UserAgent_Detect
2.0.1
stable
PEAR
1.3.6
stable
XML_Parser
1.2.6
stable
XML_RPC
1.4.1
stable

If you don’t see anything like the above, then you dont have PEAR installed. However, Good new I have, you can download free at http://pear.php.net

Enable Root Password in Leopard


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


    How to track which site is using the apache processes.

    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>

    cPanel : Rvsitebuilder installation

    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.

    Need to change IP address in FreeBSD

    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.

    How to bind IPs on a Windows Server

    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.

    DNS Overview

    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.

    DirectAdmin : Apache stops responding but is running

    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

    DirectAdmin : Updating Apache to the latest version

    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