Install Apache in Ubuntu

Source: Internet
Author: User
Tags fully qualified domain name
This installation method uses the tar package source code in Ubuntu. Go to the official website to download the source code package apache2.2.17: Release ~ Httpd-2.2.17sudotarzxvfhttpd-2.2.17.tar.gz ~ Http-2.2

This installation method uses the tar package source code in Ubuntu.
Go to the official download apache2.2.17 source package: http://www.apache.org/dist/httpd/httpd-2.2.17.tar.gz

1.decompress httpd-2.2.17.tar.gz to the temporary directory, as shown in ~ Httpd-2.2.17
Sudo tar zxvf httpd-2.2.17.tar.gz ~ Http-2.2.17
2. Go ~ /Apache directory, run
Sudo./configure -- prefix =/usr/server/apache2 -- enable-module = so
Sudo make
Sudo make install

In actual execution, you may be required to have the root permission, so you must use sudo

3. Start and Stop apache
Start: sudo/usr/server/apache2/bin/httpd-k start
Prompt at startup:
Httpd: cocould not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName.
The solution is to add a line in http. conf:
ServerName 127.0.0.1: 80
Otherwise, it can only be accessed locally with 127.0.0.1, and other computers cannot access the website

Stop: sudo/usr/server/apache2/bin/httpd-k stop

4. Enable Ubuntu to automatically start apache.
1). Copy/usr/server/apache2/bin/apachectl to/etc/init. d
2) load as a service
Sudo update-rc.d apachectl defaults

Restart the system and access http: // localhost/. If the apache webpage is displayed, the Automatic startup is successful.

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.