Ubuntu offers us su apt-Getwith the install command, you can easily install some software that is placed on the server where Ubuntu is placed in various places, and if the software you want to install is more common, it can usually be downloaded. sudo apt-Getinstall apache2 Apache on Ubuntu in two ways:1Use packaged services for development packages, such as using the Apt-get command;2build Apache from the source code. This article describes the two different installation methods in detail. Method One: Use packaged services for the development package--APT-Getto install Apache, enter the command in the command line terminal: $ sudo apt-GetInstall apache2 Restart Apache, sudo service apache2 Restart can also sudo/etc/init.d/apache2 Restart Test:
Enter HTTP in the browser://localhost or http://127.0.0.1, if you see the IT works!, it means that Apache installed successfully, Apache default installation, will be in/var under a directory called WWW, this is the Web directory, All Web files that can be accessed by the browser are placed in this directory.
If you feel you don't need Apache anymore, you can uninstall it:1. Delete Apache on the command line type: $ sudo apt-Get--purge Remove apache-common$ sudo apt-Get--purge Remove Apache2. Locate the configuration file that is not removed, and remove the code: $ sudo find/etc-name"*apache*"|xargs RM-RF $ sudo rm-RF/var/Www$sudo RM-rf/etc/libapache2-mod-JK3Delete the association so that you can use apt-again.GetInstall apache2 re-installed #dpkg-L |grep Apache2|awk'{print $}'|xargs dpkg-phttp://blog.csdn.net/xysnake/article/details/5993467http//www.linuxidc.com/Linux/2013-06/85827.htm
Install Apache under Ubuntu