2005-12-22 00:40
城市童话
how to install Apache, PHP, Mysql (英文说明)
Hello. This howto contains how to install Apache, PHP, Mysql.
First we need to install apache so let's start with this.
-------------------
Apache 2.0.54
-------------------
First, we need to download the latest version of Apache.
1) wget [url=http://apache.zone-h.org/httpd/httpd-2.0.54.tar.gz][color=#000020]http://apache.zone-h.org/httpd/httpd-2.0.54.tar.gz[/color][/url]
Now we need to ungzip it and cd to the apache's dir.
2) tar zxvf httpd-2.0.54.tar.gz
3) cd httpd-2.0.54.tar.gz
Now, let's configure the apache with using the most common options.
4) ./configure --prefix=/usr/local/apache2 --enable-info --enable-ssl --enable-module=so --enable-rewrite --enable-so
Let's compile it!
5) make
Now, let's install it.
6) make install
And that's it! Apache should be installed. Apache's dir is /usr/local/apache2
Conf file is located in /usr/local/apache2/conf/httpd.conf
You can start apache like this: /usr/local/apache2/bin/apachectl start
And please remember, you don't need to restart apache if your going to change the configfile, you can easily reload the config file
/usr/local/apache2/bin/apachectl graceful
-------------------
PHP 4.3.11
-------------------
Let's download the latest version of PHP4.
1) wget [url=http://ee.php.net/get/php-4.3.11.tar.gz/from/www.php.net/mirror][color=#000020]http://ee.php.net/get/php-4.3.11.tar...php.net/mirror[/color][/url]
Let's ungzip it and cd to the php dir.
2) tar zxvf php-4.3.11.tar.gz
3) cd php-4.3.11
Let's configure it with using the most common options.
4) ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-openssl --with-zlib --with-bz2 --enable-ftp --with-gd --with-jpeg --with-png --with-gettext --with-mime-magic --with-mysql
And now compile it...
5) make
And after that, install it.
6) make install
Now were' going to copy the php conf file
7) cp php.ini-dist /usr/local/lib/php.ini
And now add one line to httpd.conf
8) echo "AddType application/x-httpd-php .php" > /usr/local/apache2/conf/httpd.conf
And apache should be installed with PHP support
-------------------
Mysql 4.1.12
-------------------
Ok, we need to first add the mysql user and group.
1)
groupadd mysql
useradd mysql -g mysql
on FreeBSD:
pw group add mysql
pw user add mysql -g mysql
Now, we need to download the latest version of Mysql4.1 ( Which is a recommended version. )
2) wget [url=http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-4.1.12.tar.gz/from/ftp://mirror.mcs.anl.gov/pub/mysql/][color=#000020]http://dev.mysql.com/get/Downloads/M...gov/pub/mysql/[/color][/url]
And now ungzip it and cd to the mysql sourcedir.
3) tar zxvf mysql-4.1.12.tar.gz
4) cd mysql-4.1.12
Now, we are going to configure the mysql using the default options.
5) ./configure --prefix=/usr/local/mysql
And now compile it.
6) make
Now install it.
7) make install
Now you need to copy the mysql conf file.
8) cp support-files/my-medium.cnf /etc/my.cnf
Now, we need to install the mysql database.
9) /usr/local/mysql/bin/mysql_install_db --user=mysql
And now chown it.
10)
chown -R root .
chown -R mysql var
chgrp -R mysql .
Okey, now we're going to try to start the mysqld.
11) /usr/local/mysql/bin/mysqld_safe --user=mysql &
And to set mysql's root password type this:
12) /usr/local/mysql/bin/mysqladmin -u root password "new-password"
2005-12-24 04:17
城市童话
装PHP的时候,如果不要GD支持,可以这样.
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-openssl --with-zlib --with-bz2 --enable-ftp --with-mysql
2006-1-12 02:36
城市童话
如果装php4.4.1的时候有错,可以按照下面方法.
On a Fedora Core 4 box, I have installed Apache 2.2.0 as per:
$ ./configure --prefix=/www --enable-modules=all --enable-mods-shared=all
$ make
$ make install
Then, I installed PHP 5.1.1 as per:
$ ./configure --with-regex=system --enable-dbase --with-apxs2=/www/bin/apxs
--with-freetype --with-pdflib --with-mysql=/usr/local/mysql
$ make
$ make install
Then added the following in my httpd.conf:
LoadModule php5_module libexec/libphp5.so
AddType application/x-httpd-php .php .phtml