Lowyat.NET Forums

Welcome Guest ( Log In | Register )

LYN wins Intel-Lenovo-Tangs Blogathon challenge. Thank you everybody!
 
RSS feedBump TopicReply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> [HOWTO], FAQ, Guides

biatch0
post Apr 20 2004, 11:42 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #1


Tem Que Valer
Group Icon

Group: VIP
Posts: 1,331
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003






This guide "should" be applicable to most other versions of Apache 1. No guide for Apache 2 unfortunately, as I'm not a very big fan. In this example, we'll be using Apache 1.3.29, PHP 4.3.6, MySQL. If new versions come out, you can improvise, read the README, Google, or whatever... but this guide is unlikely to be updated ever again. The more initiated of you may realise that a lot of the instructions come from the README/INSTALL files, but then again, nobody ever reads things that are named README. Maybe they should start renaming the README file to "HOT SEXY STORY".

First up, you'll need to grab all the relevant source distributions. THIS GUIDE DOES NOT DEAL WITH RPMs OF ANY SORT. Make sure you dump them somewhere you remember for convenience sake (I generally use /root/tmp and I will assume you do the same, otherwise, replace /root/tmp with your own dir). You can download the various source tar.gz files from the links below:
Apache - At time of writing: Apache 1.3.29
PHP - At time of writing: PHP 4.3.6
MySQL - At time of writing: MySQL 4.0.18

I generally start of installing MySQL since it doesn't require any referencing. Here's how to go about compiling and installing your source distribution of MySQL. NOTE: If things don't seem to work, YOU DON'T HAVE THE SOURCE DISTRIBUTION. GO AND GET IT. You will need to change the mysql-VERSION.tar.gz to mysql-4.0.18.tar.gz or whatever matches your current version.

CODE
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db
shell> chown -R root  .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &


This should have compiled, installed and started the MySQL daemon for you. Nifty... If you keep getting "Permission Denied" or an equivalent error, you might want to know that you need to be logged in as root in order for most of this work. Now, MySQL is over and done with... let's move on to Apache/PHP.

Apache/PHP is slightly more complicated. You'll need to change directories (HORRORS!!!). Anyway, moving along; do the following. You will need to change the apache_1.3.x.tar.gz to apache_1.3.29.tar.gz or relevant version number; and do the same for PHP.

CODE
1.  gunzip apache_1.3.x.tar.gz
2.  tar xvf apache_1.3.x.tar
3.  gunzip php-x.x.x.tar.gz
4.  tar xvf php-x.x.x.tar
5.  cd apache_1.3.x
6.  ./configure --prefix=/usr/local/apache
7.  cd ../php-x.x.x
8.  ./configure --with-mysql --with-apache=../apache_1.3.x
9.  make
10. make install
11. cd ../apache_1.3.x
12. ./configure --activate-module=src/modules/php4/libphp4.a
13. make
14. make install
15. cd ../php-x.x.x
16. cp php.ini-dist /usr/local/lib/php.ini
17. Edit your httpd.conf or srm.conf file and add:
     AddType application/x-httpd-php .php


At this point, you may be interested in looking thru your httpd.conf and change whatever settings you fancy. I generally change the index order, and some other useless junk.

CODE
<IfModule mod_dir.c>
  DirectoryIndex index.html
</IfModule>

to
CODE
<IfModule mod_dir.c>
  DirectoryIndex index.php index.html index.htm
</IfModule>


Once you're done, figure out where your default htdocs directory is (by default it's /usr/local/apache/htdocs I think) and do the following:

CODE
1.  cd /usr/local/apache/htdocs
2.  pico index.php
3.  Insert the following:
     <? phpinfo(); ?>
4.  Save & exit
5.  apachectl start


At this point, you should have a working webserver which should work happily with your MySQL server. Fire up your browser and point it to http://localhost or whatever your site is. You should see a bunch of garbage that has to do with PHP settings... If so, you're done.

This post has been edited by kons: Jun 20 2007, 09:11 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
kons
post Jun 20 2007, 09:16 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #2


smallpox
Group Icon
Linux & Networking

Group: Moderator
Posts: 3,789
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Oct 2004
From: linux/kernel/panic.c





Delete really lots of files

Sometimes rm command can't handle too many files.
Another neat way to do it is to try this:-

CODE
find . -name "*" -print | xargs rm


Replace * with the file names to match

It can be further tweaked to do recursive delete.


Added on June 25, 2007, 11:52 pmClear history of all typed command

CODE
history -c


This post has been edited by kons: Jun 25 2007, 11:52 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
DeviousEgg
post Nov 26 2007, 09:06 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #3


Getting Started
**

Group: Junior Member
Posts: 61
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Oct 2007




Nifty... was looking around for this and never thought of looking here... Thanks...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
kons
post Jan 29 2008, 01:49 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #4


smallpox
Group Icon
Linux & Networking

Group: Moderator
Posts: 3,789
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Oct 2004
From: linux/kernel/panic.c





Linux clock runs too fast on VPC

http://support.microsoft.com/kb/918461

Set clock=pit to the kernel boot line in grub.conf


Added on February 18, 2008, 6:28 pmGenerate Artificial Load in Linux.

touch test; i=10; while ((i--)); do while [ -e test ]; do echo $RANDOM > /dev/null; done & done

i=x, where x is the load.
i=10 would generate load avg of 10
i=20 would generate load avg of 20

To stop, just rm -f test.


This post has been edited by kons: Oct 23 2008, 09:28 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
kons
post Oct 23 2008, 09:28 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #5


smallpox
Group Icon
Linux & Networking

Group: Moderator
Posts: 3,789
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Oct 2004
From: linux/kernel/panic.c





Simulate DHCP request without changing the physical IP on the eth (Testing DHCP service only)

CODE
dhclient -1 -s 192.168.48.2 -cf /dev/null -pf /tmp/test.pid -sf /tmp/s eth1


-1 = do it one time
-s = dhcp server
-cf = config file
-pf = pid file
-sf = script file
eth1 = interface

If failed, returns exit code 2
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
kons
post Oct 24 2008, 04:35 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #6


smallpox
Group Icon
Linux & Networking

Group: Moderator
Posts: 3,789
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Oct 2004
From: linux/kernel/panic.c





Checking number of connection entries

One way to limit p2p is to install ip_conntrack modules and iptables connlimit modules.
connlimit module can block the number of connections that the end-user can get at one time, if you set it to 100, that means the end-users can only connect to 100 host at a time, which is fine for web surfing but for p2p, it is too restrictive.
connlimit will limit those ip_conntrack entries in ESTABLISHED state only.

To check the number of connections that an end-user has:

CODE
cat /proc/net/ip_conntrack|grep ESTABLISHED|cut -d '=' -f2|sort|uniq -c|sort -nr|head -n 20



User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicReply to this topicTopic OptionsStart new topic
 



----debug section please ignore----
Lo-Fi Version Time is now: 23rd November 2009 - 04:42 PM
All Rights Reserved 2003-2009 Vijandren Ramadass (~living on a prayer~)