Ubuntulamp (apache + mysql + php) environment construction
Source: Internet
Author: User
Ubuntulamp (apache + mysql + php) environment setup 1. environment installation 1. after installing the apache2sudoapt-getinstallapache2, open: http: // localhost/or http: // 127.0.0.1 in your browser if Itworks appears! Verify that apache is successfully installed ....
Ubuntu lamp (apache + mysql + php) environment setup I. environment installation 1. install apache2 sudo apt-get install apache2 and open http: // localhost/or http: // 127.0.0.1 in the browser! Verify that apache is successfully installed. Www.2cto.com 2. install PHP sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 sudo/etc/init. d/apache2 restart
Test: writing sudo vi/var/www/testphp. php to php works! Save and exit vi. Then input http: // 127.0.0.1/testphp. php or http: // localhost/testphp. php in the browser if php works is displayed! Indicates that the php configuration is successful. 3. install MYSQL sudo apt-get install mysql-server and set the root password as prompted during installation.
Note: change the password: mysql-uroot-p mysql> use mysql; mysql> update user set PASSWORD = password ('New password') WHERE user = 'root '; mysql> exit to restart mysql, or refresh the permission to restart: 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 now Ubuntu + apache2 + php 5 + mysql installation is complete. Tip:/etc/apache2/: 1. apache2.conf is the main configuration file, httpd. conf user configuration file 2. the virtual directory is in httpd. in the conf file, DocumentRoot "path" ServerName # Listen 127.0.0.1: 80 # note that you cannot write a listener in this file. if you must write a listener, you need to first include/etc/apache2/ports under apache2.conf. conf to comment out, because ports. port 80 has been monitored in conf
3. set the directory to/etc/apache2/sites-enabled/000-default. you can set the VM 4 and 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/
II. install sudo apt-get install php5-gd sudo/etc/init in GD Library. d/apache2 restart 3. curl extension install sudo apt-get install php5-curl sudo/etc/init. d/apache2 restart
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.