12th Mar 2010

How To Install Apache/MySQL/PHP/PHPMyAdmin on Windows (NEW VERSION!!)

  • I would first like to say that I learned this by mostly reading filburt1's (http://www.vbulletin.com/forum/showthread.php?threadid=56446) version

    Anyways, I've included the exact versions and files that I used while setting all of this up on my own:

    Apache 2.0.53
    PHP 4.4.0
    MySQL 4.1.14

    You can download the zip that includes these here (http://www.ugforums.org/ATI4EVER/Web%20Server%20Stuff.zip):

    So without further wait, lets get this set up. :cool:

    If you have any problems, please reply here. You can also reply if it worked just to make my time worthwhile http://images.vbulletin.com/images_vb3/smilies/wink.gif


    Step 1: Apache

    Alright. If you didn't download my zip file you can find the latest versions of Apache here (http://www.apache.org/dist/httpd/binaries/win32/). Make sure you get a 2.0 version and that it has the word "msi" in it as that's what this tutorial was written for.

    Once you have the installer, Keep clicking next until you see a part where you have to fill out some stuff.

    Apache is meant to be used for websites, websites have DNS names such as http://www.google.com. typing www.google.com (http://www.google.com) is going to an IP. Now, Apache wants you to give your DNS name. If you have one you can skip the following "quote", if you do not have one, I advice you to read it.

    Go to www.no-ip.com (http://www.no-ip.com), register for a FREE account, make a hostname and download the client to your computer, set it up, bla bla bla, run it, enter your email and password you used when registering and then your hostnames should appear there.
    I have one called ugserver.sytes.net so for the Network Domain I will enter sytes.net This will obviously depend on your one, so dont just put sytes.net unless you happen to use it as well. Then for Server Name enter your full adress, for me, ugserver.sytes.net. Then for the Administrator Email Address enter your own email.

    FOR CONVENIENCE MAKE SURE TO CHOOSE TO INSTALL IT AS A SERVICE:)

    You can then press Next and choose where you want to install Apache. By default it will go to "C:Program FilesApache Group" although it installs it in a subdirectory called "Apache2" so it will really be
    "C:Program FilesApache GroupApache2"

    It doesn't really matter where you put it, just dont forget.

    Then keep clicking next until it says Installation Complete.


    Step 2: Configuring Apache

    Open up httpd.conf which will be in the folder called conf inside your Apache installation. We will change a couple of settings:

    (by the way we open this file using notepad)

    Once it's opened find (Ctrl F) "Listen" It will go to a line that says
    # Listen: Allows you to bind...... (bla bla bla)
    Soon below that, there should be the word Listen without the # in front followed by a number. If there is no Listen without a #, put one under the line "#Listen 12.34.56.78:80"

    I like to this set to my internal IP (for me it's 192.168.0.100, but for most people it's 192.168.0.1) followed by the port I will be using for the web server.

    So I have this:

    Listen 192.168.0.100:80

    If you do not know your Internal IP read the following quote:

    Go to Start, Run, and type cmd, hit enter then type "ipconfig" in the black box, and hit enter. Look for the line that says IP Address and the number after that, usually starting qwith 192.168 is your internal IP.
    The next thing we want to do is find this line (again in httpd.conf)

    DocumentRoot "

    It will take you directly to the line we want to change (if you included the " in the find as I put above, so no, that wasn't a typo). Change the last part that says htdocs to www.

    Then, dont close httpd.conf, but go to the apache directory (so where most of the folders are) and make a new one called www . Files in this folder, will be the ones shown to everyone on the web.

    O.K back to the configuration file, find this line:


    Change "htdocs" to www again.

    and then, find this:

    DirectoryIndex index.html

    add index.php to the cluster of stuff.

    Then save and exit

    Step 3: Installing PHP

    Download the latest non 5 version of php if you didn't get the one from my zip file. Make sure it's the windows zip package. Once it's downloaded, unzip it to C: and rename the folder to just php.

    Then copy the file php4ts.dll to your windows directory, normally C:WINDOWS but C:winnt on Windows NT.

    Now go back to httpd.conf (I know, I'm starting to get annoyed at it to). At the very end of the file, after everything else, add these two lines:

    LoadModule php4_module c:/php/sapi/php4apache2.dll
    AddType application/x-httpd-php .php .phtml
    If you did as I said and extracted php to C:php, then you dont have to change anything. Yes, I am aware that I have forward slashes as opposed to backslashes but it's supposed to be like that.

    Then save and exit.

    O.K now we can test if everything is working so far. You should see a little icon like this near your taskbar clock:

    http://img.photobucket.com/albums/v622/ATI4EVER/apache_taskbar.jpg

    Click it and make sure that "Apache 2" is "Started", if not, Start it.

    Then open up notepad and type this in it:

    phpinfo()
    ?>
    Save it as phpinfo.php (not phpinfo.php.txt). Save it in your www folder that we had made earlier.

    Then go to your dns name that you should have (and if needed add the port to it, if you are using a port other than 80 you have to do this:

    HTTP://YOURDNSNAME.COM:PORT (normally you will not be able to use www.yourdnsname.com:port (http://www.yourdnsname.com:port)) )

    If all goes well, you should see a little file called phpinfo.php there. Click it. If you see a lot of stuff then everything is set up good. If you see the words

    phpinfo()
    ?>

    then refresh. If you still see them, you didn't install php properly....and normally apache would error out if that happens. So bassically, there is a 98% chance that it will work :)



    Step 4: Installing MySQL

    O.K, again, if you for some reason didn;t download my zip package then here we go: download mysql off of here (http://dev.mysql.com/downloads/mysql/4.1.html) and make sure to get the windows (not the "essentials version" and make sure it's not the non installer).

    Then run the installer and install to C:mysql. Now, when installing (or maybe it's configuring to be honest I forgot), it will ask for a password. Just put your own pass there. If the installer didn't ask for a pass and it says something like "To configure MySQL click here" Then Click there and configure it.

    Then once everything is done go to Start, Run, and type cmd and enter.

    Type the following, pressing Enter after each line:


    c:
    cd mysqlbin
    mysqld-max-nt --install
    net start mysql
    At this point if you see "The MySQL service was started successfully" then everything should be working!

    Step 5: Configuring One Thing In MySQL

    Go to Start ---> All Programs ---> MySQL ---> MySQL Server 4.1 ---> MySQL Command Line Client.

    Enter your password (I had configured MySQL before doing this so maybe you should do that to, as I said, I dont remember to well the order I did this in...) then type this once it grants access:


    SET PASSWORD FOR

    --> 'root'@'localhost' = OLD_PASSWORD('mypass');


    WHERE `mypass` IS THE PASSWORD YOU WANT!!! (I recommend just leaving it as mypass to make my job easier)

    O.K That was important, hopefully you did that right.



    Step 6: PHPMyAdmin

    Hehehe I love phpmyadmin so I decided to add it to the tutorial...

    I did NOT include this in my zip package so you WILL have to download it from here (http://www.phpmyadmin.net/home_page/)

    Just download the zip from the Quick Downloads on the left. Then extract it to
    www and rename it to just 'phpmyadmin' without the version number etc. etc. Then go inside the folder and edit the file
    called config.inc.php (Open it in wordpad, not notepad this time)

    Find (Ctrl F) this line:

    $cfg['Servers'][$i]['password']

    change the value in the middle to "mypass" (or whatever you had put on Step 5)


    Save the file, close it, go to your site in the browser again (where you had looked at phpinfo.php)
    and click on phpmyadmin, if all goes well, it will work fine and not give an error.



    If you are trying to install vBulletin, use "root" as $dbuser, "mypass" as $dbpass, and "localhost" as $dbserver in config.php.
    Unless you specified a different password.

    NOTE: I HAVE NOT EXPLAINED HOW TO BLOCK GUESTS FROM GOING INTO YOUR PHPMYADMIN
    I DO NOT KNOW HOW, THUS, I RECOMMEND HAVING THE PHPMYADMIN FOLDER OUTSIDE
    OF THE "WWW" FOLDER UNLESS YOU WANT TO USE IT. I KEEP MINE IN MY DOCUMENTS AND THEN SOMETIMES
    I COPY IT TO "WWW" IF I NEED IT:)


    Hope this works, enjoy, and if you have problems you can reply to this thread


    I would like to thank the following people:

    Chrodder from #vbfans
    derekivey from #vbfans
    filburt1 from www.vbulletin.com (http://www.vbulletin.com)


  • You're using port 80? If so, adding the port at the end is not required since it's the default port, but addind it should not make any difference.


    What happens if you go to your site in firefox? Can I have the url to your site?

    Some ISPs block port 80, you might want to try another one.


  • I must be missing something somewhere. I have tried it with the with the port, without the port, etc... I did assign the port to 80, so I tried it with and without.

    I am using the full server name. Ex. http://ugserver.sytes.net, http://ugserver.sytes.net:80

    I turned off the security so it wouldn't be blocked, but that didn't work either. I know it's probably something really simple that I am missing.

    Thank you so much for your help in this. I can't wait to get it going.

    Jason

    res://shdoclc.dll/pagerror.gifThe page cannot be displayed

    The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.Please try the following:
  • Click the res://shdoclc.dll/refresh.gif (javascript:location.reload()) Refresh (javascript:location.reload()) button, or try again later.
  • If you typed the page address in the Address bar, make sure that it is spelled correctly.
  • To check your connection settings, click the Tools menu, and then click Internet Options. On the Connections tab, click Settings. The settings should match those provided by your local area network (LAN) administrator or Internet service provider (ISP).
  • See if your Internet connection settings are being detected. You can set Microsoft Windows to examine your network and automatically discover network connection settings (if your network administrator has enabled this setting).
  • Click the Tools menu, and then click Internet Options.
  • On the Connections tab, click LAN Settings.
    Select Automatically detect settings, and then click OK.
  • Some sites require 128-bit connection security. Click the Help menu and then click About Internet Explorer to determine what strength security you have installed.
  • If you are trying to reach a secure site, make sure your Security settings can support it. Click the Tools menu, and then click Internet Options. On the Advanced tab, scroll to the Security section and check settings for SSL 2.0, SSL 3.0, TLS 1.0, PCT 1.0.
    Click the res://shdoclc.dll/back.gif Back (javascript:history.back(1)) button to try another link.

    Cannot find server or DNS Error
    Internet Explorer


  • Yep, that one little step was it. Thank you for your help. I really do appreciate it.


  • Oh, that's already all been done. I followed the directions exactly on that. I just double checked to make sure and it's all still correct.

    Still the same problem though


  • No problem.

    If you have any problems, please reply here. You can also reply if it worked just to make my time worthwhile ;)


  • There's already a config.default.php file. Just rename it to conig.inc.php :). Also, you guys can download a all in one installer of the latest version. Check out: http://www.wampserver.com/en/index.php


  • thanks for the guide :)


  • Ok, I'm getting somewhere now. I just plugged directly into my modem and was able to access apache.

    http://img151.imageshack.us/img151/6985/desktop23nk.th.jpg (http://img151.imageshack.us/my.php?image=desktop23nk.jpg)

    So now I just have to figure out how to get around my firewall on my router and also get my files to pull up.

    I'm going to work on it, but I will gladly take suggestions. :)

    Thanks for all of the help with everything.


  • http://img81.imageshack.us/img81/3160/desktop4ca.th.jpg (http://img81.imageshack.us/my.php?image=desktop4ca.jpg)

    I tried it with and without the port # just in case. I didn't think it would matter though.
    http://hosanna.sytes.net

    The more I'm thinking about this, I'm wondering if the wireless router I installed is blocking access to the site.

    Colin, I have tried it by IP number.


  • HOW TO: Upgrade from MySQL 4.1.14 to MySQL 5.0

    Get it here (http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.15-win32.zip/from/pick#mirrors)

    STEP 1

    Backup your installation and databased incase something goes wrong. Then go to the windows command prompt:

    Start--->Run-->'cmd'

    type in net stop mysql

    You must then remove mysql as a service for the installation to work right. Do this by running the following command in the command prompt.

    C:mysqlbinmysqld --remove


    Where C:mysql is where you installed mysql.

    STEP 2

    Run the installer, select to install "custom" and choose to install in the path that you installed it last time (C:mysql). It tried to install under program files for me for some reason. Make sure to run the configuration wizard or else it won't install the serivce again.

    Note: You should really consider using vBulletin version 3.5.1, 3.0.10 or 2.3.8 that supports mysql 5.


    EDIT: You should add the following line to your config.php if you are running mysql 5:

    $config['Database']['force_sql_mode'] = 'true';

    That is because vBulletin doesn't like MySQL to run in STRICT mode...and somehow it got installed that way...and I don't know how to fix that. So my bad. But adding that line will solve it and vBulletin will work fine.


  • HOW TO: Upgrade from PHP 4.4.0 to 4.4.1

    STEP 1

    Turn off apache:

    Start-->Run-->'cmd'

    Then in the command prompt type in net stop apache2

    STEP 2

    Download this (http://us3.php.net/get/php-4.4.1-Win32.zip/from/a/mirror) file. It is not included in my zip file. Once it has finished downloading, go find your current php folder, rename it to php_4.4.0. Then unzip the new php version you downloaded. It will extract as a folder named php-4.4.1-Win32. Rename it to php.


    STEP 3

    Copy the php4ts.dll from C:PHP to your windows directory, which is usually C:WINDOWS.

    STEP 4

    Start apache again using the following command:

    net start apache2

    All Done. You now are running the most secure version of php up to date. MySQL 5 instructions will be posted soon.


  • Ha!

    Was that the problem?


  • Remember you have to restart apache before the changes take place.


    ;) Thank you


  • A) What browser are you using?
    B) Can you take a screenshot please?

    If it's firefox, is it a message like this?

    http://img395.imageshack.us/img395/1493/helpinstallingapache9ud.th.jpg (http://img395.imageshack.us/my.php?image=helpinstallingapache9ud.jpg)

    If so, make sure you

    A) Have the correct port in your apache config file
    B) Input that port when going to your site (so www.mysite.com:8080 for example)
    C) Have the port opened/forwarded in your firewall.


  • I'm almost positive I have this exactly right, but all I get is a Cannot Find Server page. Apache is running. What could I be missing?


  • No problem. Have fun!


  • Have you tried accessing it using the IP address?


  • The next thing we want to do is find this line (again in httpd.conf)

    DocumentRoot "

    It will take you directly to the line we want to change (if you included the " in the find as I put above, so no, that wasn't a typo). Change the last part that says htdocs to www.

    Then, dont close httpd.conf, but go to the apache directory (so where most of the folders are) and make a new one called www . Files in this folder, will be the ones shown to everyone on the web.

    O.K back to the configuration file, find this line:


    Change "htdocs" to www again.

    and then, find this:

    DirectoryIndex index.html

    add index.php to the cluster of stuff.

    Then save and exit

    The apache screen you are seeing is in the htdocs folder. just follow that and it will make it so what is "live" is in your www folder, not htdocs. If you rename htdocs, this wont work. Just make a new folder.


  • I'm running everything straight from the modem, but am not able to get anything to pull up. I'm not getting an error page, but I'm only getting the apache screen from my previous post. Any ideas?


  • It seems that the newset version of phpmyadmin now requires you to make your own version of the config.inc.php file....

    I have not tested this but I'll give you my config.inc.php from my older version of phpmyadmin.


  • My previous experience with those programs is that it is harder to upgrade from one version to another. I also think that if you set it all up manually you end up being more familiar with each file and program which can help later on.


  • Mind posting your httpd.conf?

    Remember you have to restart apache before the changes take place.

    And maybe take a screenshot of your directory with www folder in it?

    Thanks.


  • No problem. Hope you get it working :)


    You can always try calling your firewall company for help.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about How To Install Apache/MySQL/PHP/PHPMyAdmin on Windows (NEW VERSION!!) , Please add it free.

    Posted by webmaster under toyotataa.com |


    RSS