Build your own Web server in Ubuntu Linux

Source: Internet
Author: User

Build your own Web server in Ubuntu Linux

Previously, a Web Server for testing was built on Windows 2008 Server, but it was very slow to open a website, especially when loading images. At that time, it was thought that it was a path problem, however, it is very slow to open it on the server. I can't find the reason, so I plan not to throw it on a tree and try it in Linux.

It is often used as a server with CentOS, Ubuntu ...... considering that you only have Ubuntu images and do some simple tests, the selected version is Ubuntu 14.04 LTS. Build your own Web server on this platform.

Compared to the wamp integrated environment in Windows, LAMP is also available in Linux. Do not ask me what LAMP is. I want to understand what wamp can do. Okay. Let's get back to the truth.

Step 1: Build the LAMP environment in Ubuntu. First, install apache:

Sudo apt-get install apache2 apache2-doc

Test whether apache2 works properly:

Next, install mysql:

Sudo apt-get install mysql-server

Sudo apt-get install mysql-client

When installing mysql, you will be reminded to set the password for the root account.

It should be noted that he has no connection with your login account password.

Next, install php:

Sudo apt-get install php5

Sudo apt-get install libapache2-mod-php5 // install apache service support php Module

After installing and configuring some items, we need to restart apache to take effect.

Some may say the command is:

Sudo service apache2 restart

Don't be surprised when you enter this command to prompt for an error. You can try this command.

.

Here, we need to know that all we choose is Silent Installation, just like opening some services in windows, so we need to know the path and where the configuration file is.

The next step is to upload and construct some web pages. The steps for installing dede on windows yesterday are almost the same. Pay attention to the read and write permissions, in addition, the database password is not as empty as described in the previous article. The password is the one you set when installing mysql.

I have seen a lot of steps and tutorials written by others about building these environments. I think there are many modules that I don't understand, but they are just done by people. What is it, I am not very familiar with what role it plays. I should say that I don't understand it. So I have done it through the above steps. I can open the webpage, even though I still use other people's templates,

What I want to say is that it would be better to run apt-get install *** after an error occurs. At least I know what it is and what it affects.

Now, the problem arises.

Question 1:

Then, run the command to install the GD library to solve the problem!

Apt-get install php5_gd

Question 2:

Do you think there is always sudo in the command, which is very troublesome?

Therefore, we 'd better switch to the root account at the beginning or set to use root logon:

Sudo passwd root // No root account password by default. This command sets the root password.

Su // switch the root user command

The better way is to use root to log on to the user during the startup, saving too much trouble.

Question 3:

We need permissions. In windows, this is especially true in linux. when building a web site, you may be prompted to forbidden out of the test 127.0.0.1.

Don't be afraid. This is an obvious permission issue. It is better to directly mention the highest level of Privilege Escalation commands:

Chmod-R 777 the path of the document you want to escalate permissions to (for example, chmod-R 777/var/www /)

This is almost the case. End.

You may also like the following LAMP-related content:

Install Xcache and Memcached on the LAMP platform to accelerate website operation

Build a LAMP platform environment in CentOS 7

CentOS 6.5 system installation and configuration LAMP (Apache + PHP5 + MySQL) server environment

Configure the LAMP + phpMyAdmin PHP (5.5.9) development environment in Ubuntu 14.04

Install LAMP in Ubuntu 14.10

LAMP combines NFS to build a small blog site

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.