Ubuntu server installation and configuration apache2

Although many people have written to configure apache under ubuntu, I did encounter some problems during the installation and configuration, and solutions can be obtained through Baidu, but I want to turn other people's things into my own.
Effect after successful configuration
After the success of the configurations
because my ubuntu server has been brought ngnix, and Baidu what is said can coexist without conflict, but to change the port, ngnix has occupied the port 80.

【first step】sudo apt-get install apache2

After the first step, we start apache,service apache2 restart

Then there will be an error:
Could not reliably determine the server's fully qualified domain name

Refer to this article after Baidu:
http://blog.csdn.net/yyzhq/article/details/25418323

But I could not find the path of apache2, so I used the command dpkg -S softwarename to find the path of apache2, mine is /etc/apache2,

then

cd /etc/apache2 ;
vi apache2.conf;

Add at the end of the file

#ServerName www.example.com
ServerName localhost

Here is localhost, not 127.0.0.1 is to prevent errors, I saw a person's blog saying that the test address of apache2 should be 127.0.1.1, I don’t know which one, so let’s just write localhost.

Then restart apache again, still unsuccessful, this is

Question 2

Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

This is because the port is occupied, so I found this article
"Ubuntu Install and Modify Apache2 Port"
http://www.linuxidc.com/Linux/2013-05/84312.htm

Just follow him, it’s so cool

Guess you like

Origin blog.csdn.net/sinat_35803474/article/details/77164846