Difference between revisions of "Darkcanuck/RRServer/Develop"

From Robowiki
Jump to navigation Jump to search
m (just see that I forgot to sign last time...)
 
(11 intermediate revisions by 5 users not shown)
Line 3: Line 3:
 
== Where's the code at? ==
 
== Where's the code at? ==
  
'''A:''' The main repository here: http://darkcanuck.net/svn/rumbleserver/trunk/
+
Github: https://github.com/darkcanuck/rumbleserver
  
There's also a clone on Github: https://github.com/PEZ/RRServer
+
If you want to contribute, preferred way is to:
  
== Can I use git? ==
+
# Fork it
 
+
# Clone your fork
Yes, both with the Github repository mentioned above and the main, svn, repository.
+
# Add [User:Darkcanuck|]'s as upstream:
 
 
For the svn repository do:
 
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
$ git svn clone http://darkcanuck.net/svn/rumbleserver -s
+
$ git clone https://github.com/<github_user_name>/rumbleserver.git
 +
$ cd rumbleserver
 +
$ git remote add upstream https://github.com/darkcanuck/rumbleserver.git
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Add a remote as needed:
+
Whenever you start a session of development, always start by pulling from upstream to get the latest change sets.
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
$ git remote add origin <your remote>
+
$ git pull upstream master
 
</syntaxhighlight>
 
</syntaxhighlight>
 
 
The preferred way to work with the Github repo mentioned above is to fork it and then clone your fork to your machine.
 
  
== Which files to ignore? ==
+
I ([[User:PEZ|PEZ]]) think it's best to get into the habit of always creating a branch for changes you think you will want to get pulled into the mother repository. You can only issue one pull request per branch, if I have understood things correctly.
  
I don't know yet...
+
== I get a 404 when clicking on the Rankings links? ==
  
(The Git repository mentioned above has a [https://github.com/PEZ/RRServer/blob/master/.gitignore .gitignore] file that will hopefully soon be complete.)
+
<pre>
 +
The requested URL /~pez/RRServer/Rankings was not found on this server.
 +
</pre>
  
== Empty directories needed? ==
+
If I access the rankings with ''rankings'' (lower case 'r') I get past this culprit. Should I configure httpd to ignore case?
  
When I git cloned the original repository, git created three empty directories:
+
'''Answer:'''
  
* cache
+
The server URLs were setup to be ''identical'' to the old Java server, case and all.  Httpd can safely be configured to ignore case, or we could update the .htaccess file to use case-insensitive rules.
* configs
 
* templates_c
 
  
These directories are needed by the Smarty template system. It's normal for them to be empty in a fresh repository checkout, but if they don't exist Smarty will complain at runtime. The contents of these directories should be ignored when checking in code (since Smarty generates them automatically).
+
(Actually, to me, that sounds like an issue of not having the .htaccess rules used at all. If you're using a non-apache, remember--[[User:Rednaxela|Rednaxela]] 19:20, 13 November 2011 (UTC) that you need to set up these redirects as appropriate for that server. I'm using lighttpd and if you need rules for that, I can post them. --[[User:Rednaxela|Rednaxela]] 16:52, 12 November 2011 (UTC))
  
== I get a 404 when clicking on the Rankings links? ==
+
: Ah, you're right.  The "nice" URL is just "Rankings", whereas the actual file is "rankings.php". --[[User:Darkcanuck|Darkcanuck]] 17:14, 12 November 2011 (UTC)
 +
: Actually I was lying to you. If I change the URL to use just ''ranking'' (lowercase 'r' and no '.php') I get rid of the 404. Seems "nice" URLs are working, but I need to configure for ignoring case somewhere, somehow. -- [[User:PEZ|PEZ]] 19:36, 12 November 2011 (UTC)
 +
:: No, PEZ, I don't think your server is configure with "nice" URL. Since the Rewrite Rules (Apache's mod_rewrite) is configure with uppercase, that should not be problem. The reason you can access the '/rankings' is probably because your Apache (or other web server) has "Options MultiView" (or equivalent), which allow file to be accessed without extension (i.e. /rankings.php => /rankings, /index.html => index etc.) Many hosting I have used has this option on. {{unsigned|Nat}}
  
<pre>
+
:: Easier to test this with other pages where the rewritten ("nice") names don't match the php file names:  RatingsDetails vs ratings_details.php, RatingsFile vs ratings_text.php, for example.  --[[User:Darkcanuck|Darkcanuck]] 17:38, 13 November 2011 (UTC)
The requested URL /~pez/RRServer/Rankings was not found on this server.
 
</pre>
 
  
If I access the rankings with rankings.php (lower case 'r') I get past this culprit. Should I configure httpd to ignore case?
+
:: Seems [[User:Nat|Nat]] is right. RatingsDetails doesn't work. ratings_details does. As does Ratings_details.php. RantingDetails doesn't work, whatever case/camel I try. =) -- [[User:PEZ|PEZ]] 18:54, 13 November 2011 (UTC)
  
'''Answer'''
+
:: So, seem that indeed, like I was saying the .htaccess rules is not being used at all. So the question is... Is this Apache on the server in question, or a different httpd? And to double check, is the .htaccess file in place? --[[User:Rednaxela|Rednaxela]] 19:20, 13 November 2011 (UTC)
The server URLs were setup to be ''identical'' to the old Java server, case and all.  Httpd can safely be configured to ignore case, or we could update the .htaccess file to use case-insensitive rules.
 

Latest revision as of 03:31, 14 November 2011

Thought we could use this page to guide developers who want to help maintain the server code. Since right now I (PEZ) am one of these maybe we can use my questions as a starting point for the FAQ section. Please help with answering these. Here goes:

Where's the code at?

Github: https://github.com/darkcanuck/rumbleserver

If you want to contribute, preferred way is to:

  1. Fork it
  2. Clone your fork
  3. Add [User:Darkcanuck|]'s as upstream:
$ git clone https://github.com/<github_user_name>/rumbleserver.git
$ cd rumbleserver
$ git remote add upstream https://github.com/darkcanuck/rumbleserver.git

Whenever you start a session of development, always start by pulling from upstream to get the latest change sets.

$ git pull upstream master

I (PEZ) think it's best to get into the habit of always creating a branch for changes you think you will want to get pulled into the mother repository. You can only issue one pull request per branch, if I have understood things correctly.

I get a 404 when clicking on the Rankings links?

The requested URL /~pez/RRServer/Rankings was not found on this server.

If I access the rankings with rankings (lower case 'r') I get past this culprit. Should I configure httpd to ignore case?

Answer:

The server URLs were setup to be identical to the old Java server, case and all. Httpd can safely be configured to ignore case, or we could update the .htaccess file to use case-insensitive rules.

(Actually, to me, that sounds like an issue of not having the .htaccess rules used at all. If you're using a non-apache, remember--Rednaxela 19:20, 13 November 2011 (UTC) that you need to set up these redirects as appropriate for that server. I'm using lighttpd and if you need rules for that, I can post them. --Rednaxela 16:52, 12 November 2011 (UTC))

Ah, you're right. The "nice" URL is just "Rankings", whereas the actual file is "rankings.php". --Darkcanuck 17:14, 12 November 2011 (UTC)
Actually I was lying to you. If I change the URL to use just ranking (lowercase 'r' and no '.php') I get rid of the 404. Seems "nice" URLs are working, but I need to configure for ignoring case somewhere, somehow. -- PEZ 19:36, 12 November 2011 (UTC)
No, PEZ, I don't think your server is configure with "nice" URL. Since the Rewrite Rules (Apache's mod_rewrite) is configure with uppercase, that should not be problem. The reason you can access the '/rankings' is probably because your Apache (or other web server) has "Options MultiView" (or equivalent), which allow file to be accessed without extension (i.e. /rankings.php => /rankings, /index.html => index etc.) Many hosting I have used has this option on. —Preceding unsigned comment added by Nat (talkcontribs)
Easier to test this with other pages where the rewritten ("nice") names don't match the php file names: RatingsDetails vs ratings_details.php, RatingsFile vs ratings_text.php, for example. --Darkcanuck 17:38, 13 November 2011 (UTC)
Seems Nat is right. RatingsDetails doesn't work. ratings_details does. As does Ratings_details.php. RantingDetails doesn't work, whatever case/camel I try. =) -- PEZ 18:54, 13 November 2011 (UTC)
So, seem that indeed, like I was saying the .htaccess rules is not being used at all. So the question is... Is this Apache on the server in question, or a different httpd? And to double check, is the .htaccess file in place? --Rednaxela 19:20, 13 November 2011 (UTC)