On this page:
1. if Skype ...
2. install with WampServer2
3. test Apache
4. see your site
Extras:
configure Apache
test PHP and MySQL
phpMyAdmin
get help
WampServer2
is not really a program.
And it is not a "server".
It is just a very useful package that installs onto
msWindows: the Apache web server,
Mysql database, and Php.
It also installs PHPMyAdmin and some other useful tools.
And it gives you a nice little control panel
to manage the servers.
(Well yeah, that part is the WampServer2 program!)
It's easier to do it than it is to write it! But here is a checklist for installing Apache, MySQL, and PHP through WampServer2: (Helpful summary, with screen shots: WampServer.com/en/presentation.php)
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. Double-click on the WampServer2 installer icon.
2b. WampServer2 will ask you a few questions:
2c. Now WAMP will install everything, and put a little "W" in your system tray.
If you click on this icon (normal left-click), you will get a menu for managing your servers: starting, stopping, editing configuration files, etc.
Now open a browser window (FireFox, right?!), and type in the address box:
localhost
You should see a web page, with the WampServer2 logo and 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.
Go to the wamp menu, and turn off Apache ("Stop all services")
Your little wamp icon should now be white (i think?).
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.
For more options to see what apache is doing, type:
httpd -help
In MSWindows the server gets the files from C:\wamp\www. This is called the "document root".
"document root" means, the "root", the topmost folder, where Apache looks
for files to serve.
WampServer2 puts the document root inside your wamp folder:
C:\wamp\www
So we say that www is the localhost document root.
Go to that folder, you should see index.php and some image files.
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
Assuming you let WampServer2 install everything in its
default folder, the httpd.conf
file will be in
C:\wamp\bin\apache\Apache2.2.11\conf
It is a normal text file, and you can edit it in any text editor, such as Notepad++.
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
the httpd.conf
file:
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
Options
and add +Includes
to that line:
Options +Includes
You may not want your document root in
C:\wamp\www
(or wherever the
wamp installer made it).
I myself don't like to have my web files in the
same folder with my programs. 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::
DocumentRoot "C://wamp/www"
and just a few more lines down:
<Directory "C://wamp/www">
/
), not MSW
backslashes (\
)
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.
WampServer2 also installed a very nice web-based MySQL client called
phpMyAdmin
.
You can use this program to do everything with MySQL,
such as create databases, create tables, enter data, etc etc etc.
To use phpMyAdmin
, type in your browser address bar:
http://localhost/phpmyadmin/
There is a config file in the phpMyAdmin directory, where you may need to put the username and password for your database.
Remember WampServer.com/en/presentation.php for a helpful summary and some screen shots.
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.
Some starters:
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/