Compile and install apache2.2.26 using source code in ubuntu

Source: Internet
Author: User
Sudotarxzfvhttpd-2.2.26.tar.gzcdhttpd-2.2.26sudo.configure -- prefixusrlocalapache2 -- enable-modulemost -- enable-rewrite -- enable-sharedmax -- enable-so

Download httpd-2.2.26.tar.gz () and run

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 the following error is prompted:

checking for C compiler default output file name... configure: error: C compiler cannot create executables

The reason is that the libc6-dev is not installed, run

sudo apt-get install build-essential


Then run the following command again:

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

If no error is reported, run

sudo makesudo make installsudo groupadd apachesudo useradd -g apache apachesudo passwd apachesudo chown -R apache:apache /usr/local/apache2

Modify the apache configuration file and run

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


User nobodyGroup #-1


User apacheGroup apache




ServerName *:80


Execute command

sudo /usr/local/apache2/bin/apachectl start

Start apache.

Open a browser and access http: // localhost

If everything goes well, you can see the apache test page. Congratulations! apache has been installed!

The commands for restarting and disabling 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: 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.