Installation must be finished from the original IP address, sorry - Moodle - database

I'm trying to install moodle on AWS ec2 and the database is local on ec2 instance and now I'm stuck at error "Installation must be finished from the original IP address, sorry." I have tried all possible solutions on the web but nothing worked for me.

Just comment out these 3 lines and reload:
if ($adminuser->lastip !== getremoteaddr()) {
print_error('installhijacked', 'admin');
}
https://github.com/moodle/moodle/blob/master/admin/index.php#L753-L755

With all due respect, commenting out core Moodle code is not a good idea, especially when there is an easy and safe work around the problem.
When it comes to AWS EC2, commenting out the code may get you past that point in the installation however, the Moodle getremoteaddr() function, which is used everywhere in Moodle, will continue to report an incorrect IP address in things like logs and may even affect the security of your website.
A better approach is to simply add the following line to your Moodle main config.php found in the webroot. It should be placed anywhere between the $CFG = new stdClass(); and require_once(__DIR__ . '/lib/setup.php'); lines:
$CFG->getremoteaddrconf = 0;
This will need to be added anytime up to when you get the error message.
While I have not tried it myself, you may alternatively be able to add the following line to a file called /local/defaults.php (create if it does not already exist):
$defaults['moodle']['getremoteaddrconf'] = 0; // New default for $CFG->getremoteaddrconf.
For more information on defaults.php, see https://docs.moodle.org/dev/Local_plugins#Customised_site_defaults
This defaults.php file can be useful for setting default settings during a new installation if you include it in your Moodle fork.
Hope you find this information helpful.
Best regards,
Michael Milette

Related

OFbiz configuration on production site

I'm new to OFBiz and having trouble making it work on production. I'd appreciate it very much if you could help me to narrow down or even better solve the problem :-)
I was able to able to run OFbiz successfully at localhost and access data that came with the project (ex: https://localhost:8443/webtools/control/entitymaint)
I went through the steps setting up SSL for the project on production site on my Windows Server (I was able to access https://www.mywebsitedomain.com)
I created a folder called ROOT and put the OFBiz folder(same folder on my localhost) in the ROOT folder
I also have set up an SSL Certificate, then added the following to server.xml under Tomcat 9.
(Connector port="8443" maxThreads="150"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\apache-ofbiz-17.12.03\keystore.jks" keystorePass="Password"
clientAuth="false" sslProtocol="TLS")
(/Connector)
When running https://www.mywebsitedomain/webtools/control/entitymaint(same URL except for localhost), I got the message.
"404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable."
Edit: Add some additional information
I found the following information on the OFBiz Production SetUP page:
"Configure the ofbiz-containers.xml file to point to your new keystore and password:
If using Tomcat (Catalina), which is the default, find the "catalina-container" -> "https-connector" -> "keystoreFile" and "keystorePass" properties and set them."
I go to apache-ofbiz-17.12.03\framework\base\config\ofbiz-containers.xml
All the entries I have are below. I don't know where I can add "keystoreFile" and "keystorePass" properties
<ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-containers.xsd">
<!-- load the ofbiz component container (always first) -->
<container name="component-container" loaders="main,rmi,load-data,test" class="org.apache.ofbiz.base.container.ComponentContainer"/>
Thanks in advance.
Jessie
As you found, OFBiz uses an embedded Tomcat (9.0.31). So server.xml is of no help. This wiki page needed update, done. The file you are looking for is framework\catalina\ofbiz-component.xml.
But I'm not sure you are going the right way doing this. Most of the time, it's easier to use Apache HTTPD, even on Windows. You may refer to https://s.apache.org/vmemj. Also for certificates Let's encrypt is what we use for our demos. It's free and, apart the renewal every 3 months, it's great. With their cerbot that's even not a big deal.
By and large, you should better ask questions in the OFBiz user Mailing List.You need to subscribe, please see https://ofbiz.apache.org/mailing-lists.html
HTH
In point 4 you speak about the following, but I see nothing, do I miss something?
You could also ditch OFBiz and migrate to the awesome Scipio ERP (based on the same foundation): www.scipioerp.com
We have a documentation on exactly your question right here: https://www.scipioerp.com/community/developer/installation-configuration/clustering/webserver-configuration/

"Respawning" Files in Cpanel

So straight to the point- Im trying to clean my host entirely (databases too) and after I delete the last 2 files wp-content and wp-includes (700MB of files) they get restored instantly. This may be a simple question but for me it s very odd and I don`t get it. Besides file-manager i used Filezilla too and the same thing happens(my hosting company as it su#%$ failed to give me a reply after 48h).
I have recorded a short video of my problem to help you better understand my issue.
https://www.youtube.com/watch?v=wqL35R0-vvw&feature=youtu.be
Hope you`ll be able to help me. Thank You !
I`m working on this website for an NGO after it was hacked and for now I want to wipe every single file from the server and rebuild it but those files which have inside infected pages(php scripts) wont get deleted
Chances are very good some of those files are owned by the webserver, especially if you were compromised via a WordPress vulnerability. As they're owned by the webserver and not your user, you're unable to delete them.
If you have root/sudo access, you can use that on the command-line to remove them. If you don't, you'll need your host to help.

changing URL in joomla

I have looked through the answers and I am not sure which will work for me , so I am writing the question again, Hoping for a response that might work.
Here : http://norstore-trd-bio0.hpc.ntnu.no/tfcp/
I have a database on server and I am using Joomla to create the website and manage database.
This was a test version, now I want to have the database here it self but use the new URL for website http://tfcheckpoint.org/ bought by godaddy.com.
According to godaddy i tried to first mask the website that is kinda a redirect tfcheckpoint.org to orginal site as explained here:
http://support.godaddy.com/help/article/422/forwarding-or-masking-your-domain-name
BUT, this cause some links to be broken and not accessible anymore, since the external URL is fixed.
Secondly I looked for other solutions and tried to get the mysql dump and replace the old url with new url everywhere and imported the sql file again, but nothing changed. probably because the new site is masked and I have to unmask it. Or should I install Joomla again and start from scratch with the new URL.
But is there a proper way to do this. I don't think moving the database to new hosting server is the solution as many people have their data on local servers while they use these fancy domain names.
Please guide me if there is a standard procedure to do so.
As far as I can tell from your question, you are merely trying to move a Joomla site from one hoster's server to another? You may even be moving between hosters...my answer still stands.
Firstly I have heard of many issues with GoDaddy for Joomla sites. But that is probably an answer for a different question.
In terms of moving your test site and "turning" it into a live site on a new server, this can be done with a 3rd party tool like Akeeba Backup.
For Joomla's settings in the new location, you will need to change the details to accommodate the new hoster's details for database and file locations. This is done through the Site Restoration process(made very easy in Akeeba). There is also a setting for LiveSite that you have have set which would need to be changed manually in /newlocation ofyour files/joomla install/configuration.php.
In terms of DNS settings, your new domain should point to the new hoster's server and a 301 redirect against the old domain pointing to the new one should cover all the bases.
I hope that answers your question. If not, I suggest rewriting the question to be more clear. You will probably get more answers

CakePHP from localhost to remote server - blank page

i am trying to figure this out for a long time now, but so far no luck, maybe somebody can help me.
I have a 2.2.2 cakephp installed on my computer (localhost) and everything works perfectly. But now i want that same project to be online on remote server. I upload everything, set mysql path but i get a blank page when trying to access the site.
If i upload a fresh cakephp it works, but my project doesnt. The debug is set to default, think that should be 2? I also deleted files in cache/tmp, but still no errors or anything, just blank page.
Any info would be helpful, thank you.
I hate when that happens :). Usually it does if there is an error somewhere and you can't see it because the errors are turned off, so you should call phpinfo() and see if display_errors is on. Changing the debug mode doesn't work every time since display_errors is set from php.ini.
Unfortunately, if this is the problem and you don't have access to edit the php.ini file, you might need to ask the hosting provider to change it and restart the php service.
You can also try this: error_reporting(E_ALL)
I uploaded changes to my cakephp website and discovered that all actions for a particular controller returned a blank page. I discovered what the error was and was able to reproduce it with another controller.
The problem was that in the first line of my controller file I had a space before the opening php tag.
One space cost me hours.
Just uploading all files won't cut it. Make sure you work through this checklist:
First and foremost, check the error log file located under app/tmp/logs/error.log, this usually holds some very good pointers as to what is wrong.
Make sure you have uploaded the app/Config/database.php file with the proper details. Local installs usually have user root without password. Online servers (obviously) do not!
To that extent, also make sure you actually have a database with your hosting provider (either your host sent you the info or you need to create it yourself using their control panel).
Make sure you also uploaded all .htaccess files (the one under the root directory and /app and /app/webroot), some FTP programs don't show this "hidden" file by default.
If all else fails, contact your hosting provider for further support as they usually have access to more verbose server logs that can also hold clues.
The real problem was only the coding I used in notepad++. All my files were encoded with UTF-8, but they should have been UTF-8 without BOM. After I changed it to UTF-8 withot BOM, everything started to work perfectly.

Different credentials on different computers git

I have been working on a system to push changes from my git repository to a live site. The issue is that on my local box (where only I have access) I leave db credentials defaults; but I don't want them to be defaults on the web.
What would be the best solution to have a few files that are only located on each development computer, and are never uploaded/committed, etc. I was thinking of throwing in an example file if anyone clones it down, that way they'd know how to create the real credentials file.
I'm pretty new to git, and so I don't think I have the experience to really come up with a good solution for this, so any help would be great.
Thanks,
Max
Your idea of committing an examples file and then not actually tracking the real file is a good one.
Just put the name of the real file in .gitignore so that no one will add it by accident.

Resources