Marketing Forums                      

Welcome to the fastest-growing internet marketing forums!

Go Back   Marketing Forums > Webmaster's Lounge > Site & Server Administration

Site & Server Administration Need help with server administration? Things like mod_rewrite, .htaccess, web hosting, Apache configuration & more.

Reply
Submit Tools Thread Tools Search this Thread Display Modes
Unread 11-08-2008, 09:31 AM   #1
nick08
Senior Member
 
nick08's Avatar
 
Join Date: Nov 2008
iTrader: 0
Referrals: 1
Posts: 103
Reputation: 10
nick08 is on a distinguished road
Post How to set up Apache Server?

Requirements:

Apache Server (www.apache.org) Download: Win32 Binaries(installer)
ActivePerl (www.activestate.com) Download: Win32 Binaries(installer)
PHP (www.php.net) Download: Win32 Binaries(get zip, not installer)


Install Apache Server/Perl/PHP:

1) Run the installer of Apache Server that you have downloaded. The newest version of Apache Server made your life easier, but I am going to still teach you how to configuration it. Install it to "C:\Program Files\Apache Group\Apache2" (default). You can make up on each box like "host name, email, or etc.." while you are install, because you will configuration it anyway when you are finish with the installer. Do not run it when you are finished with the installer! Wait until later.

2) Run the installer of ActivePerl that you have downloaded. Make sure it install at "C:\perl" (default). Do not run it when you are finished with the installer! Wait until later.

3) Unzip (if you get the zipped verion) or install (if you get the installer version) PHP that you have downloaded. Make sure it unzip or install at "C:\php" (default). Do not run it when you are finished with the installer! Wait until later.


Configuration Of The Apache Server:

1) You will need to configure a file called httpd.conf at "C:\Program Files\Apache Group\Apache\conf". You will need to open it with notepad or your favorite editor. I am going to explain you step by step to edit it. Also, I am going to explain to you why to edit them so you can edit them to enable or disable on your own in the future. The next step is going to begin to search, edit and replace few lines.

2) Find "ServerAdmin webmaster@localhost.com" replace it with your email address. You better put your email because when someone got problem with your server and they will see your email, so they can contact you.

3) Find "ServerName" or "#ServerName localhost" replace it to "ServerName localhost". There has very clearly explain in this file when you find "ServerName", so I don''t need to explain about it.

4) Find "DirectoryIndex index.html" and replace it to "DirectoryIndex index.htm index.html index.php index.php3 index.phtml index.shtml index.cgi index.pl". It''s for where file you want it to be in front page on www.domain.com. Common always has index.html as the front page. I added a lot of those, so I don''t need to edit this file again. It''s in the order, which will recognize index.html first then index.pl at the last.

5) Find "Options Indexes FollowSymLinks MultiViews" and replace it to "Options Indexes FollowSymLinks Includes" if you want SSI (Server Side Includes) enable, unless you want keep it disabled. If you do want SSI then change your order of index''s in the previous set to make index.shtml the first.

6) Find "AllowOverride None" right after "Options Indexes FollowSymLinks MultiViews" (above) and replace it to "AllowOverride All" to have the ability control the .htaccess files to override in directories, unless you want keep it uncontrolled.

7) Find "ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"" and add "ScriptAlias /php/ "c:/php/"" right after it. This will enable the PHP in your Apache Server. You don''t have to add it if you don''t wish to add PHP.

Find " # And for PHP 4.x, use:" and add 2 lines, "AddType application/x-httpd-php .php .php3 .phtml" and "AddType application/x- httpd-php-source .phps" right after it. It will make Apache Server able to accept and view files with the extentions php, php3 and phtml. Again, you don''t have to add it if you do not wish to add PHP.

9) Find "#AddHandler cgi-script .cgi" and replace it to "AddHandler cgi-script .cgi .pl". Reason why I added ".pl", is so Apache Server will accept and able to view either files with extentions of either cgi and pl as perl files. If you do not do this your .pl scripts will be an unreconized file extention and your users will be prompted to download the file instead of view it as a page. You can add or make up like ".blah" and it will still view as normal like cgi and pl files.

10) Find "#AddType text/html .shtml" and replace it to "AddType text/html .shtml". It will enable SSI, so you can leave it as disabled if you don''t wish to enable SSI.

11) Find "#AddHandler server-parsed .shtml" and replace it to (add two lines) "AddHandler server-parsed .shtml" and "AddHandler cgi- script .shtml". It will enable the server to render both normal html based includes aswell as cgi scripts, so you can leave it as disabled if you don''t wish to enable SSI.

12) Find "# Format: Action handler-name /cgi-script/location" and add "Action application/x-httpd-php /php/php.exe" right after it. It need to local where the PHP''s directory, so it will able to view the PHP files. You don''t have to add it if you don''t want to have PHP in your Apache Server.

13) Find "Options FollowSymLinks" and change it to "Options FollowSymLinks +ExecCGI". This will allow you to run CGI scripts on your server (as long as you have perl)

You are done with configuration Apache Server!


Configuration Of PHP:

1) Find php.ini-dist file at "C:\php" and rename it to "php.ini".
2) Open php.ini with notepad or your favorite editor.
3) Find a line "extension_dir = ./" then change it to "extension_dir = "c:\php"".
4) Copy the php.ini and paste it at "C:\windows" or "C:\winnt", or wherever you usually put your *.ini files, but the best idea to put it at either "C:\windows" or "C:\winnt".
5) Copy the msvcrt.dll and php4ts.dll from PHP directory to "C:\windows\system" or "C:\winnt\system", or wherever you usually put your *.dll files, but the best idea to put it at either "C:\windows" or "C:\winnt".

You are done with configuration of PHP


First Time Running Your Apache Server:

You will need to reboot your machine when you are done with the above steps. After that, the Apache Server should be run automaticly on Windows 2000 Professional. I doubt Apache Server will run automaticly on Windows 95/98/98SE/ME, so you will have to start it by yourself in the menu at "Start > Apache httpd Server > Control Apache Server > Start". *Warning, you will have to restart your Apache Server each time when you edit Apache Server's system file.*

Anyway, let''s begin to test your Apache Server, Perl, and PHP to see if those are working great. Here are more steps again.

1) To test the Apache Server, open your browser and type "http://localhost", "http://127.0.0.1" or your IP address. If you don''t get any errors, but some names like: "Apache blah blah" with an apache image. Woohoo, everything is fine with Apache Server!

2) To test the Perl, copy the perl script below and save it as both "hello.pl" and "hello.cgi" (so you will have two files the same, but with different extentions).


Running Apache On A Different Port:

A lot of ISP's do not want people to run servers from their home connection so they typically block port 80, in in order to get around this you will need to tell apache to use a different port. The best port to use in place of 80 is 8080, this is a common port for proxies to use also. Then once you change apache so it uses that port you will have to type the domain/ip in like this "xxx.xxx.xxx.xxx:8080", that will tell your browser to connect to teh webserver on that port.
To change the port apache uses:

1.) Find "Listen 80" and change it to "Listen 8080"
2.) Find "ServerName localhost:80" and change it to "ServerName localhost:8080"

Also, if you have a router and want people outside of your network to be able to see your website/server you will need to forward port 8080 to your servers internal IP address.


How To Get CGI-Scripts Windows Compliant:

If you want to run CGI scripts on your windows server you will have to edit the script (the first line anyway). So open it up in a text editor and find
"#!/usr/bin/perl" or something similar (it is almost always the first line of the script) and change it to "#!c:/program files/perl/bin/perl.exe"


You are all set now, enjoy playing with your new windows server!

nick08 is offline   Reply With Quote
Unread 11-08-2008, 08:54 PM   #2
flaco
Member
 
Join Date: Nov 2008
iTrader: 0
Referrals: 1
Posts: 44
Reputation: 10
flaco is on a distinguished road
Default

Wow, that really isn't as hard as it looks. I have setup a similar thing where I was running XAMP as a development platform on my laptop to play around with a Wordpress theme and seeing what it looked like without actually uploading it to the server and messing up a live site. I know that you can run apache as a system process in XP and above, like you said it might not work with the older systems.
flaco is offline   Reply With Quote
Unread 08-27-2013, 06:19 AM   #3
LeroyABVABY
Junior Member
 
Join Date: Aug 2013
iTrader: 0
Referrals: 0
Posts: 2
Reputation: 10
LeroyABVABY is on a distinguished road
Default Win a Free ipad 3 Today!

Hola, I just a little bit ago came across a cool site which has getafreeipad org]get a free ipad contest, so if anybody is wanting to maybe get one of these for nothing why not give it a shot I use my ipad 3 all the time an think they are very nice an use it even more so than my computer lately I'm not sure if it's the ipad 2 or ipad3 but I guess if you win u can just sell it Later!
LeroyABVABY is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free SMTP server for not spammer ernest Email Marketing Forum 1 09-23-2011 09:08 AM
Bulk email server & IP address leasing ernest General Business Discussion 2 07-19-2011 06:07 AM
Emailing server Jaan Email Marketing Forum 0 07-15-2011 11:37 AM
Server Upgrade Completed! dave Marketing Forums News 0 05-27-2009 07:28 AM
Server Upgrade dave Marketing Forums News 0 11-21-2008 12:58 AM


All times are GMT. The time now is 08:10 AM.


Navigation
Marketing Forums Homepage
Forum Home
Marketing Forums News
iTrader
Calendar
Forum Rules
Forum Statistics

FREE Link Directory
Link Directory Home
Link Exchange Programs
Affiliate Networks
Business Opps
CPM Ad Networks
Contextual Ad Networks
Domain Parking
Paid To Click
Paid To Read
Paid For Action
Paid To Promote
Shopping Rewards
Pay Per Click Programs
PPC Search Engines
Pay Per Sale
Work At Home Opps
Advertisements

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Marketing Forums | This is a Metabin Ltd. Website