|
|
This document is available in: English Castellano ChineseGB Deutsch Francais Italiano Nederlands Russian Turkce Polish |
by Sascha Blum (homepage) 关于作者: 我真的很喜欢Linux,因为他非常的强大和稳定,尤其他可以给用户很多的选项和资源. 最好的是,他对所有人开放(开源),所以任何人都可以进一步开发他. 目录: |
摘要:
在这个指南中,我会告诉你怎么安装一个Linux服务器和一些主要的而且很有用的东西.换句话说,我将告诉你如何安装一个LAMP系统.
首先,我将告诉你这个LMAP的缩写代表的是什么.
LAMP就是Linux Apache MySQL PHP,你或许可以从名字猜到,一个LAMP系统包括一个Linux操作系统,一个Apache Web服务器,一个MySQL数据库,和一个脚本语言PHP.
user:~ > su
[Now enter your root password]
root: ~> cd /usr/local/src/lamp
root:/usr/local/src/lamp > tar -xvzf
apache_1.3.27.tar.gz
root:/usr/local/src/lamp > tar -xvzf
zlib-1.1.4.tar.gz
root:/usr/local/src/lamp > tar -xvzf
libpng-1.2.2.tar.gz
root:/usr/local/src/lamp > tar -xvzf
gd-1.8.4.tar.gz
root:/usr/local/src/lamp > tar -xvzf
pdflib-4.0.3.tar.gz
root:/usr/local/src/lamp > tar -xvzf
php-4.2.3.tar.gz
user:/usr/local/src/lamp > cd
apache_1.3.27
user:/usr/local/src/lamp/apache_1.3.27 > su
[Enter your root password]
root:/usr/local/src/lamp/apache_1.3.27 > ./configure
--prefix=/usr/local/apache/1.3.27 --datadir=/web/htdocs
--enable-rule=SHARED_CORE --enable-module=so
root:/usr/local/src/lamp/apache_1.3.27 >
make
root:/usr/local/src/lamp/apache_1.3.27 > make
install
root:/home/user/download/mysql > rpm -Uvh
MySQL-3.23.52-1.i386.rpm
root:/home/user/download/mysql > rpm -Uvh
MySQL-client-3.23.52-1.i386.rpm
root:/home/user/download/mysql > rpm -Uvh
MySQL-devel-3.23.52-1.i386.rpm
root:/home/user/download/mysql > rpm -Uvh
MySQL-shared-3.23.52-1.i386.rpm
root:/usr/local/src/lamp/apache_1.3.27 >
cd /zlib-1.1.4/
root:/usr/local/src/lamp/zlib-1.1.4 > ./configure
--shared
root:/usr/local/src/lamp/zlib-1.1.4 > make
root:/usr/local/src/lamp/zlib-1.1.4 > make
install
root:/usr/local/src/lamp/zlib-1.1.4 > cd
../libpng-1.2.3/scripts/
root:/usr/local/src/lamp/libpng-1.2.3/scripts
> cp makefile.linux ../makefile
root:/usr/local/src/lamp/libpng-1.2.3/scripts > cd
..
root:/usr/local/src/lamp/libpng-1.2.3 >
make test
root:/usr/local/src/lamp/libpng-1.2.3 > make install
root:/usr/local/src/lamp/libpng-1.2.3 >
cd ../gd-1.8.4/
root:/usr/local/src/lamp/gd-1.8.4 >
make
root:/usr/local/src/lamp/gd-1.8.4 > make install
root:/usr/local/src/lamp/gd-1.8.4 > make
clean
root:/usr/local/src/lamp/gd-1.8.4 > cd
/
root:/ > cp
/usr/local/src/lamp/pdflib-4.0.3-Linux/bind/php/php-4.2.1/libpdf_php.so
/usr/ local/lib/libpdf_php.so
root:/ > cd
/usr/local/src/lamp/php-4.2.3/
root:/usr/local/src/lamp/php-4.2.3 > ./configure
--with-apxs=/usr/local/apache/1.3.27/bin/apxs
--enable-track-vars -- enable-ftp --with-zlib --with-gd
--with-sockets --enable-sockets --with-sysvshm --with-sysvsem
--disable-debug --with-pdflib-dir=/usr/local/lib
--with-tiff-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib
--with-png-dir=/usr/lo cal/lib --with-zlib-dir=/usr/local/lib
--with-mysql --with-xml
root:/usr/local/src/lamp/php-4.2.3 >
make
root:/usr/local/src/lamp/php-4.2.3 > make
install
root:/usr/local/src/lamp/php-4.2.3 > cd
/usr/local/apache/1.3.27/conf
root:/usr/local/apache/1.3.27/conf >
#
#Dynamic Shared Object (DSO) Support
#
#To be able to use the functionality of a module which was
built as a DSO you
#have to place corresponding `LoadModule' lines at this
location so the
#directives contained in it are actually available _before_
they are used.
#Please read the file README.DSO in the Apache 1.3
distribution for more
#details about the DSO mechanism and run `httpd -l' for the
list of already
# built-in (statically linked and thus always available)
modules in your httpd
#binary.
LoadModule php4_module
libexec/libphp4.so
#AddType allows you to tweak mime.types without
actually editing it, or to
#make certain files to be certain types.
#AddType application/x-tar .tgz
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
AddType application/x-httpd-php .phtm
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
什么是解析器? 解析器就是一个解析文本的一个小软件。这个文本可以是源代码(象 C++)或者是一个标记语言 (象 HTML).他检查文本的语法错误而且传递解析了的文本,并通常以高效简洁的内码来处理应用程序. 文本通过解析器执行需要一定的时间才可以显示出来,那就是说纯粹的HTML页面读取和显示都比PHP或者其他的脚本. 但是用户不会发现这个细小的延迟,当多个用户都访问同样的文件的时候,这个延迟才比较明显。例如,如果多个用户同时访问一个PHP页或者脚本,这个页的显示速度会稍微慢些。当然和硬件配置也有很大的关系。因此,如果你打算把你的LAMP系统对外开放, (例如因特网或者内部网),你需要更加好的配置,计算机更加快,否则系统将变的非常缓慢 . 另一方面,你可以很安全在一个旧的PC或者笔记本电脑使用LAMP系统开发PHP页或者脚本连接MySQL数据库,因为就只有你一个人在你的计算机系统上执行和显示PHP页或者脚本,速度是不成问题的. |
root:/usr/local/apache/1.3.27/conf > cd
/usr/local/src/lamp/php-4.2.3/
root:/usr/local/src/lamp/php-4.2.3 > cp
php.ini-dist /usr/local/lib/php.ini
;Directory in which the loadable extensions
(modules) reside.
....
extension_dir = /usr/local/lib
extension=libpdf_php.so
root:/usr/local/src/lamp/php-4.2.3 >
killall httpd
root:/ >
/usr/local/apache/1.3.27/bin/apachectl start
/usr/local/apache/1.3.27/bin/apachectl start: httpd started
user:/ > cd /web/htdocs/
user:/web/htdocs > touch info.php
user:~ > su
[Only enter your root password]
root:~ > cd /usr/local/src/lamp/
root:/usr/local/src/lamp > tar -xvzf
php-4.2.4.tar.gz
root:/ > cd
/usr/local/apache/1.3.27/libexec/
root:/usr/local/apache/1.3.27/libexec > cp libphp4.so
libphp4-4.2.3.so
root:/ > cd /
root:/ > cp /usr/local/lib/php.ini
/usr/local/lib/php-4.2.3.ini
root:/ > rm
/usr/local/lib/php.ini
root:/ > cp
/usr/local/lamp/php-4.2.3/config.nice
/usr/local/lamp/php-4.2.4/config.nice
root:/ > cd /usr/local/lamp/php-4.2.4
root:/usr/local/lamp/php-4.2.4 > ./config.nice
root:/usr/local/lamp/php-4.2.4 > make
root:/usr/local/lamp/php-4.2.4 > make install
root:/ > cd /
root:/ > cp /usr/local/lib/php.ini-dist
/usr/local/lib/php.ini
root:/ > /usr/local/apache/1.3.27/bin/apachectl restart
|
主页由LinuxFocus编辑组维护
© Sascha Blum, FDL LinuxFocus.org 点击这里向LinuxFocus报告错误或提出意见 |
翻译信息:
|
2003-04-06, generated by lfparser version 2.25