Build a web server under Ubuntu 16.04

1. The content of this article  to build a Web server (MySQL+Apache) under Ubuntu 16.04 may refer to the predecessors on the Internet, but it has been improved. These settings may be different, and you need to modify them according to different situations.

2. Switch administrator status

You need to operate as root in ubuntu, so use the following command to ensure that you are logged in as root:

 Enter su and then enter the password.

3. Start installing mysql

apt-get install mysql-server mysql-client

You will be asked to provide a mysql root user password, we need to set the password in the red area.

new password for the mysql root user: repeat password for the mysql root user:

After filling in the database password, you must confirm the password.

4. Install apache2

Apache2 is a ubuntu package, so we can install it directly with the following command:

apt-get install apache2

Now, your browser to http://localhost, you should see the test page of apache2:

If it goes well, it will appear:

It worke!


The default document root directory of apache is the /var/www directory on ubuntu, and the configuration file is /etc/apache2/apache2.conf. The subdirectory where the configuration is stored is in the /etc/apache2 directory.



Guess you like

Origin blog.csdn.net/xifei66/article/details/73734035