Ubuntu assembly lamp environment + phpmyadmin

Source: Internet
Author: User
Ubuntu install lamp environment + phpmyadmin & nbsp; A: Apachesudoapt-getinstallapache2 2: phpsudoapt-getinstallphp5libapache2-mod-php5 (1) install php required plug-in: sudoapt-getinstallphp5-mys ubuntu install lamp environment + phpmyadmin

I. Apache

Sudo apt-get install apache2


II. php


Sudo apt-get install php5 libapache2-mod-php5


(1) install php essential plug-ins: sudo apt-get install php5-mysql php5-curl php5-gd php5-idn php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite


III. Mysql


Sudo apt-get install mysql-server


During installation, mysql prompts you to set the root password.


4. after the installation is complete, run localhost to view "it works"


5. download and install phpmyadmin


According to my personal needs, my phpmyadmin is located in the www root directory


Cd/var/www


Sudo wget url (phpmyadmin)


Decompress: unzip phpmyadmin.zip


VI. configure the Apache virtual machine


Unlike apache in Windows, there is usually only one configuration file, namely httpd. conf.


In Linux, the configuration file of Apache is/etc/apache2/apache2.conf. Apache automatically reads the configuration information of this file at startup. Some other configuration files, such as httpd. conf, are included through the Include command.


There is the sites-enabled Directory in apache2.conf, and there is a sites-available directory under/etc/apache2. In fact, this is the real configuration file, the sites-enabled Directory stores only symbolic links to the files here. you can use ls/etc/apache2/sites-enabled/to confirm it.


Therefore, if multiple virtual hosts are configured on apache and the configuration files of each virtual host are stored in sites-available, it is very convenient to disable and enable the virtual host: when a link is established under sites-enabled to a virtual host configuration file, it is enabled. to disable a virtual host, you only need to delete the corresponding link, you do not need to modify the configuration file.


Let's configure the Apache virtual host! There are two methods


The first type is the same as that in Windows:


Nano/etc/apache2/sites-enabled/000-default


Configure the code


ServerAdmin adminstrator@xin.com

ServerName www. kcloud. cc

DocumentRoot/var/www/kcloud

Write it in, save it, and restart Apache sudo/etc/init. d/apache2 restart OK!


Second:


Copy/etc/apache2/sites-avaliable/default, kcloud // copy the same kcloud file as the default configuration file


Modify the configuration file kcloud nano/etc/apache2/sites-avaliable/default


ServerAdmin webmaster @ localhost

ServerName www. kcloud. cc

DocumentRoot/var/www/kcloud

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Order allow, deny

Allow from all

ScriptAlias/cgi-bin // usr/lib/cgi-bin/

AllowOverride None

Options + ExecCGI-MultiViews + SymLinksIfOwnerMatch

Order allow, deny

Allow from all

ErrorLog $ {APACHE_LOG_DIR}/error. log

# Possible values include: debug, info, notice, warn, error, crit,

# Alert, emerg.

LogLevel warn

Create a link file:


Sudo ln-s/etc/apache2/sites-available/kcloud/etc/apache2/sites-enabled/kcloud


Restart apache server


Sudo/etc/init. d/apache2 restart

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.