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 servers 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.