Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Tutorials and Tips

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-28-2015, 02:23 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,449
Kyttias is on a distinguished road
Arrow [guide] Setting up WAMP w/Mysidia

WARNING: LOTS OF IMAGES.
(And they are gifs.)
What is WAMP?
WAMP is short for Windows-Apache-MySQL-PHP and it's everything you need to turn your very own computer into a server that can host websites - like Mysidia! This is great news for developers who want free testing space before they go live with their projects and pay domain fees, etc. (There are Linux and Mac equivalents, as well as some more multi-platform alternatives - LAMP/MAMP/XAMPP - and if you choose to pursue them, you can still try to follow along with this tutorial.)
Cool! How do I get it?
This part's easy. Head on over to WampServer.com (their site is also available in French and Russian, check the top right corner) and scroll down to the Downloads section. Before you choose a download, find out if your Windows is 32bit or 64bit (on Windows 8 / on Windows 7 / see related articles for others). My computer is 64bit, so I will choose this link:
Once it's done downloading, find the file. We're going to open it by right-clicking and hitting 'Run as Administrator'.
It's going to ask you what you want your default browser to be. You can go through the trouble of finding it, or not, the choice is yours. Immediately afterward it's going to ask Windows Firewall for permission. Leave just the first box checked, as this should be default.
Hit next, and then finish. (If you're curious about SMTP, it has to do with sending out e-mails. If you'd like to configure this, read this article and follow it's steps later -- but it isn't a necessary component, so we'll be leaving the default values!)
Now what?
WAMP is now installed and should be running! Find it in the lower right hand corner (it may be hiding). Right-clicking on it brings up one menu, left-clicking brings up another. Pressing 'Put Online' will activate the server (the icon will change colors as it's working - if it's ever stuck on yellow, something is very wrong!). If the icon is hiding, go ahead and drag its butt out and sit it on the taskbar so you can get to it.
Tip: If WAMP has trouble starting (getting past the icon's yellow stage) now or ever, turn off Skype completely and then try turning WAMP on. They share the same default port, and Skype is smart enough to use a different one if its first choice is taken - so you can safely turn Skype back on once WAMP is on.
WAMP installed into C://wamp. Inside, there is a folder called www. This is where your site's files will be stored. It is safe to delete the contents! The folder must stay named www. You can either move the contents of Mysidia here (after unzipping, of course), or in a subfolder. For the purposes of this example, I won't be using a subfolder (there are benefits to using subfolders, such as ease of making multiple sites).
MySQL Database Setup
Just like you would using a real host, you need to create a database to use for you site. You can name it whatever you like - just remember what you name it. From the WAMP icon in the lower right, open up phpMyAdmin. Select the 'Databases' tab and create a new one right here.
You're also going to need to set a password for the root user. The second tab at the top is SQL, and we're going to use it to run a command that will set the password. (Obviously replace yourpassword with an actual password for yourself, lol?) Put in:
Code:
SET PASSWORD FOR root@localhost = PASSWORD('yourpassword');
Now, open up the C:\wamp\apps\phpmyadmin4.1.14 folder and then open up config.inc.php - if you open in Notepad, this is fine. Find this: $cfg['Servers'][$i]['password'] = ''; (you may need to set the search to 'Up' rather than the default 'Down' to locate it, you might not). In the empty single quotes, place in the same password you created above. For good measure, restart the server using the WAMP icon.
Apache and Mod_Rewrite
Your site can be accessed by visiting http://localhost/ or http://127.0.0.1/ (or these and the name of your subfolder following the slash, if you have it in a subfolder) but not quite yet. Right now you're just going to get a 500 Internal Server error. See, Apache has modules - and on most webhosts, there are a handful of basic ones that are already turned on. But you're going to have to do that yourself! Our .htaccess file (included with the Mysidia files) is trying to access the Rewrite module - so we need to find it and enable it. Use the WAMP icon in the lower corner. You may need to scroll down to find it!
Rename Config
A new 'error' has taken the last one's place. Well, no, actually! In your Mysidia files, pop into the inc/ folder and rename config_adopts.php to merely config.php.
PHP.ini: Disabling Notices & Strict Standards
What?! More errors?! Also, no, haha. It's still just confused. Notices and, a similar warning, strict standards - are not errors, merely recommendations. Let's turn these off so we don't have to stare at them. Use the WAMP icon to open up your php.ini file, search for error_reporting = E_ALL and change the value to E_ALL & ~E_NOTICE & ~E_STRICT. You'll want to restart the server after saving these changes. Be patient and wait for the light to turn green again before proceeding.
Installing Mysidia Adoptables
The only remaining error is that it can't find the database. This is because we haven't actually installed the Mysidia framework yet, silly! Now we're going to visit http://localhost/install and set up just as we would on a normal host. I hope you remember the name of your database and the password you set! The default user for MySQL is root. You must set the Domain field as 127.0.0.1 and you must log into your site using this address. Localhost will not work for this field. If you installed into a subfolder, put the folder into the script path. I zoom through the entire install, leaving many things at their default, but please read it and take your time!
What's next?
That's all! This is all you need as a development environment. Always access your site with 127.0.0.1, not localhost - else you'll have issues logging in/staying logged in. So go ahead and bookmark 127.0.0.1. You could always open up C:\Windows\System32\drivers\etc and open the hosts file up in Notepad and add a line (after those already there, change nothing) like:
Code:
127.0.0.1       mysite.dev
^ And then you could type http://mysite.dev into the browser to access your site. But this only effects YOUR computer, and only ever will, not even others on your area network. If you know the LAN IP of your device, you could punch it in to other computers on your local/wifi network and also see your site. Set your IP to static, and you could even edit the hosts files on those computers to access your site with your special host ruled name - instead of rule with 127.0.0.1 it'd be with your static LAN IP. Get it?

If your router supports NAT Loop Back, you can easily do some port forwarding to allow others to access your site with your public IP. A variety of issues could get in the way of you sharing your site with friends outside of your local wifi network. Some can solved with a few simple steps, others may require you to buy a different router that supports NAT Loop Back, or if your ISP insists you use theirs, your only option is to find a different ISP. Sadly, I cannot guarantee sharing with others is possible, due to your router.

If you super want to give it a shot, start by port forwarding port 80, then sharing your public IP with a friend to see if it worked. If something's amiss, try disabling your computer's firewall to see if it's the culprit, or, it could be your ISP. This site will tell you if the outside world can't access a particular port on your computer.

If all goes well, you can use a service like no-ip.com to associate your public IP with a normal-looking url. You can stop giving your friends a hard to remember IP address! Public IP addresses change/refresh every couple of weeks, usually, because they're dynamic. You can call your ISP and ask for one that will never change, but they usually charge a monthly fee. However, the site I just mentioned can automatically look up your current public IP, so long as you have that site's nifty little Dynamic DNS Update Client program running, and always associate it with a url of your choosing - they have both free and paid options.

For good measure, you can also sync your WAMP www folder to a Dropbox account! It won't backup the database, you'll have to do that manually by exporting it, but it could definitely help you keep your files safe. You could even set up WAMP on various computers and use the same php files (however, each computer would be using its own copy of the database).
AGAIN note:
If WAMP has trouble starting (getting past the icon's yellow stage) now or ever, turn off Skype completely and then try turning WAMP on. They share the same default port, and Skype is smart enough to use a different one if its first choice is taken - so you can safely turn Skype back on once WAMP is on.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 01-28-2015 at 02:50 AM.
Reply With Quote
  #2  
Old 02-09-2015, 02:47 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 492,067
Hall of Famer is on a distinguished road
Default

I am sticking this thread since I believe it will be very useful. Many admins would prefer their sites closed for registration or public views at least after several weeks or even months. I think they sure can try installing WAMP first on their local PC, and get familiar with some basic concept before porting it to a live server.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 02-10-2015, 01:58 PM
Kesstryl's Avatar
Kesstryl Kesstryl is offline
Member
 
Join Date: Feb 2012
Posts: 125
Gender: Female
Credits: 21,428
Kesstryl is on a distinguished road
Default

This is a fantastic guide!
Reply With Quote
  #4  
Old 06-16-2015, 02:46 AM
Mindcrank Mindcrank is offline
Member
 
Join Date: Jun 2015
Posts: 6
Gender: Female
Credits: 101
Mindcrank is on a distinguished road
Default

Hey this guide was so helpful, thankyou, but I'm having a little bit of trouble. I'm wanting to test out mysidia and see if it's what I'm looking for for my project.

I run on a mac, so instead of using WAMP I decided to use XXAMP, which I already had installed (I use the netbeans IDE with it).

for the most part it's worked the same way, except that I was able to skip the Apache and Mod_Rewrite step of the guide (hope this isn't what is causing the problem because I honestly have no clue how to access the XXAMP equivalent of that step). I also had trouble with file permissions during installation. Everything is set to read only, so I had to make several files writeable in order to get around it (Like the gif and jpg and png folders, the config file obviously, etc.) I ended up setting the entire mysidia folder and all it's contents to writeable by everyone, to dodge any future errors related to this. (but I'm worried about security issues that my pop up later?)

Anyway, it's installed and when I go to 127.0.0.1/Mysidia/ I see all that I should, except that I am not able to log in (and therefore do anything beyond this point ^^).

When I attempt to log in, I receive this error:



Any advice? I also receive this error upon trying to register a new user, so I can't do that either.
Reply With Quote
  #5  
Old 06-16-2015, 09:29 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,449
Kyttias is on a distinguished road
Default

This has everything to do with mod_rewrite.

To enable this module it just takes a little tweak of your httpd.conf file which will be found in xampp\apache\conf. The conf file already contains the line needed to enable the module, but there is a comment mark (#) just before the code which means Apache will ignore the code. The line you are looking for is:

Code:
#LoadModule rewrite_module modules/mod_rewrite.so
In my httpd.conf file this is line 118, but it may vary so just search for "mod_rewrite" in the file. Now, simply remove the comment (#) from before the line, and save the file. You'll need to restart Apache for the changes to take affect, and you should now find you can use clean URLs with XAMPP.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 06-16-2015 at 09:31 PM.
Reply With Quote
  #6  
Old 06-17-2015, 12:07 AM
Mindcrank Mindcrank is offline
Member
 
Join Date: Jun 2015
Posts: 6
Gender: Female
Credits: 101
Mindcrank is on a distinguished road
Default

Thanks for the fast response!

Unfortunately it doesn't solve my problem.

My xampp applications file tree is different, There's no xampp\apache\conf\httpd.conf.

the closest thing I've found is
XAMPP\xamppfiles\apache2\conf\httpd.conf

and the entirety of that files text is:
Code:
Alias /bitnami/ "/Applications/XAMPP/xamppfiles/apache2/htdocs/"
Alias /bitnami "/Applications/XAMPP/xamppfiles/apache2/htdocs"

<Directory "/Applications/XAMPP/xamppfiles/apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
The file that seems to be identical to the one you're talking about is located at:
XAMPP\xamppfiles\etc\httpd.conf

I made the suggested changes there, an restarted apache as instructed, however there was no change in my error message.

I'm attempting to google this as well but so far I can't quite make heads or tails of the solutions i'm finding; they're all a little to vague for me to follow.

Last edited by Mindcrank; 06-17-2015 at 12:10 AM.
Reply With Quote
  #7  
Old 06-20-2015, 01:28 AM
Mindcrank Mindcrank is offline
Member
 
Join Date: Jun 2015
Posts: 6
Gender: Female
Credits: 101
Mindcrank is on a distinguished road
Default

Hey, I'm still looking for a solution to think. In all my googling around, there's a lot of suggestions for editing an .htaccess file. I couldn't help but notice that the last three times I have downloaded a fresh copy of mysidia, none of them contained an .htaccess file. Is that the problem? could it be something else?

Please help x.x this is an extremely frustrating problem. all I want to do is work on my game, not waste hours messing around with apache and server errors.

Thank you for your attention!
Reply With Quote
  #8  
Old 06-21-2015, 01:21 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,449
Kyttias is on a distinguished road
Default

It should definitely contain such a file. In many FTP uploading programs, you can't actually see this file. But since this is the WAMP thread, you should be working locally and it should definitely be there.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #9  
Old 06-21-2015, 01:57 AM
Mindcrank Mindcrank is offline
Member
 
Join Date: Jun 2015
Posts: 6
Gender: Female
Credits: 101
Mindcrank is on a distinguished road
Default

I am working locally; I just unzipped another fresh download of the mysidia script (Downloading the zip from Media fire of mysidia v1.3.4) to double check that I had not accidentally deleted or removed any files.

This is a screenshot of the entire contents of the freshly unzipped folder:

http://i.gyazo.com/b8fbf112287d332387786069e39d1d08.png
http://i.gyazo.com/23b2c85d9c9ba18d82a3aba2dec85492.png

As far as I can tell, all my permissions are set correctly and all files should be visible to me (I'm the root user of the computer)

Is there perhaps a link where I could download just the .htaccess file?
Reply With Quote
  #10  
Old 06-21-2015, 02:17 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,449
Kyttias is on a distinguished road
Default

After squinting and seeing that you're on a Mac, I can now tell you all you need to do is simply unhide the file. Mac computers like to hide important system files. Because its formatted similarly (not having a real name, just as an extension) the OS assumes it's a system file and tries to keep it safe by hiding it. Here are two different sites explaining the same process for showing hidden files: [x] [x]

I've never owned a Mac, so it's not something I would have thought of. (On Windows, hidden files are a relatively common thing and are much easier to hide/unhide, but basically nothing comes hidden outside of the System file or a software installer automatically does it - files from the internet should never autohide themselves, that's ridiculous!) It's not surprising a Mac owner wouldn't have thought of this, either.

(As a note to not seeing changes after making edits in an earlier post - be aware that you must restart the server before changes can take place. If this means rebooting the entire computer because you can't figure out how, then that's what you'll have to do. I don't know how other setups work.)
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 06-21-2015 at 02:26 AM.
Reply With Quote
Reply

Tags
hosting, wamp


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
To Non-Coders... an itty-bitty guide ChibiMaestro Tutorials and Tips 2 04-20-2018 07:33 PM
Help setting up my site Taogoat Questions and Supports 2 03-08-2014 11:46 AM
Errors with WAMP MikiHeart Questions and Supports 4 11-06-2013 10:12 PM
Need help setting Mysidia up on Uniform Server Hedgen Questions and Supports 0 03-16-2013 06:15 PM
More help for my guide. Killgore Questions and Supports 3 03-03-2009 07:16 PM


All times are GMT -5. The time now is 02:04 PM.

Currently Active Users: 713 (0 members and 713 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636