Install and modify Apache2 port in Ubuntu

Source: Internet
Author: User
Tags fully qualified domain name icinga
Linux: Ubuntu13.04 because the local machine has Nginx, there is no need to install Apache2. However, to learn how to use icinga today, let's take a look at apache2. Now we are familiar with icinga and use Nginx to replace Apache2. Installation is simple: apt-getinstallapache2 and Automatic startup failed, because my Nginx occupies port 80 and port 443. Whereisapach

Linux: Ubuntu 13.04

Because the local machine has Nginx, there is no need to install Apache2.

However, to learn how to use icinga today, let's take a look at apache2. Now we are familiar with icinga and use Nginx to replace Apache2.

Installation is simple:

Apt-get install apache2

Then auto start fails because Nginx occupies port 80 and port 443.

Find the/etc/apache2 directory through whereis apache2

Okay. Open the ports. conf file in this directory,

Change all port 80 to 81,443.

Then, read the file comment and say the/etc/apache2/sites-enabled/000-default file is required. After the file is opened

Set

Modify it to 81, and then you can see that the root directory is under/var/www.

Check the index.html file in/var/www/directory.

It works!

This is the default web page for this server.


The web server software is running but no content has been added, yet.


Restart apache2 now

Service apache2 restart

* Restarting web server apache2 apache2: cocould not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... Waiting apache2: cocould not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[OK]

You can open the/etc/apache2/apache2.conf file.

Add the previous sentence:

ServerName localhost

After restarting again, the error disappears.

Open the webpage and enter localhost: 81address. The index.html page is displayed.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.