Linux Server installation apche2 and important configuration

Source: Internet
Author: User
Tags fully qualified domain name

Ubuntu Server Installation Apache2

Command: sudo apt-get install apache2

Prompt: Could not reliably determine the server ' s fully qualified domain name, using 127.0.1.1 for ServerName

Workaround:

sudo vi/etc/apache2/apache2.conf

1. After entering the password, enter the edit mode and add ServerName localhost in the blank space.

2. Press ESC and shift+: Enter Wq save and exit the Reference VI editor that you do not understand

3.sudo apache2ctl configtest Start service now displayed as Syntax OK

4.sudo/etc/init.d/apache2 start

One, Apache configuration file description
Ubuntu and Debian have made a lot of customizations to the Apache2 package, and many configuration files have different layouts than the original apache2. The following is a description of each of the configuration files in the/etc/apache2 directory:

*apache2.conf--Global configuration file
*conf.d/--This directory holds some general configuration
*envvars--storage environment variables, generally do not need to modify
*httpd.conf--User Configuration Files
*mods-available/--in this directory are the available modules that are already installed
*mods-enabled/--in this directory is a module that is already enabled
Ports for *PORTS.CONF--HTTPD Services
*sites-available/--virtual hosts available in this directory
*sites-enabled/--The directory is a virtual host that is already enabled

which Apache2.conf is the master configuration file for apache2, which reads all the directories and files listed above (except for the sites-available directory, because Apache does not need to know which virtual hosts are available, it only needs to load those enabled virtual hosts. )

Second, the test is successful

1. You can install a w3m text Web browser in Ubuntu and execute the following command:

sudo apt-get Install w3m

2. Implementation

w3m localhost

When the page appears, the Apache configuration succeeds

Third, public network access

First, you need a public network IP

To access your public IP, the following pages appear:

Description successfully configured

If it fails: The cause may occur:

Server firewall policy is not open 80 port

Workaround:

Set security Group Policy, open port 80.

Linux Server installation apche2 and important configuration

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.