On this page:
LAMP is not a program.
It just means that you are using on Linux: the Apache web server, Mysql database, and Php.
You would also have PHPMyAdmin and some other useful tools.
It's easier to do it than it is to write it! But here is a checklist for installing and configuring Apache, MySQL, and PHP on Linux.
For some reason the Skype programmers made Skype to start up using ports 80 and 443. These are the ports that your webserver uses! If Skype is using them, your Apache won't work. So we tell Skype not to use those ports.
Tools -> options -> connections
(You can now restart Skype any time.)
2a. It may already be installed when you installed your Linux.
Try typing at the command line:
2b. For any that are not found, install them through your Package Manager, or command line apt-get (ubuntu) or yum (fedora/redhat).
Now open a browser window (FireFox, right?!), and type in the address box:
You should see a web page, with some information about your server. This is showing you an index file in the "document root".
Congratulations! You have a web server!
"localhost" is the local name of your web server on your computer.
In fact, it is the local name of everyone's own web server on their own computer. It is kind of like "me", or "ང་".
My machine (linux laptop) is also localhost. The Macintosh at NAVA Office is also localhost. Your MSwndws machine is localhost. Your friend's MSwndws machine is localhost too. The TibetBridges.com server is localhost, and so is the Yahoo.com server, and the Google.com server, and ... Anyone who has a web server on their machine, their local "domain name" is localhost.
As root (or with sudo),
type httpd -k stop
Now reload that 'localhost' page.
The page won't show, and you should see an error message.
Because the web server (apache) is not running, so it can't "serve" the web page at localhost.
If the page still loads, try shift-reload.
This makes the browser try to get the page from the server, not from its cache.
If it still loads — check your browser settings, (e.g., firefox or msie) and make sure that it is not caching pages.
tools -> options -> ... "always get the newest page" ... something like that
Apache is telling us what is wrong, but where can we see what it is telling us?
Now we need to get to the command line (linux terminal or windows dos prompt) to see what apache is telling us.
On Linux the server usually gets the files from /var/www/. This is called the "document root".
"document root" means, the "root", the topmost folder, where Apache looks
for files to serve.
So we say that /var/www/ is the localhost document root.
Go to that folder, you may see an index.php or index.html file.
4a. You can delete all the files in that folder, and put your own website there.
Q. Can i just copy the website folder which has all the folders and files for my website?
A. Copy everything *inside* your website folder — but not the folder itself. Remember that Apache is looking directly into 'www' for an index.html page. You want it to see the index.html of your website, not the folder of your website!
4b. Shift-reload localhost in the browser, and you should see your own website.
4c. This is now where you will work on your website, and view it in the browser, and everything will work just like on the live web server. Actually if you have server-side-includes they won't work yet, but we can fix that!)
All the below are extra. If you are happy with the way your web server is working, you don't need to do any of the next steps.
To set preferences for Apache web server,
we edit a text file called
httpd.conf file will be in /etc/httpd/conf/
It is a normal text file, and you can edit it in any text editor, such as gedit or vi.
Notice the lines in the httpd.conf file that have a
# in the beginning.
They are comments. They don't do anything for Apache, but they are
very useful to us!
If you read the comments for the part of the file you are are working on, you will slowly gain good knowledge of Apache and all web servers.
To set up Apache for server-side includes (SSI), we need to edit two places in
1. Search in the file for something that looks like this:
AddOutputFilter INCLUDES .shtml .htm
You can delete the .shtml and .htm you see there.
Add .html at the end of that line. So it will now look like this:
AddOutputFilter INCLUDES .html
2. Then search in the file for a line that begins
+Includes to that line:
You may not want your document root in /var/www/. For example, i like my web folder to be called "websites". No problem! You can make a folder anywhere on your system that you want. Then you tell Apache that the document root is in that folder.
You do this in two places in the httpd.conf file::
and just a few more lines down:
See the Virtual Hosts how-to
If you are doing PHP programming,
If you are using the MySQL database, make a database using the MySQL command-line or phpMyAdmin, and see if it works. Write a little PHP script to connect to your database, put it in your document root, and see if it works.
There is a very nice web-based MySQL client called
You can use this program to do everything with MySQL,
such as create databases, create tables, view and enter data, etc etc etc.
phpMyAdmin, type in your browser address bar:
There is a config file in the phpMyAdmin directory, where you may need to put the username and password for your database. (I know this is a little unclear ... The config file is in different places in Ubuntu and Fedora. Google will help you find it; and the phpmyadmin website will help you with configuration howtos!)
Many people in the world are using Apache, PHP, and MySQL, so there are many great resources on the web, to find out anything you want to know.
When i have problems, i usually find good answers when i go to google and type in some words about it.
All content not copyright by anyone else is
copyright © 2003–2012 James Walker.
License for use is the GNU Free Documentation License. Find it:
here in the License directory
or at the Free Software Foundation, www.fsf.org
It would be great to have Tibetan and Chinese translations of this page. Can you help? Contact us! http://tibetangeeks.com/contact/