FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Installing Apache Php and MySQL [newbie tutorial]

 


kany
Well here you go guys Here is this tutorial for newbies as how to install Apache Php and MySQL.
I have really spent some time on this tutorial now. and hope that it help you people out there. well i will be waiting for your feedback. Well it was alittle lengthy so i uploaded it here.

http://www.megaupload.com/?d=M1MCTJZV

well if this tutorial prove useful then i might go on with the next part of installing phpbb and phpmyadmin.
sarbush
The above link has a downloadable PDF file from megaupload but many times it says the download slots are busy.

I have some tutorial for installation of LAMP (Linux Apache Mysql and PHP) which is verty useful for setting up an internet/Intranet server. Following is the extract of the same.


"This tutorial is designed to guide you through the initial steps of setting up Apache, MySQL, and PHP on Linux. The Linux distribution being utilized for this tutorial is Linux ES 3.0, however the steps should be very similar across most distributions. This tutorial makes the assumption that you have the required development tools loaded for compiling programs from source, these tools are beyond the scope of this document and will not be covered here. Also, it assumes you can use the “vi” text editor for basic editing tasks.

Apache, MySQL, and PHP have become one of the most utilized combinations for developing content driven websites. They are robust, flexible, provide a decent level of security, and they are available for many different platforms. That being said, lets get to building a web server.




Get the sourceballs
The first thing you need to do is obtain the sourceballs for each package, we will be compiling each package from scratch here, and, while there are also binary packages available for some distributions, I find your end results are usually better when building each package for your machine. Make sure you get the source files.

Here are the links and the package versions available at the time this tutorial was written

Apache
current version: 2.0.48
URL: http://httpd.apache.org/download.cgi
MySQL
current version: 4.0.16
URL: http://www.mysql.com/downloads/mysql-4.0.html
PHP
current version: 4.3.4
URL: http://www.php.net/downloads.php

Ok, so you've got the files now what ?, well now the fun begins..

Installation
The first thing we need to do is extract the sourceballs so we can work with the files included in them. Beginning now we will be working as root, so open a terminal window, change to the directory in which you saved your downloaded files and become root by issuing the “su” command, enter the root password and you should be good to go.

To extract the sourceballs type the following commands;

#tar -zxf httpd-2.0.48.tar.gz
#tar -zxf mysql-4.0.16.tar.gz
#tar -zxf php-4.3.4.tar.gz

The commands above will extract the sourceballs into their own separate directories. Now lets move on to compiling the source into usable programs. We'll start with Apache.


Compiling Apache
Change into the directory created when you untarred the sourceball as follows;

#cd httpd-2.0.48

Follow this command by typing;

#./configure –prefix=/usr/local/apache2 –enable-mods-shared=most (enter)

This tells Apache to install in the /usr/local/apache2 directory, and to build most of the available loadable modules. There are a ton of options with Apache, but these should work for the most part. Once the configure is done and the system returns the prompt to you, issue the following command;

#make

This will take a few minutes, once the prompt comes back again issue the following command;

#make install

Wait for a few minutes and viola !, Apache is installed with the exception of a few minor changes we still need to make. They are as follows..

Issue the following command;

#vi /usr/local/apache2/conf/httpd.conf

Check to make sure the following line is present in the file at the bottom of the LoadModule list, if it is not there add it;

LoadModule php4_module modules/libphp4.so

Find the DirectoryIndex line and edit it so it looks like the following;

DirectoryIndex index.html index.html.var index.php

Find the AddType application section and add the following line;

AddType application/x-httpd-php .php

Thats it, save the file and we are done with Apache. Now, on to MySQL !


Compiling MySQL
Change into the MySQL source directory as follows;

#cd mysql-4.0.16

Follow this command by typing;

#./configure –prefix=/usr/local/mysql –localstatedir=/usr/local/mysql/data –disable-maintainer-mode –with-mysqld-user=mysql –enable-large-files-without-debug

Sit back and wait for a while while configure does its thing, once the system returns the prompt to you issue the following command;

#make

Unless you have a very fast machine this will take some time, so spend time with your family, grab a beer, go for a walk, or whatever you're into. When you get back, assuming the system has returned the prompt to you issue the following command;

#make install

Cool !, MySQL is installed, there are only a couple things left to do to get it working, first we need to create a group for MySQL as follows;

#/usr/sbin/groupadd mysql

Then we create a user called mysql which belongs to the mysql group;

#/usr/sbin/useradd -g mysql mysql

Now we install the database files as follows;

#./scripts/mysql_install_db

Then we make a couple minor ownership changes;

# chown -R root:mysql /usr/local/mysql
# chown -R mysql:mysql /usr/local/mysql/data

Last but not least, we use vi to add a line the ld.so.conf file as follows;

#vi /etc/ld.so.conf

And we add the following line;

/usr/local/mysql/lib/mysql

Thats it, MySQL is installed, you can run it by issuing the following command;

#/usr/local/mysql/bin/mysqld_safe –user=mysql &

And as long as we're here we might as well set a root password for MySQL as follows;

#/usr/local/mysql/bin/mysqladmin -u root password new_password

Where “new_password” is the password you want to use.

Ok, so far so good, on to PHP !

Compiling PHP
hange into the PHP source directory as follows;

#cd php-4.3.4

Follow this command by typing;

#./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local/mysql

Once the prompt comes back to you issue the following command;

#make

Hang out for awhile, and then yep, you guessed it, once you have the prompt back;

#make install

Once the install finishes and you have the prompt back issue the following command;

#cp php.ini-recommended /usr/local/php/lib/php.ini

Then edit that file;

#vi /usr/local/php/lib/php.ini

And change the following;

Find the “doc_root” section and enter the correct path for the directory which serves your web content, such as;

doc_root= “/usr/local/apache2/htdocs/”
(this is default for apache2)

Then find the file_uploads section and change it to reflect the following;

file_uploads=Off
(for security reasons)

Thats if for PHP, now lets see if it all works..



Testing


Assuming your MySQL process is still running from earlier, lets start Apache by issuing the following command;

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

This starts the Apache web server, now change into the following directory;

#cd /usr/local/apache2/htdocs

And using vi create a file called test.php;

#vi test.php

Add the following line to the file;



Save the file, then fire up your browser and point it to localhost/test.php. You should see a listing of all kinds of cool info about Apache, PHP, etc. If you do then your set !, if you don't, then take a look at your logs for Apache and MySql, and remember Google is your friend. But hopefully you do, and now you have a fully functioning setup."
kany
sarbush wrote:
The above link has a downloadable PDF file from megaupload but many times it says the download slots are busy.


Well i don't think so i have checked it alot of times and all time it gives me the download link , Its only you have to wait for some 45 seconds . Just look at the top right corner of the page. At the end of the time an advertisement scrolls down just close that and there will be the link
Click Here to download
kany
Well here you go i have uploaded to Rapid Share as well . just click the link below.

http://rapidshare.de/files/11987265/Installing_Apache_Php_MySQL_on_Windows_XP_2.pdf.html
Related topics

A very good PHP MySQL Tutorial
php, mysql and iis5
SQL upgrade request
Setup your own server with Apache, PHP and MySQL [Windows]
what is your php mysql apache installer package

apache php and mysql on mac OS X
Need some php/mysql dlls
Installing Apache on Home Computer
SUSE Linux 10 apache installation
Setup php,mysql and others...

Hostng off your computer.
PHP5 MySQL Config on XP
PHP, MySQL...
ASP +PHP+MySQL Tutorials
The Basics (php, mysql etc)
Reply to topic    Frihost Forum Index -> Miscellaneous -> Tutorials

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.