IDGLabs.COM - tips, tools and resource

Knowledge Sharing - Want to participate in the discussion?

Apache, MySql and PHP Howto (from source) solarisEveryone loves web applications that use , and , and everyone loves having their very own web servere that runs them. The problem is, how do you do it? If your’re like me, you don’t do it enough to remember, so here are some quick directions to get you started.

First we must the latest versions of , and and extract them. You may have to dig a little since these places are always changing where they keep things, but the links below should be of some use. Just make sure you the source distribution.

MySQL Download >
Apache Download >
PHP Download >

I always put these applications in /usr/local/, but you can select whatever location you like. Simply add whatever directory you want into the –prefix directive.

First, let’s build and install

# cd /path/to//source/directory
# ./configure –prefix=/usr/local//
# make
# make install

Next, we have to build and install the web . In this example, we are building it with SSL, URL Rewrite and Shared Object support.

# cd /path/to//source/directory
# ./configure –prefix=/usr/local// –enable-=so –enable-rewrite -enable-ssl
# make
# make install

Finally, build and install . There are lots of things you can include when building , but these are the most common.

# ./configure –with-apxs2=/usr/local///bin/apxs –with-=/usr/local// –enable-debug=no –enable-track-vars=yes –enable-bcmath=yes –enable-memory-limit=yes –with-imap –with-ldap=/usr/local//ldap –enable-ftp –with-gd –with-jpeg-dir=/usr/local –with-png-dir=/usr/local –with-zlib-dir=/usr
# make
# make install

That should do it… If everything went well, you can start up your fancy new web .

# /usr/local///bin/apachectl start

Source:http://spiralbound.net

Link:http://spiralbound.net/2005/04/29/apache-mysql-and-php-howto-from-source

Tags: , , , , ,
  • 0 Comments
  • Filed under: Solaris
  • Taking Disk Cylinders From Swap on Solaris 8 sun_logoIf this is not done exactly right, you will render your system unbootable and corrupt your data. That being said, under some circumstances you can take some space from your swap partition and add it to an unused one without initializing your entire . This is particularly useful if you decide you want to use to mirror your system , but have not allocated the 100MB partition that is needed to hold the state databases. As always, BACK EVERYTHING UP FIRST. Better yet, make two backups and store them on two different systems. This is a risky procedure, and you don’t want to lose any data!

    You can also use my instructions for copying a boot drive to a with a different partition layout as a safer alternative.

    The first thing you need to do is figure out if your layout will allow for this procedure. Usually the swap partition is the second one on the , making it partition number 1 (Partition number 0 is root). If partition number 1 is swap on your system, and partition number 3 or 4 are unused, you are in good shape, and this should work. To figure this out, you should do something like this:

    # format
    Select the boot - usually 0
    Specify (enter its number): 0
    format> partition
    format> print

    This will show you the current layout.

    
    Current partition table (original):
    Total  cylinders available: 24620 + 2 (reserved cylinders)
    
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 -   725        1.00GB    (726/0/0)    2097414
      1       swap    wu     726 -  9436       11.90GB    (8635/0/0)  24946515
      2     backup    wm       0 - 24619       33.92GB    (24620/0/0) 71127180
      3 unassigned    wm       0                0         (0/0/0)            0
      4 unassigned    wm       0                0         (0/0/0)            0
      5        usr    wm    9437 - 10888        2.00GB    (1452/0/0)   4194828
      6        var    wm   10889 - 18148       10.00GB    (7260/0/0)  20974140
      7 unassigned    wm   18149 - 24619        8.91GB    (6471/0/0)  18694719
    

    Here we see that partitions 3 and 4 are unused and directly after partition 1, so we can take some space from swap and assign it to one of these. Partition 2 is, of course the entire . I have not tried it, so I don’t know if you could assign non-sequential cylinders to a partition that is not directly after swap.

    So to take some space from partition 1 and add it to partition 3, the first thing we have to do is disable swap, so the format utility will let us change it.

    Comment out the following lines in your /etc/vfstab file and reboot the system.

    
    #/dev/dsk/c1t0d0s1         -       -               swap    -       no      -
    #swap    -       /tmp    tmpfs   -       yes     -
    

    This will bring the system up without swap enabled. You can now edit the label. Remember that our cylinders need to be sequential, so always work in cylinders when using the format utility.

    Re-enter the format utility, select your system and view the partition table:

    # format
    Select the boot - usually 0
    Specify (enter its number): 0
    format> partition
    format> print

    Again we wee that partitions 3 and 4 are unused.

    
    Current partition table (original):
    Total  cylinders available: 24620 + 2 (reserved cylinders)
    
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 -   725        1.00GB    (726/0/0)    2097414
      1       swap    wu     726 -  9436       11.90GB    (8635/0/0)  24946515
      2     backup    wm       0 - 24619       33.92GB    (24620/0/0) 71127180
      3 unassigned    wm       0                0         (0/0/0)            0
      4 unassigned    wm       0                0         (0/0/0)            0
      5        usr    wm    9437 - 10888        2.00GB    (1452/0/0)   4194828
      6        var    wm   10889 - 18148       10.00GB    (7260/0/0)  20974140
      7 unassigned    wm   18149 - 24619        8.91GB    (6471/0/0)  18694719
    

    The first thing we need to do is take some cylinders away from partition 1. In this example, we are looking to make partition 3 roughly 100MB, so we need to take about 75 cylinders from partition 1 so that we can add it to partition 3. Parititon 1 ends at cylinder 9436, so we need to subtract 75 from that number. 9436 - 75 = 9361, so that is the new ending cylinder for partition 1. We then subtract the beginning cylinder (726) from that number to give us the new total number of cylinders for partition 1. 9361 - 726 = 8635, so this is the number we enter when format asks for the size of the partition. Like so:

    
    partition> 1
    Part      Tag    Flag     Cylinders         Size            Blocks
      1       swap    wu     726 -  9360       11.90GB    (8635/0/0)  24946515
    
    Enter partition id tag[swap]:
    Enter partition permission flags[wu]:
    Enter new starting cyl[726]:
    Enter partition size[24946615b, 9436c, 12880.92mb, 12.00gb]: 8635c
    partition>
    

    Now we have to add these 75 cylinders to partition 3.

    
    partition> 3
    Part      Tag    Flag     Cylinders         Size            Blocks
      3 unassigned    wm       0                0          (0/0/0)            0
    
    Enter partition id tag[unassigned]:
    Enter partition permission flags[wm]:
    Enter new starting cyl[0]:9361
    Enter partition size[0b, 0c, 0.00mb, 0.00gb]:75c
    partition>
    

    Print out the new partition table to make sure everything lines up correctly:

    
    partition> print
    Current partition table (original):
    Total  cylinders available: 24620 + 2 (reserved cylinders)
    
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 -   725        1.00GB    (726/0/0)    2097414
      1       swap    wu     726 -  9360       11.90GB    (8635/0/0)  24946515
      2     backup    wm       0 - 24619       33.92GB    (24620/0/0) 71127180
      3 unassigned    wm    9361 -  9436      107.21MB    (76/0/0)      219564
      4 unassigned    wm       0                0         (0/0/0)            0
      5        usr    wm    9437 - 10888        2.00GB    (1452/0/0)   4194828
      6        var    wm   10889 - 18148       10.00GB    (7260/0/0)  20974140
      7 unassigned    wm   18149 - 24619        8.91GB    (6471/0/0)  18694719
    

    Partition 1 ends at cylinder 9360, and partition 3 picks right up at cylinder 9361. Partition 3 ends at cylinder 9436, and partition 5 begins at cylinder 9437. Partition 4, of course, remains unused. Since none of the cylinders overlap, we can go ahead and write the label out. DO NOT DO THIS if you have any doubt at all about what you have just done. By writing out the label, you could corrupt the data on your formated filesystems if any cylinders overlap into them. The format utility is usually pretty smart about keeping you from making mistakes, but be very careful anyway! You don’t want to end up with scrambled eggs on a that has valuable data on it.

    partition> label
    This writes out the label, so you can now exit the format utility and re-enable swap in your /etc/vfstab file. Simply uncomment out the following two lines and reboot the system.

    
    /dev/dsk/c1t0d0s1         -       -               swap    -       no      -
    swap    -       /tmp    tmpfs   -       yes     -
    

    Reboot your system, and if all goes well, it will come up, and you will see that partition 3 will have a little over 100MB on it. Usually people want to do this so they can store the meta database on the newly created partition

     
    Source:http://spiralbound.net

    Link:http://spiralbound.net/2006/11/21/taking-disk-cylinders-from-swap-on-solaris-8

    Tags: , , , , , , ,
  • 0 Comments
  • Filed under: Solaris
  • One of the biggest uses of sha1sum is to verify integrity of files, that are going to be sent by any electric medium, here you will how to use it

    Do you need to send an attachment by email, or upload/ a file by ftp, or exchange a file with any other way, and need to be sure that file arrives its destination with no corruptions?

    Well you may need to use sha1sum, which is a console command that will check and print the sha1 hash

    Summarizing, it will scan the file and print a string, which is unique for the scanned file.

    To use it just enter and the console:

    sha1sum file

    If you want to send the file together with its sha1sum output redirect the output to a file:

    sha1sum hard_disk.jpg > hard_disk.sha1

    Then send the two files, at its destination, someone can enter:

    sha1sum -c hard_disk.sha1

    Both files should be available and if everything is o.k. you will see something like this:

    hard_disk.gif: OK

    If you want to try, here are the two files, used on this test.

    hard_disk.gif
    hard_disk.sha1

    You may also want to check sha1sum man page

    Tags: , , , ,
  • 0 Comments
  • Filed under: Linux
  • If you are using a content management system to create a website, it is likely that you will eventually encounter a situation where you need to set up a Cron job. Cron is a program installed on Unix / Linux based servers that allows users to schedule tasks to be run automatically at specific dates or times. The name “Cron” is derived from the Greek word for time - chronos. Since most people use shared hosting, this guide will provide the basics for setting up your own crontab and automating tasks with your web hosting provider on a shared server…

    I will be using Drupal as an example for setting up Cron because Cron is an integral part of the Drupal core. If you have downloaded and installed the new Drupal 5 CMS, you will notice that there is an error in the administrative log when you first sign in with your administrative account.

    One or more problems were detected with your Drupal installation. Check the status report for more information.

    When you look at the status report you can go ahead and click the link “run cron manually” and this will remove the error. However, you will eventually want to set up a Cron job to do this. Having the Cron maintenance run regularly on an automatic schedule is important for keeping your site indexed. If this is not done, new content that is added will not be included in search results. Cron can also perform other tasks in Drupal, such as cleaning up log files. Also, some of the contributed modules require that Cron maintenance is run regularly.

    With the Drupal 5 installation package, there is a script included for Cron and it is called cron.php. This file is located in the root directory of your Drupal installation. You can actually run Cron maintenance by entering, for example, the URL “http://www.yourwebsite.com/cron.php” into a web browser. But we want to get this done automatically, so we need to call on the help of the Lynx browser. Lynx is a text browser that is often installed on servers. You will need to contact your hosting provider to make sure that they have Lynx installed (most probably do).

    Once you know that Lynx is installed, you will need to find the configuration panel for setting up a Cron job in your hosting account. If your web host uses Cpanel, you will probably see something like this:

    crontab

    The first thing to do is enter the command. The following example is the command I use to make Lynx run cron.php:

    lynx -source  */30               lynx -source www.yourwebsite.com/cron.php


    Run cron.php task once a week at 1:00 am every saturday (you can see that saturday is represented by 0):

    00   1       0       lynx -source www.yourwebsite.com/cron.php


    Run cron.php task on the first day of every month at 12:00 am (midnight) :

     00   0   01     *       lynx -source www.yourwebsite.com/cron.php


    The main site for Themebot.com uses the Joomla CMS. I have set up a Cron job to aggregate the newsfeeds thru feedgator every 12 hours. Here is an example of what it looks like (yourusername is the username for your hosting account. You may need to contact your hosting provider for information on the absolute path to your files):


    Run task every 12 hours at midnight and at noon:

    00   1       0  

    /usr/local/bin/php /home/yourusername/public_html/administrator/components/com_feedgator/cron.feedgator.php >> /dev/null

    Tags: , , , , , , , , , ,
  • 0 Comments
  • Filed under: Command Line
  • nginx [engine x]

    nginx [engine x] nginx

     

    nginx [engine x] NginxNews?action=AttachFile&do=get&target=netcraft_chart

    nginx [engine x] is a HTTP and mail proxy written by me (Igor Sysoev).

    nginx has been running for more than three years on many heavily loaded Russian sites including Rambler (RamblerMedia.com).
    In March 2007 about 20% of all Russian virtual hosts were served or proxied by nginx.
    According to Online Security Blog nginx serves or proxies about 4% of all virtual hosts, although Netcraft shows much less percent.
    2 of Alexa Top100 sites use nginx.
    Here is one of the success stories: FastMail.FM.

    The last stable version is nginx-0.5.35, the change log.
    The last development version is nginx-0.6.29, the change log.
    The sources are licensed under a BSD-like license.

    The English Wiki.

    The Russian documenatation.

    Basic HTTP features:

    • Handling of static files, index files, and autoindexing; open file descriptor cache;
    • Accelerated reverse proxying without caching, simple load balancing and fault tolerance;
    • Accelerated support without caching of remote FastCGI servers, simple load balancing and fault tolerance;
    • Modular architecture. Filters include gzipping, byte ranges, chunked responses, and SSI. Multiple SSI inclusions within a single page can be processed in parallel if they are handled by FastCGI or proxied servers.
    • SSL and TLS SNI support.

     

    Mail proxy features:

    • User redirection to IMAP/POP3 backend using an external HTTP authentication ;
    • User authentication using an external HTTP authentication and connection redirection to internal SMTP backend;
    • Authentication methods:
      • POP3: USER/PASS, APOP, AUTH LOGIN PLAIN CRAM-MD5;
      • IMAP: LOGIN, AUTH LOGIN PLAIN CRAM-MD5;
      • SMTP: AUTH LOGIN PLAIN CRAM-MD5;
    • SSL support;
    • STARTTLS and STLS support.

     

    Tested OS and platforms:

    • FreeBSD 3 — 7    i386; FreeBSD 5 — 7    amd64;
    • 2.2 — 2.6    i386; 2.6    amd64;
    • 9    i386, sun4u; 10    i386, amd64, sun4v;
    • MacOS X    ppc, i386;

     

    Architecture and scalability:

    • one master and several workers processes. The workers run as unprivileged user;
    • kqueue (FreeBSD 4.1+), epoll ( 2.6+), rt signals ( 2.2.19+), /dev/poll ( 7 11/99+), event ports ( 10), select, and poll support;
    • various kqueue features support including EV_CLEAR, EV_DISABLE (to disable event temporalily), NOTE_LOWAT, EV_EOF, number of available data, error codes;
    • sendfile (FreeBSD 3.1+), sendfile ( 2.2+), sendfile64 ( 2.4.21+), and sendfilev ( 8 7/01+) support;
    • accept-filter (FreeBSD 4.1+) and TCP_DEFER_ACCEPT ( 2.4+) support;
    • 10,000 inactive HTTP keep-alive connections take about 2.5M memory;
    • data copy operations are kept to a minimum.

     

    Other HTTP features:

    • name- and IP-based virtual servers;
    • keep-alive and pipelined connections support;
    • flexible configuration;
    • reconfiguration and online upgrade without interruption of the client processing;
    • access log formats, bufferred writing, and quick log rotation;
    • 4xx-5xx error codes redirection;
    • rewrite ;
    • access control based on client IP address and HTTP Basic authentication;
    • PUT, DELETE, MKCOL, COPY and MOVE methods;
    • FLV streaming;
    • speed limitation;
    • limitation of simultaneous connections from one address.

     

    Experimental features:

    • embedded perl.
    Tags: , , , , , , , , , , , , ,
  • 0 Comments
  • Filed under: nginx - nginx
  • Share Your Score

    Advertise