--
Installing apache with php
Installing apache with php
1. Go to /usr/local/src/
[root@agnello src]#
wget http://www.deluxnetwork.com/downloads/unix/php-4.3.2RC2.tar.gz
[root@agnello src]#
wget http://download.nextag.com/apache/httpd/apache_1.3.
37.tar.gz
2. tar –xzvf php-4.3.2RC2.tar.gz
3. tar –xzvf apache_1.3.37.tar.gz
4. you would get the following two folders
[root@agnello src]#
ls
apache_1.3.37
php-4.3.2RC2
5. create a file called apacheinstall and give it chown +x and edit the file add the following lines
[root@agnello src]#
vi apacheinstall
cd apache_1.3.xx
./configure \
--prefix=/www \
--enable-module=so \
--enable-module=rewrite \
--enable-shared=rewrite \
--enable-module=setenvif \
--enable-shared=setenvif \
--enable-module=mime \
--enable-shared=mime \
--enable-module=mime_magic \
--enable-shared=mime_magic \
--enable-module=speling \
--enable-shared=speling \
--enable-module=dir \
--enable-shared=dir \
--enable-module=auth \
--enable-shared=auth \
--enable-module=access \
--enable-shared=access \
--enable-module=alias \
--enable-shared=alias \
--enable-module=status \
--enable-shared=status \
--enable-module=userdir \
--enable-shared=userdir \
--enable-module=vhost_alias \
--enable-shared=vhost_alias \
--enable-module=env \
--enable-shared=env \
--enable-module=log_referer \
--enable-shared=log_referer \
--enable-module=log_config \
--enable-shared=log_config \
--enable-module=log_agent \
--enable-shared=log_agent \
--enable-module=headers \
--enable-shared=headers
make
make install
:wq
6. [root@agnello src]# ./apacheinstall
7. create a file called phpinstall and give it chown +x and edit the file add the following lines
8. [root@agnello src]# vi phpinstall
cd php-4.3.2RC2 \
./configure
--with-mysql \
--with-apxs=/www/bin/apxs
Make
Make install
:wq
9. [root@agnello src]# ./phpinstall
10. Now, cd into your php_4.xxx directory and type:
[root@agnello src]#
cp php.ini-dist /usr/local/lib/php.ini
This copies the php.ini to it's proper place.
10. Edit your httpd.conf to load the PHP module.
11. [root@agnello src]# vi /www/conf/httpd.conf
be sure to check.
For PHP 4
LoadModule php4_module libexec/libphp4.so
For PHP 5:
LoadModule php5_module libexec/libphp5.so
12. Tell Apache to parse certain extensions as PHP. For example,
let's have Apache parse the .php extension as PHP. You could
have any extension(s) parse as PHP by simply adding more, with
each separated by a space. We'll add .phtml to demonstrate.
AddType application/x-httpd-php .php .phtml
It's also common to setup the .phps extension to show highlighted PHP
source, this can be done with:
AddType application/x-httpd-php-source .phps
12. Setup a Test PHP Script in /www/htdocs/test.PHP
<?
php phpinfo
();
?>
13. [root@agnello src]# ln -s /www/bin/apachectl /etc/rc.d/init.d/
14. [root@agnello src]# /etc/init.d/apachectl restart
Your done
--
php -mysql-apache instatllation instruction
yum.conf file
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=fedora-release
tolerant=1
exactarch=1
retries=20
####################################################################################
# Fedora Core Repositories:
# (This is the main set of official Fedora packages)
####################################################################################
# Updates to the OFFICIAL Fedora Core 2 package set
[http-download.fedora.redhat.com-pub-fedora-linux-core-updates-2-i386-]
name=http-download.fedora.redhat.com-pub-fedora-linux-core-updates-2-i386-
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/2/i386/
# The OFFICIAL Fedora Core 2 package set (Yum)
[http-redhat.secsup.org-fedora-core-2-i386-os-]
name=http-redhat.secsup.org-fedora-core-2-i386-os-
baseurl=http://redhat.secsup.org/fedora/core/2/i386/os/
####################################################################################
# Fedora Extras Repositories:
# (These packages are supplementary to Fedora Core)
####################################################################################
# The fedora.us fc2 yum repository. This repository is where the Fedora
#distribution originated, but these packages are supplementary to the
#Fedora Core packages. This repository contains the STABLE package set.
[http-download.fedora.us-fedora-fedora-2-i386-RPMS.stable-]
name=http-download.fedora.us-fedora-fedora-2-i386-RPMS.stable-
baseurl=http://download.fedora.us/fedora/fedora/2/i386/RPMS.stable/
# Updates to packages in the fedora.us fc2 yum repository. This
#repository is where the Fedora distribution originated, but these
#packages are supplementary to the Fedora Core packages.
[http-download.fedora.us-fedora-fedora-2-i386-RPMS.updates-]
name=http-download.fedora.us-fedora-fedora-2-i386-RPMS.updates-
baseurl=http://download.fedora.us/fedora/fedora/2/i386/RPMS.updates/
####################################################################################
# Third-Party Fedora Repositories:
# (These packages are independently maintained and may conflict with
#Core packages)
####################################################################################
### Livna.org repositories. Must have Fedora US/Extras
[livna-stable]
name=Livna.org Fedora Compatible Packages (stable)
baseurl= http://rpm.livna.org/fedora/$releasever/$basearch/yum/stable
#gpgcheck=1
[livna-unstable]
name=Livna.org Fedora Compatible Packages (unstable)
baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/yum/unstable
#gpgcheck=1
[livna-testing]
name=Livna.org Fedora Compatible Packages (testing)
baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/yum/testing
#gpgcheck=1
# The GStreamer repository for FC The repository includes most GStreamer
#plugins, the editor, the #player, the python bindings, gstreamer-ffmpeg
#and gstreamer-monkeysaudio. Check out
#http://gstreamer.freedesktop.org/download/fedora.html for instructions.
#These packages are built against #fedora.us and livna.org packages, and
#will be submitted to those repositories as well.
[http-gstreamer.net-pkg-fedora-2-i386-yum-gst]
name=http-gstreamer.net-pkg-fedora-2-i386-yum-gst
baseurl=http://gstreamer.net/pkg/fedora/2/i386/yum/gst
# This repository provides packages that the gstreamer media framework
#depends upon.
[http-gstreamer.net-pkg-fedora-2-i386-yum-deps]
name=http-gstreamer.net-pkg-fedora-2-i386-yum-deps
baseurl=http://gstreamer.net/pkg/fedora/2/i386/yum/deps
--
process related commands
To see currently running process ps $ ps
To stop any process by PID i.e. to kill process
kill {PID} $ kill 1012
To stop processes by name i.e. to kill process killall
{Process-name} $ killall httpd
To get information about all running process ps -ag $ ps -ag
To stop all process except your shell kill 0 $ kill 0
For background processing (With &, use to put particular command and program in
background) linux-command & $ ls / -R | wc -l &
To display the owner of the processes along with the processes ps
aux $ ps aux
To see if a particular process is running or not. For this purpose you
have to use ps command in combination with the grep command
ps ax | grep process-U-want-to see
For e.g. you want to see whether Apache web server process is running
or not then give command
$ ps ax | grep httpd
To see currently running processes and other information like memory
and CPU usage with real time updates. top
See the output of top command.
$ top
Note that to exit from top command press q.
To display a tree of processes pstree $ pstree
--
The read Statement
from the user via keyboard. Then user enters name from keyboard (after
giving name you have to press ENTER key) and entered name through
keyboard is stored (assigned) to variable fname.
$ vi testscript
#Script to read your name from key-board
#
echo "Your first name please:"
read name
echo "Hello $name, Lets be friend!"
Run it as follows:
$ chmod 755 testscript
$ ./testscript
Your first name please: vivek
Hello vivek, Lets be friend!
--
Shell Arithmetic
Syntax:
expr op1 math-operator op2
Examples:
$ expr 1 + 3
$ expr 2 - 1
$ expr 10 / 2
$ expr 20 % 3
$ expr 10 \* 3
$ echo `expr 6 + 3`
--