Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed steps for ubuntu system installation lamp environment configuration

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the detailed steps of ubuntu system installation lamp environment configuration". In the daily operation, I believe that many people have doubts about the detailed steps of ubuntu system installation lamp environment configuration. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "detailed steps of ubuntu system installation lamp environment configuration". Next, please follow the editor to study!

Quickly install LAMP under ubuntu

1. Installation

Enter the command directly at the terminal:

The code is as follows:

Sudo apt-get install apache2 mysql-server mysql-client php5 php5-gd php5-mysql

Follow the prompts to enter the root password, and after execution, both apache mysql and php are installed

two。 Change file permissions

After the LAMP build is installed, the default setting of the PHP network server root directory is: / var/www. Due to the security principle of the Linux system, the read and write permissions of files in this directory are only allowed by root users, so we cannot create new php files in the www folder, nor can we modify and delete them. We must first modify the read and write permissions of the / var/www directory. File permissions cannot be modified by right-clicking in the interface manager, so you have to execute the root terminal command: sudo chmod 777 / var/www. You can then write to the html or php file.

3. Install phpmyadmin

Enter the command at the terminal:

The code is as follows:

Sudo apt-get install phpmyadmin

Follow the prompts to enter the password and start the download and installation. During the installation process, you will be asked to select Web server:apache2 or lighttpd, select apache2, press tab, and then confirm. Then you will be asked to enter the set Mysql database password connection password Password of the database's administrative user. Then connect phpmyadmin to apache2, take mine as an example: the www directory is in / var/www,phpmyadmin / usr/share/phpmyadmin directory, so use the command: sudo ln-s / usr/share/phpmyadmin / var/www to establish a connection.

Phpmyadmin test: open http://localhost/phpmyadmin in the browser address bar. See if phpmyadmin is installed successfully.

4. Let apache support .htm .html .php

Open the apache configuration file:

The code is as follows:

Sudo vim / etc/apache2/apache2.conf

Add any line in this file:

The code is as follows:

AddType application/x-httpd-php .php .htm .html

5. Modify apache2 default encoding

Open the apache configuration file:

The code is as follows:

Sudo vim / etc/apache2/apache2.conf

Add to any line:

The code is as follows:

AddDefaultCharset UTF-8

Note: every time you make changes to the configuration file of apache, you need to restart apache to take effect. The command to restart apache is:

The code is as follows:

Sudo / etc/init.d/apache2 restart

Several terminal commands commonly used by LAMP components

The code is as follows:

Restart apache:sudo / etc/init.d/apache2 restart

Restart mysql:sudo / etc/init.d/mysql restart

Configure php.ini:sudo gedit / etc/php5/apache2/php.ini

Configure apache2.conf:sudo gedit / etc/apache2/apache2.conf

Configure my.cnf:sudo gedit / etc/mysql/my.cnf

PHP CGI: sudo / var/www/cgi-bin/

At this point, the study on the "detailed steps of ubuntu system installation lamp environment configuration" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report