Ubuntu server apt-Get install apache2 & PhP5 & mysql5

Source: Internet
Author: User

Ubuntu server apt-Get install apache2 & PhP5 & mysql5

Place mysql5 + apache2 + PhP5 + phpMyAdmin in apt-Get mode:

Master please take a look at the Ubuntu wiki, (http://wiki.ubuntu.org) above is very specific. However, I did not enjoy it for the first time. Apache2, PhP5, and mysql5 can be run, but phpMyAdmin cannot be used.
My resume is: after MySQL happy Cheng, you must first set a password for it. This step is not rare.
This article only represents the concept and resume of the ego. It will probably be unilateral and incorrect. Ask the master to take an axe and discuss it all the way !!

1. to use the apt-Get System for placement, it is best or probably necessary to first run the system in the command order level itself, I can only put mysql5 + apache2 + PhP5 in the first stage.
I run sudo apt-Get install apache2 PhP5 mysql-server before the upgrade. If the source you are looking for is not good or your collection does not change, you may also have to enter the level. In this case, when you want to use the apt-Get method to place some software, you probably cannot place it.
Sudo apt-Get update
Sudo apt-Get dist-Upgrade

2. Placement:
Sudo apt-Get install mysql-Server
Place mysql5
Sudo apt-Get install apache2
Placement of apache2
Sudo apt-Get install PhP5
Placement of PhP5
Sudo apt-Get install php5-mysql
Install the MySQL module of PHP
Sudo apt-Get install php5-gd
Placement of GD Database
In the operation of the above number of hours, you can take a steady look at the libapache2-mod-auth-mysql (placement apache2 will probably be installed) and libapache2-mod-php5, if you see the security of the will not alone placement.

3. Configure the device:

We just placed MySQL, there is only one default system root user, and there is no password, at this time we must set a password for MySQL, I think it is necessary. Because I did not take this step during my first placement, I thought it was the same as that in win, but I did not need to set it. However, when I log on to the shore with the root account without the password at http: // 127.0.0.1/phpMyAdmin, I will not be happy!
Terminal input:
Mysql-u Root
Mysql> grant all privileges on *. * to root @ localhost identified by 123456 ″;
'123' is the root password, which can be set freely, but it is best to set a safe point.
Mysql> \ q exit MySQL

MySQL configuration file-my. CNF :( path:/etc/MySQL/My. CNF)
Run the command: sudo gedit/etc/MySQL/My. CNF can be compiled.

Apache2 configuration file-apache2.conf (Path:/etc/apache2/apache2.conf)
Run the command: sudo gedit/etc/apache2.conf can be compiled.

PHP configuration file-PHP. ini: (Path:/etc/PhP5/apache2/PHP. INI)
Run the command: sudo gedit/etc/PhP5/apache2/PHP. ini can be compiled.

At this time, these three files cannot be compiled temporarily. For the sake of safety and optimization, they must be compiled. For more information, see this document !!

4. Place phpMyAdmin
Sudo apt-Get install phpMyAdmin
After the installation is complete, you can test http: // 127.0.0.1/phpMyAdmin on the page. Do not log on to the console first, and change the configuration file (config. inc. PHP.
Terminal input: sudo gedit/etc/PHPmyAdmin/config. Inc. php
Find $ cfg ['servers'] [$ I] ['Password'] = ";
Change to: $ cfg ['servers'] [$ I] ['Password'] = '000000 ′;
'123' is the MySQL password that is only available.

5. At this time, it is best to start the computer from the ground up. (someone on the Internet said this, because this is the second placement.) Open the viewer http: // localhost/PHPmyAdmin/
Enter the root user name, enter the new password, and then implement
You can see the amiable phpMyAdmin face under Win.

Summary:
Operation number order of apache2:
Start: sudo/etc/init. d/apache2 start
Restart: sudo/etc/init. d/apache2 restart
Closed: sudo/etc/init. d/apache2 stop
Default directory of apache2:/var/www/

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.