Starting your own web server
Have you ever wanted to start your own web server but can't figure out where to begin, what do you need; well look no further as we are going to show you how to begin running a fully functional website.
What You Need:
1. Apache
2. MySQL
3. PHP
4. phpmyadmin or cpanel
or better yet just download XAMPP it includes everything you need already configured; it includes Apache web server, MySQL, PHP, PHPMYADMIN, Pearl, Open SSL, Mercury Mail Server, Filezilla and more.
How to Setup XAMPP:
1. Download XAMPP installer
2. Double click on the installer
3. Install to C:\xampp
4. Install all the service and start them
5. Once XAMPP is installed you should see a XAMPP control panel, if it doesn't open right after the install process then click on the shortcut on your desktop.
6. Confirm that Apache and MySQL are running.
7. Start your favorite broswer and type http://localhost
8. Click on the "Security" Link
9. Click on "http://localhost/security/xamppsecurity.php" link and set a password for XAMPP directory and the password for MySQL
10. Go back to "Security" and scroll down the page you will then see some ports the XAMPP uses, you will need to open this ports in your firewall and router to have access to your site via the web.
11. Now create a new directoty in C:\ called www
12. Now create another directory in C:\www called anything you want.
13. Now Navigate to C:\xampp\xampp\apache\conf
14. Open httpd.conf in your favorite text editor
15. Scroll down to the very bottom and delete everything starting at #NameVirtualHost *:80
In other words your going to delete the following:
#NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
16. Now replace what you have just deleted with:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:/xampp/xampp/htdocs
ServerName localhost
</VirtualHost>
17. Now remember when I had you create your C:\www and another directory in C:\www now lets say that you made the directory called main so now main is in C:\www\ this is the directory where your going to have your web files in.
18. Now go back to httpd.conf and add the following after the one we just created above
<VirtualHost *:80>
DocumentRoot C:/www/main
ServerName localhost.main.com
</VirtualHost>
Notice that // or reversed from \\, this is a must for apache to work.
19. Now navigate to C:\WINDOWS\System32\Drivers\etc\
20. Open the file called Host or Hosts
21. you should see where is says 127.0.0.1 localhost now what you want to do is add the following:
127.0.0.1 localhost.main.com this will allow you to access your web files that are in C:\www\main.
22. You can add as many sites as you want just keep adding directories in C:\www and creating a VirtualHost as describe above pointing to the correct directory and giving it a name, then edit you Hosts file to allow you to access the web content in the folder.
23. If your going to go live then you don't need to edit the hosts file, but you will need some type of domain name to use so apache nows where to receive the right web contents.
24. That is the basic to get apache running and for you to begin creating website.
My VirtualHost:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:/www/thegamerslounge
ServerName thegamerslounge.game-host.org
ServerAlias www.thegamerslounge.game-host.org
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/www/gamersworld
ServerName gamersworld.game-host.org
ServerAlias www.gamersworld.game-host.org
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/www/personal
ServerName thewiccanslounge.blogdns.org
ServerAlias www.thewiccanslounge.blogdns.org
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/xampp/xampp/htdocs
ServerName localhost
</VirtualHost>
and my site is live so please make an effort to visit it at the following The Gamers Lounge