ApacheMySQLPHP

参与到Ubuntu的翻译中来
回复
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

ApacheMySQLPHP

#1

帖子 oneleaf » 2005-08-26 23:55

This is to help people setup and install a [WWW] LAMP server in Ubuntu 5.04, including Apache 2, PHP 4, and MySQL 4.1. As of this writing, MYSQL 5.0 and PHP 5 could only be installed by compiling. See the bottom of this document for further info.
Check Repositories

The Universe repository needs to be enabled to install Apache. Please see AddingRepositoriesHowto for details.

Also, you should be familiar with RootSudo.
Installing Apache 2

$ sudo apt-get install apache2

Installing PHP 4

$ sudo apt-get install php4

Installing MYSQL 4

$ sudo apt-get install mysql-server
$ sudo apt-get install libapache2-mod-auth-mysql
$ sudo apt-get install php4-mysql

After installing MySQL, you really ought to read [WWW] 2.9.3. Securing the Initial MySQL Accounts from the [WWW] MySQL Reference Manual.
Edit Apache Configuration

You may want your current user to be the PHP pages administrator. To do so, edit the Apache configuration file :

$ sudo gedit /etc/apache2/apache2.conf

Search both the strings starting by "User" and "Group", and change the names by the current username and groupname you are using. Then you'll need to restart Apache. (look at the next chapter concerning apache commands)
Edit PHP Configuration to Work With MYSQL

You may need to edit the PHP configuration file to get PHP and MYSQL talking :

$ sudo gedit /etc/php4/apache2/php.ini

Remove the ";" for the line ";extension=mysql.so", and restart Apache as is stated below.
Run, stop, and restart Apache

Use the following command to run Apache :

$ sudo /usr/sbin/apache2ctl start

To stop it, use :

$ sudo /usr/sbin/apache2ctl stop

Finally, to restart it, run :

$ sudo /usr/sbin/apache2ctl restart

Status

To check the status of your PHP installation:

$ sudo gedit /var/www/testphp.php

and insert the following line

<?php phpinfo(); ?>

View this page on a web browser, at [WWW] http://yourserveripaddress/testphp.php or [WWW] http://localhost/testphp.php
Securing Apache

If you just want to run your Apache install as a development server and want to prevent it from listening for incoming connection attempts, this is easy to do.

$ sudo gedit /etc/apache2/ports.conf
$ password:

Change ports.conf so that it contains:

Listen 127.0.0.1:80

Save this file, and restart Apache (see above). Now Apache will serve only to your home domain, [WWW] http://127.0.0.1 or [WWW] http://localhost.
Further Information

You can compile PHP5FromSource, as well as MYSQL5FromSource.


https://wiki.ubuntu.com/ApacheMySQLPHP
当净其意如虚空,远离妄想及诸取,令心所向皆无碍
头像
leal
帖子: 1119
注册时间: 2005-08-29 14:49
来自: 杭州
联系:

初译

#2

帖子 leal » 2005-08-31 10:35

viewtopic.php?t=2375

This is to help people setup and install a [WWW] LAMP server in Ubuntu 5.04, including Apache 2, PHP 4, and MySQL 4.1. As of this writing, MYSQL 5.0 and PHP 5 could only be installed by compiling. See the bottom of this document for further info.
本页面是为了帮助人们在Ubuntu 5.04上设置和安装[WWW]LAMP服务器,包括Apache 2、PHP 4和MySQL 4.1。写作此页时,MYSQL 5.0和PHP 5只能通过编译安装。更多信息参看本文档最后部分。
Check Repositories
检查仓库

The Universe repository needs to be enabled to install Apache. Please see AddingRepositoriesHowto for details.
为安装Apache,需要激活Universe仓库。细节请参看AddingRepositoriesHowto。

Also, you should be familiar with RootSudo.
还有你应该熟悉RootSudo。
Installing Apache 2
安装Apache 2

$ sudo apt-get install apache2

Installing PHP 4
安装PHP 4

$ sudo apt-get install php4

Installing MYSQL 4
安装MYSQL 4

$ sudo apt-get install mysql-server
$ sudo apt-get install libapache2-mod-auth-mysql
$ sudo apt-get install php4-mysql

After installing MySQL, you really ought to read [WWW] 2.9.3. Securing the Initial MySQL Accounts from the [WWW] MySQL Reference Manual.
安装MySQL之后,你应该用心阅读一下[WWW]MySQL参考手册中的[WWW] 2.9.3. 保护MySQL初始帐号。
Edit Apache Configuration
编辑Apache配置

You may want your current user to be the PHP pages administrator. To do so, edit the Apache configuration file :
你也许要让自己的当前用户成为PHP页管理员。要达此目的,需编辑Apache配置文件:

$ sudo gedit /etc/apache2/apache2.conf

Search both the strings starting by "User" and "Group", and change the names by the current username and groupname you are using. Then you'll need to restart Apache. (look at the next chapter concerning apache commands)
搜索开头为“User”和“Group”的字符串,用你正在使用的用户名和组名替换这两个名字。随后你应重启Apache。(参看apache命令相关的下一章)
Edit PHP Configuration to Work With MYSQL
编辑PHP配置以配合MYSQL使用

You may need to edit the PHP configuration file to get PHP and MYSQL talking :
你可能需要编辑PHP配置文件,使PHP和MYSQL互通:

$ sudo gedit /etc/php4/apache2/php.ini

Remove the ";" for the line ";extension=mysql.so", and restart Apache as is stated below.
删除";extension=mysql.so"行的";",按如下所述重启Apache。
Run, stop, and restart Apache

Use the following command to run Apache :
运行、停止和重启Apache

使用如下命令运行Apache:

$ sudo /usr/sbin/apache2ctl start

To stop it, use :
要停止Apache,使用:

$ sudo /usr/sbin/apache2ctl stop

Finally, to restart it, run :
最后,重启Apache,执行如下命令:

$ sudo /usr/sbin/apache2ctl restart

Status
状态

To check the status of your PHP installation:
为检查你的PHP安装状态:

$ sudo gedit /var/www/testphp.php

and insert the following line
在上述文件中插入下面这行代码:

<?php phpinfo(); ?>

View this page on a web browser, at [WWW] http://yourserveripaddress/testphp.php or [WWW] http://localhost/testphp.php
在Web浏览器中查看此页面,通过[WWW] http://yourserveripaddress/testphp.php或[WWW] http://localhost/testphp.php地址
Securing Apache
保护Apache

If you just want to run your Apache install as a development server and want to prevent it from listening for incoming connection attempts, this is easy to do.
如果你只是要把自己的Apache安装作为一个开发服务器运行,想阻止其侦听外来连接,按如下方法即可:

$ sudo gedit /etc/apache2/ports.conf
$ password:

Change ports.conf so that it contains:
更改ports.conf使其包含:

Listen 127.0.0.1:80

Save this file, and restart Apache (see above). Now Apache will serve only to your home domain, [WWW] http://127.0.0.1 or [WWW] http://localhost.
保存此文件并重启Apache(参见上面所述)。现在Apache将只服务于你自己的home域,[WWW] http://127.0.0.1或[WWW] http://localhost
Further Information
更多信息

You can compile PHP5FromSource, as well as MYSQL5FromSource.
如MYSQL5FromSource,你也可以从源码编译PHP5,PHP5FromSource。

https://wiki.ubuntu.com/ApacheMySQLPHP
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#3

帖子 oneleaf » 2005-09-07 20:45

当净其意如虚空,远离妄想及诸取,令心所向皆无碍
头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#4

帖子 millenniumdark » 2006-07-30 18:10

过时了

作废
回复