Saturday, May 07, 2011

Apache on Ubuntu. Install/Uninstall

=> i like to change to root, though this is not recommended. please use sudo.

skranga@ubuntu:~$ sudo bash

[sudo] password for skranga:

=> get the version of ubuntu

root@ubuntu:~# cat /etc/issue

Ubuntu 10.10 \n \l

=> install apache now (please add sudo before the command if you are running as root. Please be patient it can take time to install the software, on a slow connection.

root@ubuntu:~# apt-get install apache2

Reading package lists... Done

* Starting web server apache2 [ OK ]

Setting up apache2 (2.2.16-1ubuntu3.1) ...

Processing triggers for libc-bin ...

ldconfig deferred processing now taking place

=> Open a browser and enter http://localhost

If Apache is installed successfully you should see something like this

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

=> How to start, stop and check status of the Apache Server.

root@ubuntu:~# /etc/init.d/apache2 status

Apache2 is running (pid 13872).

root@ubuntu:~# /etc/init.d/apache2 stop

* Stopping web server apache2 ... waiting [ OK ]

root@ubuntu:~# /etc/init.d/apache2 start

* Starting web server apache2 [ OK ]

root@ubuntu:~#

=> How to uninstall Apache. I selected no in the below example. You should select Yes if you wish to uninstall it.

root@ubuntu:~# apt-get remove apache2

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages were automatically installed and are no longer required:

apache2-mpm-worker libapr1 libaprutil1-ldap apache2-utils apache2.2-common libaprutil1-dbd-sqlite3

apache2.2-bin libaprutil1

Use 'apt-get autoremove' to remove them.

The following packages will be REMOVED:

apache2

0 upgraded, 0 newly installed, 1 to remove and 323 not upgraded.

After this operation, 36.9kB disk space will be freed.

Do you want to continue [Y/n]? n

Abort.

No comments: