Arc Forumnew | comments | leaders | submit | vuong's commentslogin

I just check http://afritech.org/whoami and it returns as vuong at 127.0.0.1

Do the same at arclanguage.org/whoami you will see the difference. I think we need some further dig :-)

-----

1 point by akkartik 4097 days ago | link

Ah, you're right. I never remember /whoami.

-----

1 point by vuong 4096 days ago | link

I use your code on www.geek.vn than switch to hackerstreet.in code. It is mostly similar but /whoami only. Your ARC code tunrs to 127 :-), not real IP.

Hackerstreet code helps me solve that tiny issue and also adds an "ask" tab on the top bar. I wonder how to add another one such as "blog" (so click on with access geek.vn/blog or about/contact etc...:-( Any help @akkartik. I am just an actual non-geek/coder :-)

-----

1 point by akkartik 4096 days ago | link

"Your ARC code tunrs to 127 :-), not real IP."

That's weird. I just doublechecked, and the fix as in anarki seems to be working.

Are you running behind nginx? I think it requires some tweaks to pass through X-Forwarded-For..

-----

1 point by akkartik 4096 days ago | link

"I wonder how to add another tab such as blog"

I think you want the earlier thread jwk was referring to: http://www.arclanguage.org/item?id=17139.

-----

1 point by vuong 4095 days ago | link

I just want to add a link on the top bar, like a "news" tab, then the visitor click on that it will turn to http://blog.geek.vn subdomain. Anyways, the previous threat submitted by jwk is so helpful to me.

-----

1 point by jwk 4096 days ago | link

So what should I do?

-----

1 point by akkartik 4096 days ago | link

I just tried it behind apache, and the fix is still in working condition. Can you check if you made an error in adding it?

Is your codebase someplace public? Feel free to email it to me (address in profile). Or paste in that section of your srv.arc into a comment here to get some more eyes on it.

Did you copy the fix from https://github.com/nex3/arc/commit/1f69b0edb9? Try using the current head: http://github.com/nex3/arc/blob/7f3a5a2979/lib/srv.arc

-----

1 point by vuong 4096 days ago | link

You can backup your database (Arc folder within your VPS), then upload this code https://github.com/rick2047/arc

You can do some optimization and customization on the code such as removing some Hackerstreet related stuffs.

I also run another test site at Amazon EC2 free tier VPS:

http://vietstudying.com

-----

2 points by jwk 4095 days ago | link

Thank you all folks. Will likely do this next weekend and report back!

-----


I use nginx as the reverse proxy for http://www.geek.vn/

It runs smoothly unless the are too many connections (seldom). The reason is that I use a very low-end VPS (RAM 128 MB) :-).

I think you can create a "news" subdomain within your domain control panel (I use Cloudflare instead), then point to the IP of the server. Just my thought only.

I hope it works with you.

-----

2 points by akkartik 4097 days ago | link

That's running on just 128MB? That's awesome.

-----


Thanks for your help rocketia :-P. Here are some of my thoughts and experiences after following your guide.

1/ I often use WinSCP instead of PuTTY on Windows to control VPS. Of course, we can only interact/manage the virtual private server via commands line, but in the case WinSCP helps me to upload the files easily. I tried to use fluxbox (a lightweight GUI for Ubuntu) and VNC to remote connect the server and use the "original" terminal to run racket and ARC forum. As far as I tested, whenever I turn off terminator/SSH window on Windows, the ARC forum will turn off as well. So there is no other choice for me to run source code.

2. Thanks for your investigation, however, the color on the front page does not change from grey to yellow/orange like Hacker News or ARCforum. I found out that the <tag> is "bgcolor", not "border-color", so it will not run even you tweak the code on the top of news.arc file. I believe that we need to change the color of the forum by "dealing" with html.arc file. I got the tag bgcolor (line 86) in that file but not sure how to change.

3. One of the most problem with me right now is how to "forward" the default port on racket server from 8080 to 80 which is default port of Apache. When I tried to configure my httpd file inside apache2 according to this instruction http://nicholasblee.com/blog/hacker-news-clone-on-a-free-aws...

but it does not work. So that is the reason why I have to access the ARC forum by typing the port 8080, otherwise the apache will run the 80 port with a blank page.

Here is what I add to /etc/apache2/httpd.conf <VirtualHost :80>

ServerAdmin myaccount@gmail.com

DocumentRoot /var/www

ServerName bloggervietnam.bloggervietnam.com

<Directory /var/www >

Options FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

</Directory>

#configure cluster

<Proxy balancer://arc_cluster>

BalancerMember http://127.0.0.1:8080

</Proxy>

RewriteEngine On

#Redirect all non-static requests to the cluster (arc)

RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f

RewriteRule ^/(.)$ balancer://arc_cluster%{REQUEST_URI} [P,QSA,L]

ErrorLog logs/blogervietnam.bloggervietnam.com-error_log

CustomLog logs/bloggervietnam.bloggervietnam.com-access_log common

</VirtualHost>

When I tried to restart apache2 with sudo permission, it responded that:

Syntax error on line 27 of /etc/apache2/httpd.conf: BalancerMember Can't find "byrequests" 1b method. Action "configtest" failed.

Could you give me some piece of advices mate? Thanks you very much indeed!

-----

2 points by thaddeus 4151 days ago | link

1. On unix systems you can use 'screen' which will keep your process running after closing the terminal. See http://arclanguage.org/item?id=16009

3a. Personally I would ditch apache and move to ngnix: http://wiki.nginx.org/Main which solved a variety of problems for me. http://arclanguage.org/item?id=11911 & http://blog.martinfjordvald.com/2010/07/nginx-primer/ may help.However given you're already there it's probably less work to stay with apache.

3b. You don't forward racket to port 80, rather you're supposed to forward incoming requests that come to apache/nginx (which comes in via port 80) over to port 8080 or whatever port you choose to run the arc server on. This is called proxy or gateway passing.

Assuming you stick with apache, I'm still not familiar with your proxy passing implementation. It looks more like a hack using a load balancing mechanism for proxy passing and unless you're load balancing I wouldn't use it. When I used apache in the past I would load the mod_proxy module then do a normal 'ProxyPass'. You should configure according to the docs: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

[EDIT: looks like some rudimentary google searching would indicate you have not loaded all the necessary modules for apache -> http://www.genlinux.org/2009/07/balancermember-cant-find-byr... ]

-----

1 point by vuong 4148 days ago | link

Finally it works. I have decided to switch to nginx and with only few tweaks, I can now run on 80 port, the default port of nginx.

Here is the simple code to do that on etc/nginx/nginx.conf server { listen 80; server_name bloggervietnam.com www.bloggervietnam.com;

    location / {
    proxy_pass http://127.0.0.1:8080;

    }
Remember to put this code inside http tag otherwise it will cause error. You can check nginx configuration by typing : nginx -t and then restart nginx. It works!

-----

1 point by vuong 4150 days ago | link

Thanks for your help thaddeus!

1. I just install screen and fortunately it works well. I just hit F6 button to detach my terminal session. That is why I removed fluxbox GUI for saving RAM and resource.

2. I follow the help above and now I can chance the color of the forum.

3. I have not solved the matter yet since apache did not work despite that I already installed necessary modules as you mentioned.

I may switch to nginx for a try. Thanks for your care again :-)

-----