Linux Website Construction Instance

Source: Internet
Author: User
Tags http authentication php source code

We know that Windows website construction is generally IIS + ASP + sqlserver, while Linux website construction is Apache + PHP + MySQL. There is a gap between the two, but why do we choose Linux-Apache + PHP + MySQL for building many portal websites? Of course, it is its security. Apache is the world's top Web
Server, according to netcraf's survey, more than 50% of the world's Web
The server is using Apache. When building the platform, you can also directly use the RPM package for installation. However, since the RPM package is not supported on some systems, we use a more general method: directly install it from the source code.

Apache features:

1) It can run on almost all computer platforms.

2) simple and powerful file-based configuration (httpd. conf)

3) supports General Gateway Interface (CGI)

4) supports virtual hosts.

5) supports HTTP authentication.

6) Integrate Perl.

7) you can use a web browser to monitor the server status and customize logs.

(8) supports server-side commands (SSI ).

9) supports Secure Socket Layer (SSL ).

10) tracking of user sessions.

11) FastCGI support

12) Integrated Proxy Server

What I want to build dynamic websites today is to install MySQL, Apache, and PHP first.

The procedure is as follows:

I. Install MySQL

1. Download MySQL (connected to a physical machine). First, let's look at the connectivity between the virtual machine and the physical machine. The virtual machine is 192.168.0.13 and the physical machine is 192.168.0.114. restart the network service: Service Network restart, and ping the physical machine.

It is found that the network connection is normal. You can link # smbclient/192.168.0.114/src-u administrator. after entering the page, check the source code package and LS command.

See httpd-2.0.58.tar.gz \ mysql-4.0.27.tar.gz \ php-4.4.2.tar.gz is the source code we used in the test package.

Enter the Get File Name (MySQL first)

2. decompress the file

Decompress the file: gzip-D compressed file when decompressing a file in .gz format. when decompressing a file in. Tar format: tar-xvf compressed package name; when decompressing a file in .tar.gz format: tar-zxvf compressed package name;

3. Go to the source code directory.

Like windows, the command to enter is also CD.

4. Create a MySQL group. The GID is the groupadd group name.

5. Create a MySQL user to specify to the MySQL Group

6. Preparations before Compilation

When you see the following results, you have prepared for the compilation.

7. Compile

8. Compile and install

9. Copy the MySQL configuration file to/etc/My. CNF

10. Enter the installation directory

11. Use a MySQL user to initialize a database

12. The owner of all files in the current directory is changed to root.

13. Convert the sub-file owner under the VaR directory and VAR directory to MySQL.

14. All file groups in the current directory are changed to MySQL.

15. Start the MySQL database in the background

Press enter to see if you can exit. If you cannot exit, congratulations. You have done all the previous experiments in white.

Ii. install Apache (CTRL + C and CTRL + V below, because the steps for installing Apache and PHP are similar to those for installing MySQL)

1. Download Apache

Check if the download is complete. Use ls to check the download.

Yes. httpd-2.0.58.tar. GZ (Apache source code package)

2. Extract

3. Go to the source package directory

4. Preparations before Compilation

5. Compile

6. Compile and install

7. Start Apache manually

So how can we know if what we are doing is successful? Is Apache installed correctly? View port 80

Iii. PHP installation

1. Download PHP

2. decompress the PHP source code package (because I am currently logged on to a physical machine, I have to decompress it) and exit the quit command.

3. Go to the source code directory.

4. Preparations before Compilation

An error may be reported here. It may be that the firewall of your VM is still on. After you turn it off, it will be gone. Also pay attention to the command, in the with-apxs2, may have a friend wrong to the 2 into Z habitual this is, this is my mistake, give it to everyone.

After a while

5. Compile

6. Compile and install

7. Copy the PHP configuration file

8. Modify the Apache configuration file to identify the Web file ending with. php.

In the command mode, we have to switch to the input mode for modification. The switching method is to press any one of the keys a, I, and O. At the end of the script (in uppercase), edit and modify it. Enter addtype application/X-httpd-PHP. php.

Now, the installation process is complete. But write some verification code.

Restart the apache service, stop Apache, and enable it.

Ah, the exciting moment is coming... The IP address of my VM is 192.168.0.13. Check whether the task is successful.

Summary:

1: If you are doing this on a VM, you and your physical server cannot be pinged during sharing, so let's take a look at these aspects, such as Windows Firewall, Linux firewall, and nic of other virtual machines on your physical machine.

2: What I said earlier must be accurate to the correct command. I think it's okay. In fact, just like vswitches and vrouters, Linux supports tab completion. The habit of creating tab completion is quite good.

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.