Set up LAMP in Linux

Source: Internet
Author: User
1 & gt; CentOSyuminstallmysqlmysql-serverchkconfig -- levels235mysqldonetcinitdmysqldstartmysql_secure_installationyuminstallhttpdchkconfig -- levels23

1> CentOS

Yum install mysql-server

Chkconfig -- levels 235 mysqld on
/Etc/init. d/mysqld start
Mysql_secure_installation
Yum install httpd
Chkconfig -- levels 235 httpd on
/Etc/init. d/httpd start
Yum install php
/Etc/init. d/httpd restart
Vi/var/www/html/info. php
In CentOS
The default Apache root directory is/var/www/html.
Configuration file/etc/httpd/conf/httpd. conf
Other configurations are stored in/etc/httpd/conf. d/
Phpinfo ();
?>
Yum search php
Yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

/Etc/init. d/httpd restart

2> Ubuntu

1. install Apache
Sudo apt-get install apache2
2. test Apache
Http: // localhost/
3. install PHP5
Sudo apt-get install php5 libapache2-mod-php5
Sudo/etc/init. d/apache2 restart
4. test PHP
Sudo gedit/var/www/testphp. php

Http: // localhost/testphp. php
5. install MySQL
Sudo apt-get install mysql-server
Mysql-u root
Mysql> set password for 'root' @ 'localhost' = PASSWORD ('yourpassword ');
Sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin




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.