Home > Database > Mysql Tutorial > Ubuntu上安装Apache/PHP/MySQL实践_MySQL

Ubuntu上安装Apache/PHP/MySQL实践_MySQL

WBOY
Release: 2016-06-01 13:07:56
Original
889 people have browsed it

UbuntuApache

系统环境:Ubuntu 10.04.4 LTS,x86_64 GNU/Linux

1. 安装 Apache2

1) sudo apt-get install apache2

2) 输入密码,并根据提示做一些操作

3) test:

4) 修改 default Document Root

* sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/webserver

* sudo gedit /etc/apache2/sites-available/webserver

* change the Document Root to point to the location you want. For ex:

DocumentRoot /home//server/

/server/>

5) 激活新配置

sudo a2dissite default && a2ensite webserver

6) 重启 Apache HTTP Server

sudo /etc/init.d/apache2 reload

2. 安装 PHP5

1) 安装 PHP5 and Apache PHP5 module

sudo apt-get install php5 libapache2-mod-php5

2) 重启 Apache2

sudo /etc/init.d/apache2 reload

3) 测试 PHP5 is working,编写一个phpinfo.php

sudo gedit /home//server/phpinfo.php

输入内容:

访问:可以看到一些php基本信息

3. 安装 MySQL

1) sudo apt-get install mysql-server mysql-client

2) 安装php5-mysql包,让PHP支持MySQL

sudo apt-get install php5-mysql

3) 安装 phpMyAdmin: MySQL的管理器

sudo apt-get install phpmyadmin

一些选项:

Web server to configure automatically: Apache2

Configure database for phpmyadmin with dbconfig-common: No

4) 可以建立一些软链接到/home//server(即Apache2的设置的更根目录)的目录下,例如:

cd /home//server/

sudo ln –s /usr/share/phpmyadmin

5) 访问地址:

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template