After Moodle install - can't get to website to continue install 404

After Moodle install - can't get to website to continue install 404

by Wayne Eaton -
Number of replies: 17

Debian 9,  Apache, MySQL, PhP

First, I'm new to LAMP and I'm finding things very difficult.  My company is looking to try out Moodle.  I've followed the process outlined here: https://docs.moodle.org/19/en/Step-by-step_Install_Guide_for_Debian#Install_Debian and after figuring out that aptitude has been replaced by apt-get, and that I needed to install php-cgi before I could install php7-cig -gd -curl -xmlrpc -cli,  everything seemed to go fine.  At the end of the process it says to go to the URL and I get a 404 error in my browser.  I go directly to the IP of my server and the Apache splash screen pops up so it appears Apache is running fine.

I've read about the config.php file which this install did NOT create.  So I copied the config-dist.php file to a config.php file and modified it as best I could from the information I used during the install.  Still nothing.

Again, I'm super new to LAMP and if there was a step missing in the process I followed, I don' t have any idea on how to troubleshoot this.  I've Googled to no end, but not coming up with anything.

Thanks in advance for any help!

Average of ratings: -
In reply to Wayne Eaton

Re: After Moodle install - can't get to website to continue install 404

by Ken Task -
Picture of Particularly helpful Moodlers

Don't use Debian myself, rather CentOS, but a LInux is a linux.   While there are similarities there's enough of a difference ... this to say cannot give specifics ... but one ...

Please use/see:

https://docs.moodle.org/33/en/Installing_Moodle_on_Debian_based_distributions

Rather than installing a 1.9 ... which is now very very very old and no longer supported for anything.

You should not try to overwrite what's there ... so remove the code directory you installed, remove the moodledata directory you manually created, and drop the database - but do re-create a new one to use with 3.3.

'spirit of sharing], Ken


In reply to Ken Task

Re: After Moodle install - can't get to website to continue install 404

by Wayne Eaton -

Thanks Ken for the reply.  I don't know how I could have done 1.9, but again, I found a document on the website and paid no attention to the filename I was downloading in the process and should have noticed the version.  The breadcrumb trail at the top of the page didn't show that I was in 1.9 so I glossed over it.  Probably also due to the fact I've worked 10 days straight without a break (not just on this). 

I'll give this a go this morning!

In reply to Ken Task

Re: After Moodle install - can't get to website to continue install 404

by Wayne Eaton -

Hi Ken,

Ok, so I cleaned up what I had done, then followed the new process in the link you provided.  Went through without a problem , but in step 6 it talks about changing Apache.  I didn't find the 'default' file, but one named '000 -default.conf'.  Is this appropriate to modify?  When I opened it didn't have a lot of info whereas the process indicated approximate lines 4, 10, 17.  I did modify the 000-default.conf file with changing the DocumentRoot as per the documentation.  I tried adding the <Directory "/var/www/moodle/"> but it didn't like that so I removed it.  Now when I go to http://hostname I'm presented with the index.php file in Moodle.   I presume, I should be presented some nice webpage to continue configuring Moodle?  I looked at the config-dist.php file and at the top it says the file should be renamed to config.php, but that step was not in the documention.   Any thoughts on my next steps?

In reply to Wayne Eaton

Re: After Moodle install - can't get to website to continue install 404

by Ken Task -
Picture of Particularly helpful Moodlers

Am going to defer to Emma as she apparently writes the docs for Debian installs.  Like I said, I use CentOS as my chosen 'poison'.   While there are similarities, there are also differences in Linux distros ... CentOS 7 is Linux Standards Base ... which means Ubuntu 16.04 (also LSB) and CentOS 7 do things the same when it comes to setup and admin of the apache server.   Don't think Debian is LSB so just about anything I would suggest at this point would be an 'educated guess' ... and you don't need that at this point.

Wait for Emma! ;)

'spirit of sharing', Ken



In reply to Wayne Eaton

Re: After Moodle install - can't get to website to continue install 404

by Sammy Law -

May you please try to downgrade to PHP 6?

In reply to Sammy Law

Re: After Moodle install - can't get to website to continue install 404

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's no such thing as PHP 6 wink


In reply to Wayne Eaton

Re: After Moodle install - can't get to website to continue install 404

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Firstly, Ken is right - please tell us you did not install 1.9.  Use these instructions: https://docs.moodle.org/32/en/Installing_Moodle_on_Debian_based_distributions (except I see that I need to update these to include a php 7 version).  But, if your apache splash screen is working, then you have that part done.  If the moodle folder in your /var/www folder?  Check ownership and permissions on the folder and make sure they were applied recursively.

Are you going to "yourserveraddress"/moodle to start the installer?  I suggest you remove the config file you created and let the web installer create if for you.

In reply to Emma Richardson

Re: After Moodle install - can't get to website to continue install 404

by Wayne Eaton -

Hi Emma,

Thanks for the reply and yes, it appears I installed 1.9...grrr... Thanks for the updated link and I will follow that this morning and hopefully will have success!


-Wayne

In reply to Emma Richardson

Re: After Moodle install - can't get to website to continue install 404

by Wayne Eaton -

Hi Ellen,

Ok, so I cleaned up what I had done, then followed the new process in the link you provided.  Went through without a problem , but in step 6 it talks about changing Apache.  I didn't find the 'default' file, but one named '000 -default.conf'.  Is this appropriate to modify?  When I opened it didn't have a lot of info whereas the process indicated approximate lines 4, 10, 17.  I did modify the 000-default.conf file with changing the DocumentRoot as per the documentation.  I tried adding the <Directory "/var/www/moodle/"> but it didn't like that so I removed it.  Now when I go to http://hostname I'm presented with the index.php file in Moodle.   I presume, I should be presented some nice webpage to continue configuring Moodle?  I looked at the config-dist.php file and at the top it says the file should be renamed to config.php, but that step was not in the documention.   Any thoughts on my next steps?

Thanks!

-Wayne

In reply to Wayne Eaton

Re: After Moodle install - can't get to website to continue install 404

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

You do not need to mess with config file.  You need to get apache working.  You had that working before so I am not sure what you did to undo that step.  If you go to 

Anyway, the 000-default.conf is the file that you want to mess with.

You want a line in there that states:  

DocumentRoot /var/www/moodle

The DocumentRoot part should already be there - just change localhost to /var/www/moodle

Are you still on php version 7?  If you go to localhost, do you see the apache splash screen?

In reply to Emma Richardson

Re: After Moodle install - can't get to website to continue install 404

by Wayne Eaton -

Hi Emma,

It looks like you started a thought at the end of the first line of your response but didn't complete it?

With the DocumentRoot line set to /var/www/html, I get the Apache2 Debian Default Page, so all is working fine.

When I change the DocumentRoot line to /var/www/moodle, I get the contents of the index.php file showing.


Yes, I believe I'm still running PHP7.  The path I had to go to in Step 1 for the php.in was: /etc/php/7.0/cgi/php.ini  Now there's also a php.ini file in /etc/php/7.0/cli.  Do I have to modify both or just one?

What else should I look at?  Can I send you any config files?

I really appreciate the help!!

-Wayne

In reply to Wayne Eaton

Re: After Moodle install - can't get to website to continue install 404

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Do you still have the config-dist.php file in there?  Did you restart apache after changing the 000-default file.  php.ini should be fine...you are close...

In reply to Emma Richardson

Re: After Moodle install - can't get to website to continue install 404

by Wayne Eaton -

Yes, the config-dist.php file is there and I did restart apache after changing the 000-default file.

I have just stumbled across something.  I wanted to find out for sure what version of PHP I was running and found the command php -v (go figure) and I think I see a problem.  I got a PHP error - unable to load dynamic library MySQL.so and gd.so.  I looked in the folder /usr/lib/php/20151012 and I don't have a MySQL.go or gd.so.  I did have myslqi.so, so I changed the line in the php.ini file to mysqli.so - is that right?.  However I still don't have a gd.so file in there?  below is the full output of the error and contents of the /usr/lib/php/20151012 folder.



In reply to Wayne Eaton

Re: After Moodle install - can't get to website to continue install 404

by Wayne Eaton -

Ok, I think I know where I went wrong.  The initial apt-get line I ran may not have run 100% successful.  The step was for php5 and I assumed if I replaced the 5 with 7, I would get php version 7.  I don't believe this is correct.  I believe it should have been php7.0?  Can you verify and perhaps give me the full line for PHP7?

At this point, where do I go from here?  Do I undo all that I've done and start from scratch?  What's the best way to do that? 

Thank you!

In reply to Wayne Eaton

Re: After Moodle install - can't get to website to continue install 404

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

You can google the php installation for your distro.  Yes, it is 7.0 and that should work.

In reply to Emma Richardson

Re: After Moodle install - can't get to website to continue install 404

by Wayne Eaton -

Ok, I didn't get much further on the web install portion. I chose the database driver MariaDB (also tried mysqli option) and clicked Next.  Then I entered the database user root and password, entered database port 3306.  I left the Unix socket blank?  Error I'm getting:  Warning: mysqli::__construct(): (HY000/2002): Connection refused in /var/www/moodle/lib/dml/mysqli_native_moodle_database.php on line 79.


line 79 shows: $conn = new mysqli($dbhost, $dbuser, $dbpass,  ' ', $dbport, $dbsocket);


I've been Googling and can't figure it out.