How to configure an Apache + MySQL + PhP environment after installing ubuntu10.10

Source: Internet
Author: User
Tags apache php

1. Apache
$ Sudo apt-Get install apache2

2. MySQL
$ Sudo apt-Get install mysql-Server

3. php
$ Sudo apt-Get install PhP5

4. MySQL for Apache PHP (Communication template)
$ Sudo apt-Get install libapache2-mod-auth-mysql
$ Sudo apt-Get install php5-mysql

5. phpMyAdmin
$ Sudo apt-Get install phpMyAdmin

During the installation process, MySQL and others will prompt you to set the root password. (Don't add anything. Remember it !)

 

After installation
1. Open http: // localhost and you can see
It works! Indicates that Apache is running normally.

2. Enter sudo netstat-tap | grep MySQL on the terminal.
TCP 0 0 localhost. localdomain: MySQL *: * listen-indicates that MySQL runs normally.

3,
After the installation is complete, the default website root directory is/var/www.
By default, only root has full read and write permissions. Therefore, we need to grant administrator permissions to/var/WWW and enter sudo chmod-r 777 on the terminal.
/Var/WWW success!

4. phpMyAdmin is automatically installed under/usr/share/phpMyAdmin.
Enter CP-r/usr/share/PHPmyAdmin/var/WWW on the terminal to copy the phpMyAdmin file to the WWW folder. Be sure to note the case sensitivity. phpMyAdmin is not applicable and Linux is case sensitive.
Open http: // localhost/phpMyAdmin to open the MySQL management interface.

Use phpMyAdmin for Ubuntu

(Linux + Apache + MySQL + PHP) structure on myUbuntu Machine. Installing the structure is pretty easy. But getting it all running seamlessly is the another thing. After installing the things I typedHttp: // 127.0.0.1 (http: // localhost /)On my browser and it said "It Works". But when I tried to open the phpMyAdmin(Http: // localhost/PHPmyAdmin /)Which is used to manage your MySQL backend and tables it shows404 Not Found error.

By default your WWW directory is created here/Var/WWWAnd the phpMyAdmin configuration files are stored in/Usr/share/phpMyAdmin. So the trick involved here is to point your the later location or directory from your former directory. To do this open your terminal and run the following command.

Sudo ln-S/usr/share/PHPmyAdmin/var/WWW

This willCreate the pointerTo/usr/share/phpMyAdmin in/var/WWW

Now openHttp: // localhost/PHPmyAdmin/And you are good to go. If you still face any problems feel free to ask and comment.

Uninstall Apache, PHP, and MySQL

1. Uninstall Apache
1. sudo apt-Get remove apache2
Sudo apt-Get remove apache2.2-common
Sudo apt-Get autoremove (this command will automatically uninstall PHP)

Force uninstall Apche:
Sudo apt-Get -- purge remove APACHE-common
Sudo apt-Get -- purge remove Apache

2. Find and delete the configuration file that has not been deleted.
Clear the installation files under etc:
Sudo find/etc-name "* Apache *" | xargs Rm-RF
Or
Sudo find/etc-name "* Apache *"-exec Rm-RF {}\;
Delete apache2, apache2.2-common, apache2-mpm-work, apache2-utils, libapr1,

Clear the installation package:
# Dpkg-L | grep apache2 | awk '{print $2}' | xargs dpkg-P

Clear the working directory:
Sudo Rm-RF/var/WWW

Ii. Uninstall PHP
Sudo apt-Get remove PhP5

Iii. uninstall MySQL
Sudo apt-Get remove mysql-server mysql-server-5.1 (varies depending on your Ubuntu version of MySQL)

Use whereis MySQL to check where MySQL is installed and clear the directory.
For example, Rm-fr/usr/lib/MySQL

Note: ln indicates the link, which is the same as the pointer in C ++.

 

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.