|
Blue Forest http://www.lslnet.com at 19:08 on May 28, 2006
[In turn] FreeBSD installation mysql+apache+php
Said in front of the case :
While PHP has been installed and is not something new APACHE topic, but I still need to announce their installation experience, after all, I hope this article will give some of these people some help.
[In turn] FreeBSD installation mysql+apache+php
===============================================
Author : Wandering E-mail : [email]wandering_997@yahoo.com[/email]
[Contents]
1. Installation Mysql
2. Apache installation
3. PHP Installation
4. Httpd.conf configuration
5. Start / stop x
1. Installation Mysql
================
"Manual> MySQL Reference Manual provides a standard installation methods, see" MySQL Reference Manual> 2. Installing MySQL
> 2.7. Installing MySQL on Other Unix-Like Systems "
# 1.1 binary version of the installation methods created by wandering 2005/04/09
--------------------------
#
# Mysql are currently translating the good binary code can be used directly configure, and no database initialization
# Acquiescence, I installed the document /usr/src catalog, catalog application installation to /usr/local
#
Shell> mysql first group of users and create mysql
Shell> cd /usr/local
Shell> tar zxvf mysql-standard-4.1.11-unknown-freebsd4.7-i386.tar.gz
Shell> ln-s. /mysql-standard-4.1.11-unknown-freebsd4.7-i386. /mysql
Shell> cd mysql
Shell> scripts/mysql_install_db --user=mysql
Shell> chown-R root.
Shell> chown-R mysql data
Shell> chgrp-R mysql.
Shell> --user=mysql & bin/mysqld_safe
Shell> --user=root & /usr/local/mysql/bin/mysqld_safe
Shell> echo "/usr/local/mysql/bin/mysqld_safe &" "" /etc/rc.local
OK, Mysql have been installed.
Installation of the compiler version 1.2 source code added by wandering 2005/12/28 #
-----------------------------
Sometimes, we also need to install editing, I recently installed Mysql FreeBSD6.0 and found Mysql binary version of the maximum support
FreeBSD5.3, tested, the binary method of installation without success. Had installed a manual translation.
Before installing INSTALL-SOURCE must look carefully at this document very useful 啊!!!
Shell> mysql first group of users and create mysql
Shell> tar zxvf mysql-5.0.18
Shell> cd mysql-5.0.18
Shell>. /configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
Shell> make
Make install shell>
Shell> pw group add mysql
Shell> pw mysql user add-n-d-s /usr/sbin/nologin /usr/local/mysql
Shell> cp support-files/my-medium.cnf /etc/my.cnf
Shell> cd /usr/local/mysql
Shell> mkdir data
Shell> bin/mysql_install_db --user=mysql
Shell> chown-R root.
Shell> chown-R mysql data
Shell> chgrp-R mysql.
Shell> --user=mysql & bin/mysqld_safe
Shell> echo "/usr/local/mysql/bin/mysqld_safe &" "" /etc/rc.local
OK, can be used.
Port Server 3306 with netstat order can be seen at the state wiretapping.
/usr/local/mysql/bin/mysqladmin U root-p password "new_password>
Enter password : # root password changes, the initial password for root space, so it can direct the transport
To test the new code :
Mysql-u root-p mysql
Enter password:<new_password><CR>
2. Apache installation
===============
# Tar zxvf httpd-2.2.0.tar.gz
# Cd httpd-2.2.0
#. /configure --prefix=/usr/local/apache --enable-so --enable-mods-shared=all --enable-rewrite=shared --enable-speling=shared, Named, named make make install
#
** Note : --enable-so choice, which is to share the Apache configuration after installation of the module
3. PHP Installation
============
Steps :
3.1 installed gd-2.0.33.tar.gz
3.2 installed libxml2-2.6.19.tar.gz
3.3 installed libiconv-1.9.1.tar.gz
Installation of PHP 3.4
3.1 installed gd
------------
Gd need the following modules :
. Zlib-1.2.3.tar.gz
. Libpng-1.2.8-config.tar.gz
. Freetype-2.1.10.tar.gz (Kexuanzhuang)
. Xpm-3.4k.tar.gz (Kexuanzhuang)
. Jpegsrc.v6b.tar.gz (Kexuanzhuang)
Zlib 3.1.1 installation
-----------------
# Tar zxvf zlib-1.2.3.tar.gz
# Cd zlib-1.2.3
#. /configure, Named, named make make install
Zlib tacit consent to be installed /usr/local/include/
Http://www.zlib.net/
3.1.2 installed libpng
----------------
# Tar libpng-1.2.8-config.tar.gz
# Cd libpng-1.2.8-config
#. /configure, Named, named make make install
Libpng tacit consent to be installed /usr/local/include/libpng/
Http://www.libpng.org/pub/png/libpng.html
3.1.3 installed gd
--------------
# Tar zxvf gd-2.0.33.tar.gz
# Cd gd-2.0.33
# Cp /usr/local/include/png.h.
# Cp /usr/local/include/pngconf.h.
#. /configure, Named, named make make install
#
*** I have met with Secretary png gd_png.c find documents, and then to hand pngconf.h two documents put png.h
Gd_png.c copy of the catalog can be the host. ***
Gd tacit consent to be installed /usr/local/include/
Http://www.boutell.com/gd/
3.2 installed libxml
-----------------
# Tar zxvf libxml2-2.6.19.tar.gz
# Cd libxml2-2.6.19
#. /configure, Named, named make make install
#
3.3 install libiconv
-------------------
# Tar zxvf libiconv-1.9.1.tar.gz
# Cd libiconv-1.9.1
#. /configure, Named, named make make install
#
PHP 3.4 installation
--------------
# Tar zvxf php-5.1.2.tar.gz
# Cd php-5.1.2
#. /configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/include/libxml2/libxml --with-gd --with-zlib, Named, named make make install
#
*** Note : configure process, may encounter the following error! Sorry, I can not run apxs. ***
Configure : error : sorry, I can not run apxs. Either you need to install Perl or you need to pass the absolute path of apxs by using --with-apxs=/absolute/path/to/apxs
Many on-line solution, but only the most classic 2001/03/15 Darrell Brogdon wrote in the "<Installing DSO>> PHP as an Apache. This article in the Green UNITA Xu permanent translation of the Chinese version 2002-03-18 "" Apache on the way to install PHP>> DSO, but he himself is above the famous author of the article, which I doubt.
The reason I say this much, I just want to say see, no real solution to the problem.
OK, Now I explain what I was going to solve this problem :
Firstly, through the wrong words, we know that "I can not run apxs." I always thought it was apxs installation of a problem, but not a long time to find a reasonable explanation and solution.
Therefore, I direct the operation "/usr/local/apache/bin/apxs" The script has been suggested that the following errors :
Bash :. /apxs : /replace/with/path/to/perl/interpreter : Bad interpreter : No such file or directory
Oh, it gives people the feeling like apxs procedure is still a problem, but where does the problem lie? "Interpreter" What is it? Interpreter is "interpretation of the procedures."
Ah, it seems that we are close to the answer, the operation a "head-/usr/local/apache/bin/apxs" to the following :
#!/replace/with/path/to/perl/interpreter W
Alas, this does not specify the location of the correct procedures perl! This is the real reason why the original question!
To change this his "#!/usr/bin/perl versus." The re-configure the PHP, and all normal!
Thus, the problem has been resolved.
*** Sorry, I can not run apxs. ***
4. Httpd.conf configuration
====================
4.1 ServerName find that this machine will replace the domain name
------------------------------------------
ServerName www.example.com:80
4.2 find "DirectoryIndex index.html", "index.html" insert "http://www.basd-action.net/initiatives/index.php"
------------------------------------------------------------------------
"IfModule dir_module>
DirectoryIndex index.html http://www.basd-action.net/initiatives/index.php
"/IfModule>
4.3 to find the "IfModule mime_module> in AddType application/x-gzip. Gz. Now adding tgz
-------------------------------------------------------------------------------
AddType application/x-httpd-php. PHP
AddType application/x-httpd-php-source. Phps
4.4 to find the "Directory" /usr/local/apache/htdocs "". . . "/Directory>, Adding at the bottom
-----------------------------------------------------------------------------
"Directory /data1/apache/htdocs/it>
Options Indexes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
"/Directory>
"Directory /data1/apache/htdocs/it_old>
Options Indexes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
"/Directory>
450 to find the "Directory" /usr/local/apache/cgi-bin "". . . "/Directory>, Adding at the bottom
------------------------------------------------------------------------------
"Directory" /data1/apache/htdocs/perl ""
AllowOverride None
Options None
Order allow, deny
Allow from all
"/Directory>
460 to find the "IfModule alias_module>. . . "/IfModule>, In the middle of the region's
----------------------------------------------------------------
Alias /it "/data1/apache/htdocs/it"
Alias /it_old "/data1/apache/htdocs/it_old"
ScriptAlias /perl/ "/data1/apache/htdocs/perl/"
5. Start / stop x
=====================
/usr/local/apache/bin/apachectl Start
/usr/local/apache/bin/apachectl Stop
** Note : to ensure that they are normal people can be analyzed based machine IP addresses.
*** In "/usr/local/apache/bin/apachectl start" may be the wrong indicated below :
[Fri Dec 30 09:35:01 2005] [warn] (2) No such file or directory : Failed to enable the 'httpready' Accept Filter
Solutions :
Editor /etc/hosts and /etc/rc.conf, domain name server configuration. For example :
Shell> cat /etc/hosts
127.0.0.1 localhost freebsd6.vm-local.net
192.168.177.130 freebsd6 freebsd6.vm-local.net
Shell> cat /etc/rc.conf
Hostname= "freebsd6.vm-local.net"
...
That the Internet is amending the "/boot/loader.conf" installed accf_http_load= "yes."
However :
1) I have seen the process from the start FreeBSD guide procedures to guide the paper was actually "/boot/defaults/loader.conf";
2) Revise loader.conf solution to the problem.
***
-----------------------------------------------------------------------------
# 2005/04/09 16:00 - 2005/04/10 13:16 Created by Wandering
# 2005/12/29 23:28 Modified by Wandering
# 2006/03/12 19:31 Modified by Wandering
# 0045 2006/03/18 Modified by Wandering
Appendix :
*Apache 2.0 DSO function Summary :
-------------------------------
Installation has been translated and released by the Apache module, such as translation mod_foo.c mod_foo.so the DSO modules :
$. /configure --prefix=/path/to/install --enable-foo=shared
Make install $
Apache Module Compiler and the installation of a third party, such as translation mod_foo.c mod_foo.so the DSO modules :
$. /configure --add-module=module_type:/path/to/3rdparty/mod_foo.c --enable-foo=shared
Make install $
Apache to share configuration after installation modules :
$. /configure --enable-so
Make install $
Apxs trees in the Apache source code with compiler Apache and install third-party modules, such as translation mod_foo.c mod_foo.so the DSO modules :
$ Cd /path/to/3rdparty
$ Apxs-c mod_foo.c
$ Foo - n-apxs -i mod_foo.la
After completion of the translation module sharing, in order to enable Apache httpd.conf LoadModule activation of the module was used.
[B] [mysql+apache+php switch installed in FreeBSD ][/b] |
Since the FreeBSD platform, why not ports related to the installation of the software?
Oh, not too convenient ports.
-- |
Carelezz reply to the message, 2nd Floor Installation manual translation of the monopoly situation finally 啊~ |
Support to |
Not using ports installed software, this is not the installation of freebsd style ah? Freebsd installation of the software is very strict. |
| |