Use source code to compile and install apache2.2.26 under Ubuntu

Source: Internet
Author: User

Download httpd-2.2.26.tar.gz (download address), execute

sudo tar xzfv httpd-2.2.26.tar.gz cd  httpd-2.2.26sudo./configure--prefix=/usr/local/apache2--enable-module= Most--enable-rewrite--enable-shared=max--enable-so

If you are prompted with the following error:

Checking for C compiler default output file name ... Configure:error:c compiler cannot create executables

The reason is that Libc6-dev is not installed, performing

sudo apt-get install build-essential

It's OK.

Then re-execute:

sudo  ./configure--prefix=/usr/local/apache2--enable-module=most--enable-rewrite--enable-shared=max-- Enable-so

No error, then execute

sudo makesudo make Installsudo groupadd apachesudo useradd-g Apache apachesudo passwd apachesudo chown-r apache:apache/ Usr/local/apache2

Modify the Apache configuration file to perform

sudo vi/usr/local/apache2/conf/httpd.conf

Found it

User Nobodygroup #-1

Modified into

User Apachegroup Apache

Found it

#ServerName www.example.com:80

Switch

ServerName *:80

Save!

Execute command

Sudo/usr/local/apache2/bin/apachectl start

Launch Apache.

Open Browser, Access http://localhost

If all goes well, you should see the Apache test page. Congratulations, Apache's installed!

The commands to restart and close the Apache service are:

Sudo/usr/local/apache2/bin/apachectl Restartsudo/usr/local/apache2/bin/apachectl Stop
  • 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.