G´day everyone,
since a new version of ELGG has been released i figured it is about time to come up with
another tutorial about how to install that script on your 000webhost.com account. A few
words before we dive in deep and install it -> If you seriously plan on running ELGG and
establish a community then you might be better off looking for a different hosting company.
At least with ELGG 1.2 000webhost.com has been a somewhat unreliable host. By unreliable i mean
getting a lot of database errors and general connection problems. And those problems weren´t
in any way, form or shape related to 000webhost restarting their MySQL servers every once in a while,
they were caused by servers that appear to be overloaded or not powerful enough to cope with ELGG.
Downloading ELGG
As usual, first thing you should do is grab the latest copy of ELGG from Elgg.org – Downloads. As of the time writing this tutorial it is version 1.5, released March 9th 2009. So go and get a
copy of it. After downloading and extracting you are stuck with a number of files and folders waiting
to be transfered to the server. The archive comes as .zip so you can either use the in-built zip-functions
in Windows XP and Vista or use a 3rd party tool like WinRAR or 7Zip to extract the archive.
Uploading and installing ELGG
Right, we extracted the archive, now it´s about time to upload ELGG to the server. For that you need a very obvious thing called a FTP client. There are a ton of them so choice is yours. Pretty much every FTP client needs to be configured with your account details, so that´s the first step for you to do. Open the FTP client of your choice and set up a connection to 000webhost.com using your account details (can be found either in 000webhost.com cpanel or in the welcome mail they sent you when you signed up with them). The relevant part you´d be looking for is this
Code:
*** File Upload Details ***
FTP Hostname: ftp.********.net76.net or 64.191.56.133
FTP Username: a1234455
FTP Passsword: yaright
Got the connection working? Good, the next thing you should take into consideration is where to upload it. You can either upload it to your root directory which is public_html or to a subdirectory like /community. Uploading it to your root directory will display ELGG when visitors open your webpage in their browsers (which should be the preferred way of installing it). Again, choice is yours. For this tutorial i will install ELGG into the root directory. Enough about where to upload it, now go and upload the files. When the upload is finished the files should show inside the directory you uploaded them to. One last thing you should do before you start installing ELGG are two changes to file permissions and renaming one file. This will make installation a lot easier for you, especially if you aren´t in the mood to manually edit files on the server. First rename htaccess_dist to .htaccess. When you are done renaming CHMOD this file to CHMOD 666. Second step that needs to be done is temporarily (for installation only) change the permissions of the engine directory. By default it should be 755, and you need to change it to 777 for the installation so ELGG can write the settings file right into that directory. Still with me? Good, now it´s time
for you to point your browser to your domain and actually install ELGG.
Installing ELGG
Ok, files are uploaded now it´s time for some headaches. Open your browser and point it to wherever you uploaded ELGG. You now should be seeing the first screen of the ELGG installation which asks for your MySQL details. Those pesky MySQL details can be found in the 000webhost.com cpanel, that is if you set up a database already. If you didn´t, well, do it now. How that´s done can be looked up in another tutorial i did, just do a brief search for it using the search function on this forum. When you got your MySQL details just fill them in and press Save. If you have entered the correct details you are taken to the next step of the installation that asks for some basic details. Basically you need to enter a title for your site, a short / brief description for it, an email address to which system notifications will be send and
a few more details such as server path. And that is where things get dirty. Take a closer look, focussing on the path at the very bottom and you´ll see what i mean.
Code:
http://somedomain.com/home/a6574239/public_html/
Ya, that is not the actual URL as you might have noticed. For whatever reason ELGG, during install, adds the path to the home directory. As this is wrong we need to clean up a bit and change the URL to the correct value. In this case it would be
Code:
http://somedomain.com/
Don´t forget the trailing slash
Right below that you have to enter the full path to your site root on your disk. This is also automatically filled, and ELGG even manages to put the correct path this time. Yet checking the path doesn´t hurt none, so verify if the path is correct. Last but not least you need to tell ELGG where to store uploaded files. The folder that stores those files has to be outside of the installation path. I suggest creating a directory like "data" on the same level as your "public_html" directory and make it writeable. If you don´t follow this advise and try to enter a path that´s inside your install directory you will receive an error message like this
Your data directory /home/a6574239/public_html/data/ must be outside of your install path.
So go create the folder via FTP client, CHMOD it 666 and let it rip. Then return to the ELGG installation, verify all the path variables again and pay special attention to the trailing slash that needs to be added to every path you entered. The bottom of that screen gives you some more options like disabling the transmission of anonymous usage statistics (which you should do). Once you are sure that all paths are correct…. DO NOT PRESS "SAVE"!!!!. Before we continue there is a minor change to the .htaccess file that needs to be done, else we would see nothing but a 404 error page. Open the .htaccess file on your server and look for this bit of code
Code:
# If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line
# containing the path from your site root to elgg's root. e.g. If your site is
# http://example.com/ and Elgg is in http://example.com/sites/elgg/, you might need
#
#RewriteBase /sites/elgg/
#
# here, only without the # in front.
#
# If you're not running Elgg in a subdirectory on your site, but still getting lots
# of 404 errors beyond the front page, you could instead try:
#
# RewriteBase /
As i installed ELGG to the root directory i need to change the code so it looks like
Code:
# If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line
# containing the path from your site root to elgg's root. e.g. If your site is
# http://example.com/ and Elgg is in http://example.com/sites/elgg/, you might need
#
#RewriteBase /sites/elgg/
#
# here, only without the # in front.
#
# If you're not running Elgg in a subdirectory on your site, but still getting lots
# of 404 errors beyond the front page, you could instead try:
#
RewriteBase /
See the difference in the last line? I had to remove the "#". Then save the file and go back to your ELGG installation where you can now click on "Save". You then will be given the opportunity to create an admin account and once you are done with that you can login and configure away. Now i know that ELGG can be a bitch to install and i have seen experienced people fail doing that, so in case you can´t get ELGG to work you are more than welcome to post your questions and problems here.