|
Linux is becoming more and more desktop friendly but the most common use of Linux and Unix like OSs is for a web server. If you wish to set up a web server at zero cost this guide will give you some pointers.
What is LAMP server? Its short for Linux-Apache-MySQL-PHP.
First, to be clear, you can use any Linux flavor but this guide is for Ubuntu as that is the OS I'm currently using on my PCs.
Firstly you need to decide if your server will be a server only, without graphical interface and desktop environment, or it will be a usual desktop setup with a added on server. Either way you can find a Ubuntu desktop and server install CDs at ubuntu.com
I will be discussing here a server install on a Desktop pc as this guide is meant for beginners.
Once you have a Ubuntu system up and running the way you want and you have enabled universe and multiverse repositories (find out how to do things in Ubuntu section) you can start installing extra bits required for a server.
You can find a complete guide at Ubuntu Documentation site.
To install Apache + PHP5 + MySQL
write following into the terminal (one line at the time):
sudo aptitude update
sudo aptitude install apache2 mysql-server libapache2-mod-auth-mysql php5-mysql
A useful application to control MySQL database is called MyPHPadmin and you can install it by:
sudo aptitude install phpmyadmin
To run it go to your browser and http://localhost/phpmyadmin
Use the following command to run Apache :
sudo /usr/sbin/apache2ctl start
To stop it, use :
sudo /usr/sbin/apache2ctl stop
Finally, to restart it, run :
sudo /usr/sbin/apache2ctl restart
If you get this error when you start Apache2:
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
then edit
gksudo gedit /etc/apache2/apache2.conf
and add
ServerName localhost
at the end of the file
Using Apache
You can access apache by typing 127.0.0.1 or http://localhost (by default it will be listening on port 80) in your browser address bar. By default the directory for apache server pages is /var/www . It needs root access in order to put files in. To change permissions to yourself type in terminal (change yourusername):
sudo chown -R yourusername /var/www
Now this was a very short version of how to get a LAMP server. There are few bits that you should know and also you may want to install PHP4 instead of PHP5.
Ubuntu wiki has more information on how to get the Ubuntu Server going, some troubleshooting tips, how to create a database tips etc. - Here>>
Apaches website - Here>>
|