Cần người cài LAMP trên CentOS 6 - Có trả công đầy đủ!!!

#centos #Lamp #Lp

LAMP là một từ viết tắt phổ biến của Linux, Apache, MySQL và PHP.Nó là một ngăn xếp phần mềm được sử dụng để tạo các ứng dụng web động.Centos là một phân phối Linux dựa trên Red Hat Enterprise Linux.Trong hướng dẫn này, chúng tôi sẽ chỉ cho bạn cách cài đặt đèn trên Centos 6.

** Điều kiện tiên quyết **

Trước khi bạn bắt đầu, bạn sẽ cần cài đặt các phần sau trên hệ thống của mình:

* Centos 6
* Kho lưu trữ epel
* Máy chủ web Apache
* Máy chủ cơ sở dữ liệu MySQL
* Ngôn ngữ lập trình PHP

** Cài đặt kho lưu trữ epel **

Kho lưu trữ EPEL là một kho lưu trữ các gói phần mềm bổ sung cho Centos.Chúng tôi cần cài đặt kho lưu trữ này để chúng tôi có thể cài đặt các phiên bản mới nhất của Apache, MySQL và PHP.

Để cài đặt kho lưu trữ EPEL, hãy chạy lệnh sau:

`` `
sudo yum cài đặt phát hành epel
`` `

** Cài đặt Apache **

Apache là máy chủ web sẽ được sử dụng để phục vụ ngăn xếp đèn của chúng tôi.Để cài đặt Apache, hãy chạy lệnh sau:

`` `
sudo yum cài đặt httpd
`` `

** Bắt đầu và cho phép Apache **

Khi Apache đã được cài đặt, chúng ta cần bắt đầu và kích hoạt nó để nó sẽ tự động bắt đầu khi hệ thống khởi động.Để làm điều này, hãy chạy các lệnh sau:

`` `
sudo systemctl start httpd
sudo systemctl cho phép httpd
`` `

** Cài đặt mysql **

MySQL là máy chủ cơ sở dữ liệu sẽ được sử dụng để lưu trữ dữ liệu của LAMP Stack.Để cài đặt MySQL, hãy chạy lệnh sau:

`` `
sudo yum cài đặt mysql-server
`` `

** Bắt đầu và kích hoạt MySQL **

Khi MySQL đã được cài đặt, chúng tôi cần bắt đầu và bật nó để nó sẽ tự động bắt đầu khi hệ thống khởi động.Để làm điều này, hãy chạy các lệnh sau:

`` `
sudo systemctl bắt đầu mysqld
sudo systemctl cho phép mysqld
`` `

**Đang cài đạt PHP**

PHP là ngôn ngữ lập trình sẽ được sử dụng để tạo các ứng dụng web động của Stack Stack của chúng tôi.Để cài đặt PHP, hãy chạy lệnh sau:

`` `
sudo yum cài đặt php
`` `

** Định cấu hình Apache **

Chúng ta cần cấu hình Apache để nó sẽ phục vụ các tệp PHP.Để thực hiện việc này, hãy mở tệp sau trong trình soạn thảo văn bản:

`` `
/etc/httpd/conf/httpd.conf
`` `

Tìm dòng sau:

`` `
<Thư mục/var/www/html>
`` `

Và thêm dòng sau đây:

`` `
Cho phép tất cả
`` `

Lưu và đóng tập tin.

** Định cấu hình mysql **

Chúng ta cần định cấu hình MySQL để nó cho phép các kết nối từ xa.Để thực hiện việc này, hãy mở tệp sau trong trình soạn thảo văn bản:

`` `
/etc/mysql/my.cnf
`` `

Tìm dòng sau:

`` `
adddress liên kết = 127.0.0.1
`` `

Và thay đổi nó thành phần sau:

`` `
address liên kết = 0,0.0.0
`` `

Lưu và đóng tập tin.

** Tạo cơ sở dữ liệu và người dùng **

Chúng tôi cần tạo cơ sở dữ liệu và người dùng cho ngăn xếp đèn của chúng tôi.Để làm điều này, hãy chạy các lệnh sau:

`` `
mysql -u root -p
`` `

Nhập mật khẩu cho người dùng gốc khi được nhắc.

`` `
Tạo cơ sở dữ liệu MyDB;
`` `

`` `
Tạo người dùng 'myuser'@'localhost' được xác định bởi 'myPassword';
`` `

`` `
Cấp tất cả các đặc quyền trên mydb.* Cho 'myuser'@'localhost';
`` `

** Đèn thử nghiệm **

Bây giờ đèn đó đã được cài đặt và cấu hình, chúng tôi có thể kiểm tra nó bằng cách tạo một tệp PHP đơn giản.

Tạo một tệp mới có tên `index.php` trong thư mục`/var/www/html`.

Mở tệp trong trình soạn thảo văn bản và thêm mã sau:

`` `
<?
=======================================
#centos #Lamp #linux #Webserver #ubuntu ##How to Install LAMP on CentOS 6

LAMP is a popular acronym for Linux, Apache, MySQL, and PHP. It is a software stack that is used to create dynamic web applications. CentOS is a Linux distribution that is based on Red Hat Enterprise Linux. In this tutorial, we will show you how to install LAMP on CentOS 6.

**Prerequisites**

Before you begin, you will need to have the following installed on your system:

* CentOS 6
* The EPEL repository
* The Apache web server
* The MySQL database server
* The PHP programming language

**Installing the EPEL repository**

The EPEL repository is a repository of additional software packages for CentOS. We need to install this repository so that we can install the latest versions of Apache, MySQL, and PHP.

To install the EPEL repository, run the following command:

```
sudo yum install epel-release
```

**Installing Apache**

Apache is the web server that will be used to serve our LAMP stack. To install Apache, run the following command:

```
sudo yum install httpd
```

**Starting and enabling Apache**

Once Apache has been installed, we need to start and enable it so that it will start automatically when the system boots. To do this, run the following commands:

```
sudo systemctl start httpd
sudo systemctl enable httpd
```

**Installing MySQL**

MySQL is the database server that will be used to store our LAMP stack's data. To install MySQL, run the following command:

```
sudo yum install mysql-server
```

**Starting and enabling MySQL**

Once MySQL has been installed, we need to start and enable it so that it will start automatically when the system boots. To do this, run the following commands:

```
sudo systemctl start mysqld
sudo systemctl enable mysqld
```

**Installing PHP**

PHP is the programming language that will be used to create our LAMP stack's dynamic web applications. To install PHP, run the following command:

```
sudo yum install php
```

**Configuring Apache**

We need to configure Apache so that it will serve PHP files. To do this, open the following file in a text editor:

```
/etc/httpd/conf/httpd.conf
```

Find the following line:

```
<Directory /var/www/html>
```

And add the following line below it:

```
AllowOverride All
```

Save and close the file.

**Configuring MySQL**

We need to configure MySQL so that it will allow remote connections. To do this, open the following file in a text editor:

```
/etc/mysql/my.cnf
```

Find the following line:

```
bind-address = 127.0.0.1
```

And change it to the following:

```
bind-address = 0.0.0.0
```

Save and close the file.

**Creating a database and user**

We need to create a database and user for our LAMP stack. To do this, run the following commands:

```
mysql -u root -p
```

Enter the password for the root user when prompted.

```
CREATE DATABASE mydb;
```

```
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
```

```
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost';
```

**Testing LAMP**

Now that LAMP has been installed and configured, we can test it by creating a simple PHP file.

Create a new file called `index.php` in the `/var/www/html` directory.

Open the file in a text editor and add the following code:

```
<?
 
Join ToolsKiemTrieuDoGroup
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock