how-to-install-lamp-xampp-server-on-beaglebone-black,acces hardware control through internet

i am unable to install lamp or xampp server on my BBB.when i typed

sudo apt-get install apache2

it says “sudo :command not found”

opkg install php php-cgi php-cli opkg install lighttpd lighttpd-module-fastcgi opkg install mysql5

also the above commands do not work.The error says “unknown package …”

Basically i am trying to develop a webserver which over the internet can be accessed to control hardware interfaced to BBB.

is there any way to solve this problem.I am using only usb connection to connect BBB using putty.

Well you are confusing two different package managers together with what
you stated. apt-get is Ubuntu/Debian opkg would be Angstrom/Yocto . So
which are you actually on?

Next you would need to install sudo to get rid of the can't find sudo
apt-get install sudo
opkg install sudo
then you would need to create a user and setup sudo properly for that
user. Sudo is not needed if you're only running with a root user.

To install apache on a Debian/Ubuntu based system
apt-get install apache2
or you could do a tasksel to install the full LAMP stack.
tasksel install lamp-server

For Angstrom I do not know how they are packaging it up so can't suggest

Hopefully that should get you going further in the process.