Apache & IIS are not friends

Apache & IIS are not friends

by Lee LikMeng -
Number of replies: 19

Hi, I managed to test install Moooodle on our alternate server.  This old server actually runs Win 2003 Server with IIS and Sharepoint.  Mostly the installation of moodle was painless but here are some quirks:

1.  After installing EasyPHP1-7, I followed the steps in the Installation guide but was not able to proceed.  After some tinkering, I figured that Apache had to be turned on for the rest to work but I had to stop IIS before I could get Apache to run (web port in use).  Someone gave me incorrect info that Apache and IIS can run simultaneously.

2.  So, after turning on Apache, the rest of the steps could be carried out (painlessly) until I had to configure the config.php.  Now that file is a real mess.  It's hard to read and to find the text which you have to amend (but I used the Find feature to locate the text) and then I found out that there are several of the same config text for various servers.  After a few tries, I got fedup figuring out which was the one for my server so I changed them for all the various servers!

3.  Still didn't work.  There was still some error connecting to the database.  For the dbhost, I had used the DNS rather than "localhost"; I figure, why not? and change it back to "localhost" and viola, it worked! (this should be made clear for newbies)

4.  Then came the part about amending the phpini.exe file.  I used search but found no such file.  Then there is the problem with the GD module (seems quite a number of people have problems with this as per the Forum).  Well, I finally figured out that I can change it from the big e on the tray.  So, I think it's time to update the installation guide.

5.  Now back to Apache and IIS not being friends.  My problem is that the School's (faculty) main server runs on IIS but I want to use moodle as well for teaching and learning.  I have not been able to find documentation on the moodle web (but excuse me, I may not have tried hard enough; or perhaps, it needs to be more prominent if it is available? is this deliberate? but mainly, blame it on me) how do I run PHP on the current webserver without removing any of the services (IIS etc)?  If you are wondering, the old server is a dinosaur so I need to use the new server.  If your advice is to move the whole lot to open source with Apache ... hmm, maybe but I could have a whole lot of angry lecturers on my back.

6.  And where's the Journal on this web? Can seems to find it.

7.  And one more grouse,  I like my name displayed the traditional way Lee LikMeng instead of LikMeng Lee.  Can we just have one entry for names and forget about given name and lastnames?

Bye ....

LikMeng

Average of ratings: -
In reply to Lee LikMeng

Re: Apache & IIS are not friends

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Your basic problem is that you can't sensibly run IIS and Apache on the same server. In a standard setup they will both try and bind to the same port (port 80) and that can't happen. The only solution is to change the port that one of them listens on, but then you end up with a url like...

http://mydomain:8080/moodle

which is counter-intuitive and is likely to be blocked by firewalls.

It is perfectly possible to run Moodle on IIS if that's what you have to do. You will have to forget about EasyPHP! Load and install the windows version of PHP from www.php.net and the windows version of MySql from www.mysql.com, neither are difficult to install. I can't remember if GD is in the windows installation, but if it doesn't work I think you can get the DLLs from

http://www.boutell.com/gd/

If you are still stuck let me know. I have to set up a server like this myself in the next few days, and will add the steps to the documentation. I have done it before though and don't remember any problems.
In reply to Howard Miller

Re: Apache & IIS are not friends

by Lee LikMeng -

Thanks Howard,

Looking forward to your documentation ... I can wait a few days.

In reply to Lee LikMeng

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Surnames and Given Names

by Lee LikMeng -

Thanks Tracey for the tips.  I have tried it various ways but when I selected "Given Name" only, it refused to complied and displayed "Given Name + Surname" instead.

The problem is I have users with Malay Names which do not conform to given name-surname conventions.  In the Malay Name, the first part is their name and the second part is their father's name.  So, Ali Yusof means the guy's name is Ali (given name) and Yusof is his father.  So, I would enter that as Ali in given name and Yusof in surname.

The problem is that for the Chinese, their surname appears in front as in Lee Lik Meng; Lee is the surname and Lik Meng is the given name. So, if I choose "Surname + given name", my name will appear as it should in Chinese.  But my Malay will have their names totally wrong.  Their father's name would then become their names.

It would solve a lot of problems if the Surname box is not made a compulsory entry.  Just let us type the name as we traditionally do.

What's in a name, you might say?

In reply to Lee LikMeng

Re: Apache & IIS are not friends

by Kevin Lawry -

I can offer thoughts on 2 of your points,

Apache and IIS can work together, just not on the same port - I know for sure because I have exactly that set up on one of our school servers, I have moodle on port 81 and the stuff that needs IIS running on port 80 - however moodle will run quite happily under IIS so you may want to take that route  & reduce the number of server apps you have running.

as for your point 3, the problem is probably with the mySQL permissions for the account you created - I think the default is to only allow connections on localhost, and it means it local host or 127.0.0.1 will work but the ip of the local machine will not - it catches me every time I need to log in to the root account

4 php.ini is a text file, which I think is what you are looking for rather than phpini.exe, it lives in %windir% by default or if memory serves you can put a copy in your php folder.

Hope that helps

Kevin

In reply to Lee LikMeng

Re: Apache & IIS are not friends

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi again,

I have included the IIS install in the developer Wiki at

http://moodle.org/mod/resource/view.php?id=354

..its not what you would call straightforward, so if you have any problems let me know and I will try and improve it!
In reply to Howard Miller

Re: Apache & IIS are not friends

by Lee LikMeng -

Thanks, Howard.  I read through your instructions and they appear detailed enough.  If anyone can get it to work with those instructions, that would be me!

I can only do that when I get back to campus next week (on vacation leave, staying at home working on other stuff).

Your instructions stop after Moodle is installed.  I presume I have to proceed to the cron thing?  I am having problems with my test server; email doesn't seem to be working.  I have posted on the forum regarding this.

Incidentally, when I clicked on the above link I could not see any file for installing Moodle with IIS.  After wondering around, I clicked on RecentChanges, and there it was.  I presume there is a time delay from your posting to publication?

Will let you know outcome next week.

In reply to Lee LikMeng

Re: Apache & IIS are not friends

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ahh... I forgot about the cron thing. I'll sort that out and add the instructions.

I only seem to be able to link to the first page of the Wiki, so you need to go to Installation and then one of the list items is for the IIS installation.
In reply to Lee LikMeng

Re: Apache & IIS are not friends

by Cindy Zhao -

Hi Howard and Lee,

I am very new to Moodle and need a lot of help. Do you still have the documentation Howard wrote somewhere?  I tried to follow his link but it didn't work.

Thank you so much in advance!

Cindy

In reply to Howard Miller

IIS & Moodle OK but still no email

by Lee LikMeng -

Dear Howard,

Thank you for your instructions on setting up Moodle in IIS.  The website is working now except that the email does not seemed to work.  I am using Moodle 1.3 beta.

  • When a user creates a new account, the message says that it "Tried to send email but failed".  The account is actually created and if I confirm it from admin, the account is operational.  This same problem occurred in my other test server using Easy PBP and Apache.
  • I had also set up cron but I suppose the email authentication does not depend on cron is more for the forums and postings.
  • Can you give me an idea of how the email in PHP works; how can I trouble should?
  • the website is http://www.hbp.usm.my/eLearning/  There's nothing in it yet but I have shown Moodle to my Dean and he has given his support to propagate it to lecturers at my School.
  • The other problem is that even after enabling gd2, the picture uploaded to the user profile is either an X or black.

Here are some comments which might help you to make the instructions more friendly :

  • When I issued the command to stop the IIS services, an error occurred and could not stop webserver.  I also could not stop the webservice from the Internet Services Manager.  So, I rebooted and when it came but the webservices were stop; I so I started it from the Internet Services manager.  So, you can hint to the user to reboot the whole computer it everything else fails.
  • In setting up the mysql, you have to warn users that there is only one space before the double-dash and nospace after it; sometimes people type in necessary spaces or none (like me) : \mysql\bin\mysqld --install.  You might want to tell the user what message to expect if it works; I made some stupid errors and just sat there waiting but nothing happened.
  • I also had to reboot the computer after setting up mysql
  • In setting config.php, I was slightly confused about the username because the earlier SQL statement include  username@localhost but in the config.php it should only be the username (I typed username@localhost and this returned an error)
  • In the config.php for the wwwroot, it should be http://yourdomainname/moodle with the back slash rather than the forward slash.

Thanks a million.  Hope to hear from you or anyone on how to resolve this.

LikMeng

In reply to Lee LikMeng

Re: IIS & Moodle OK but still no email

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There are a few things here....

* Unlike Unix systems IIS does not have a built in mail server. You need to fill in the SMTP server fields in the Site Settings. You should simply use the server you would normally use for sending mail from any local machine on your site. This *should* work.
* You are of course correct - if the mail isn't working then cron isn't going to help.
* Are you *sure* GD2 is enabled? Have you run phpinfo from the bottom of the admin page and checked that it really is enabled?


Thanks for your comments - I'll try and make things clearer. However...

* The mysql username is never username@localhost, this is just part of the GRANT command. It means user 'username' logging on from 'localhost' should be given these permissions. That is, if 'username' logs in from some other machine he will not be given any access.
* Why did you have to reboot the machine after installing mysql? I didn't.
* wwwroot will *never* have backslashes in it - URLs don't have back-slashes (don't think so anyway).
In reply to Howard Miller

Re: IIS & Moodle OK but still no email

by Lee LikMeng -

Hi, I did some checking in response to Howard's tips :

  • I had actually set the SMTP several times but tried it again with two different accounts to the campus server; neither worked; oh by the way, it's under Variables not Site Settings in the Admin page
  • As for the GD2 setting, yes, it was enabled.  I did some tweaking.  There is a "slashargument" in the Variables page under Admin.  Changing it to "file.phbp?file=/pic.jpg" managed to get the picture to be displayed.
  • As to why the need to reboot after installing mysql, well, I could not start the service, so that's why the reboot.
  • Now the backlash for the URL in wwwroot.  I tried replacing it with forward slash in the config.pbp and the moodle web returned an error but was OK with the backslash.  So, I don't know, it works on our machine.

So, right now, the major hurdle is getting the emailing service working.  Any help will be most welcomed.

In reply to Lee LikMeng

Re: IIS & Moodle OK but still no email

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Note that SMTP (for outgoing mail) is not the same as an IMAP or POP3 mail server (incoming mail accounts).   Many people put their own mail accounts in there but it won't work.

Usually all you need is a hostname and leave username/password blank.  Your local admin should be able to give you a local SMTP server hostname.

In reply to Martin Dougiamas

Re: IIS & Moodle OK and email OK

by Lee LikMeng -

Martin, you are a lifesaver.

Yes, leaving the username and password blank WORKS.  Just tested it and I received INSTANT email notification.  And of course, the link from the email the website also works.  No, I presume the email for the forums should follow without problems.  Oh, I used the IP address instead of the dns but that should work, perhaps.

No, this begs the question : WHY provide for username and password it does require one?  Perhaps only for certain servers?  Perhaps you could put a little teenee note in the Admin page to leave the username and password blank.  I should have thought that .... d?*n.

Thanks a zillion.  Now I can concentrate on the content and the teaching .... will be bugging you guys.

Say how about a place to put all these solutions together for easy reference.  I spent to much time ploughing through the various forums looking for a simple answer.

In reply to Lee LikMeng

Re: IIS & Moodle OK and email OK

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Well it does say this in the text right next to these fields.

"Give the full name of one or more local SMTP servers that Moodle should use to send mail (eg 'mail.a.com' or 'mail.a.com;mail.b.com'). If you leave it blank, Moodle will use the PHP default method of sending mail."

and then

"If you have specified an SMTP server above, and the server requires authentication, then enter the username and password here."
In reply to Lee LikMeng

Re: IIS & Moodle OK but still no email

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Does mail work at all from the machine? Try setting up a test account using Outlook or whatever is handy and establish that you really can send mail to your chosen SMTP server.
In reply to Howard Miller

Re: Apache & IIS are not friends

by Prashant Patel -

Can anyone please give me step by step instruction of how to install moodle in windows 2003 server. I have already installed Moodle using EasyPHP, but thats too easy and plus I don't want to use port 8080, since I am already running IIS6 on windows 2003 server.

Currently I am having problem with MYSQL and PHP. Here is the ERROR message which I get;

"PHP has not been properly configured with MYSQL extension. So that it can communicate with MYSQL. Please check your PHP.ini file or ecompile PHP".

I am very new to this, and that is why I need your guys help.

In reply to Prashant Patel

Re: Apache & IIS are not friends

by Janne Mikkonen -
Apache and IIS not friends? I disagree wink
http://julmajanne.com/stuff/docs/apache/apache_iis.html

Cheers,
Janne

Ps. What is your PHP version and are you using php as a module in IIS or as a cgi?
In reply to Janne Mikkonen

Installing Moodle in Windows 2003 Server

by Prashant Patel -

I am using PHP verion 5. I am using it as a CGI. MySQL version is 4.1. I think it has something to do with MYSQLi extenstion, but I am not too sure. In EasyPHP, you create a database, before you go and install Moodle. But with MYSQL install by itself, I have no idea of how to create a Moodle Database. The only configuration I can do with MYSQL 4.1 is create a password for the "Root" user. 

Help!!sad

Have a Good One!!

ps: I always knew you can install IIS and Apache on the same machine, I never said you can't do that. I just "HIT" the reply to one of the earlier post that had the forum name as " IIS and Apache are not Friends", thats all. thoughtful