Arc Forumnew | comments | leaders | submitlogin
Asked about Arclanguage customize and port 8080
2 points by vuong 4164 days ago | 5 comments
Dear ARC forum!

I am not a coder but want to deploy my own ARC-based forum in my country Vietnam. I successfully install the code on a low-end VPS. It works really well but I still have some issues with customizing the code/theme and so on.

If you have free time, please instruct me how to customize the default color top bar (gray, not yellow like ARC forum or Hacker News).

Also, I tried to install apache on my VPS so that I can forward the port 80 to 8080 which ARC run. However, I managed to do that several times but it didn't work. Following a guide on this forum, I re-configured httpd.conf file inside the apache2 folder but I did not work. I used command line to restart apache2 and the server responded that the was a syntax error on the file.

BTW, I can only run ARC on my VPS by connect via VNC with a simple GUI to "activate" it.

Thanks for your help in advanced.

My site is http://bloggervietnam.com:8080



2 points by rocketnia 4164 days ago | link

Good luck with your project. :) I don't know how far you'll get unless you do some coding, but it's great to see you were able to complete the installation.

---

"If you have free time, please instruct me how to customize the default color top bar (gray, not yellow like ARC forum or Hacker News)."

I'll tell you my step-by-step progress:

In Chrome, I right-click on the top bar and select "Inspect element." This causes the developer tools pane to appear. I fiddle with a bunch of colors, all "#b2b2b2" and "grey," but they're all text colors and border colors, not background colors. Finally, I find the tag that says <td bgcolor="#B4B4B4">, and modifying that color seems to work.

I search the Arc code for "B4", but I find nothing. So I convert B4 from hexadecimal to decimal and get 180. When I search for 180, I find two lines in news.arc that use this color:

  ./lib/news.arc:15:   site-color*   (color 180 180 180)
  ./lib/news.arc:16:   border-color* (color 180 180 180)
Looks like the top of news.arc is a good place to configure the look and feel of the site. Arc Forum uses #ffbb33 = (color 255 187 51), and Hacker News uses #ff6600 = (color 255 102 0), so these might be the changes you're looking for. :)

---

"I re-configured httpd.conf file inside the apache2 folder but I did not work. I used command line to restart apache2 and the server responded that the was a syntax error on the file."

Can you show us what you changed? What's the exact error message?

On this forum, if you put two spaces in front of each line, it will be formatted as code:

  On this forum, if you put two spaces in front of each line, it will
  be formatted as code:
  
    On this forum, if you put two spaces in front of each line, it will
    be formatted as code:
---

"BTW, I can only run ARC on my VPS by connect via VNC with a simple GUI to "activate" it."

Well, I had a VPS briefly, and I couldn't figure out how to access it with anything but PuTTY. It was pretty frustrating. Having a GUI must be nice. :-p I'll have to give VNC a try someday.

Are you looking for an even better alternative of some sort?

(Does someone else here have ideas?)

-----

2 points by vuong 4164 days ago | link

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 4164 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 4161 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 4163 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 :-)

-----