Ubuntu lamp (apache+mysql+php) environment and related extended update _linux

Source: Internet
Author: User
Tags curl install php

First, environmental installation
1. Install Apache2
sudo apt-get install apache2
Open in Browser after installation: http://localhost/or http://127.0.0.1
If the IT works! proves the Apache installation is successful.
2. Install PHP
sudo apt-get install php5
sudo apt-get install LIBAPACHE2-MOD-PHP5
Sudo/etc/init.d/apache2 restart
Test:
sudo vi/var/www/testphp.php
Write PHP works! Save Exit VI.
Then enter http://127.0.0.1/testphp.php or http://localhost/testphp.php in the browser
If the PHP works! is displayed Indicates that the PHP configuration was successful.
3. Install MySQL
sudo apt-get install Mysql-server
Set the root password when prompted during Setup.
Note: Modify Password:
Mysql-uroot-p
Mysql>use MySQL;
Mysql>update user Set Password=password (' New password ') WHERE user= ' root ';
Mysql>exit
Restart MySQL, or refresh the permissions.
Reboot: sudo/etc/init.d/mysql Restart or restart MySQL
4, let Apache, PHP support MySQL
sudo apt-get install Libapache2-mod-auth-mysql
sudo apt-get install Php5-mysql
Sudo/etc/init.d/apache2 restart
The installation of the ubuntu+apache2+php 5+mysql is complete.
Tips:
/etc/apache2/under:
1, apache2.conf is the main configuration file, httpd.conf user profile
2, the virtual directory in the httpd.conf
DocumentRoot "Path"
ServerName Name
#Listen 127.0.0.1:80 #注意这个文件中不能写上监听, if you have to write, then you need to apache2.conf the include/etc/apache2/ports.conf to comment out, Because the ports.conf is already listening to port 80.
3, directory settings in/etc/apache2/sites-enabled/000-default can set up a virtual host
4, PHP.ini:/etc/php5/apache2/php.ini
5, MYSQL.CNF:/etc/mysql/my.cnf
4, restart Apache:/etc/init.d/apache2 restart
5, restart Mysql:sudo/etc/init.d/mysql restart or restart MySQL
6. log file:/var/log/apache2/
Second, the GD library installation
sudo apt-get install PHP5-GD
Sudo/etc/init.d/apache2 restart
third, curl extended installation
sudo apt-get install Php5-curl
Sudo/etc/init.d/apache2 restart

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.