การเปลี่ยนแปลง localhost เป็น ip

639 views
Skip to first unread message

num

unread,
Sep 7, 2007, 9:20:00 PM9/7/07
to kv-thai
เรียนถาม คุณวิภัทร หน่อยครับ

ผมติดตั้งบน ubuntu และรันบน localhos ได้ครับแต่จะเปลี่ยนเป็น IP เพื่อ
ใช้บน intranet นะครับ ผมแก้ตามหัวข้อที่ 19
แต่ก็ยังรันบนเลข IP ไม่ได้ครับ

19. ถึงตอนนี้ทุกอย่างพร้อมใช้แล้ว แต่ยังใช้ได้เฉพาะ localhost
ในการใช้งานจริงที่เป็นชื่อ host หรือเลข ip
ให้ทำการแก้ไขแฟ้มข้อมูลที่เคยแก้ไขมา
จาก localhost เป็น yourhost.com แฟ้มที่ต้องแก้ไขคือ
/etc/httpd/conf/httpd.conf
/var/www/html/kv/config/mongrel_cluster.yml

ไม่ทราบว่าผมแก้ถูกไฟล์หรือเปล่า
1. ที่ไฟล์ /var/www/html/kv/config/mongrel_cluster.yml

user: www-data
cwd: /var/www/html/kv
port: "8000"
environment: production
group: www-data
address: 172.xx.xx.xxx
pid_file: log/mongrel.pid
servers: 3

2 ไฟล์ ubuntu ให้แก้ไขแฟ้ม /etc/apache2/sites-available/default

<VirtualHost *:80>
DocumentRoot /var/www/html/kv/public
<Directory "/var/www/html/kv/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI}
[P,QSA,L]

<Proxy *>
Order allow,deny
Allow from all
</Proxy>

<Proxy balancer://mongrel_cluster>
BalancerMember http://localhost:8000
BalancerMember http://localhost:8001
BalancerMember http://localhost:8002
</Proxy>
</VirtualHost>

รบกวนถามครับ แก้ตรงไหนบ้างครับ

ขอบคุณมากครับ
บุญนำ

wip...@psu.ac.th

unread,
Sep 8, 2007, 4:39:01 AM9/8/07
to kv-...@googlegroups.com
ให้แก้ไขแฟ้ม /etc/apache2/sites-available/default
เปลี่ยนข้อมูลคำว่า localhost จากเดิม

<Proxy balancer://mongrel_cluster>
BalancerMember http://localhost:8000
BalancerMember http://localhost:8001
BalancerMember http://localhost:8002
</Proxy>

เป็นเลข ip ที่เป็นของ server นี้ืเช่น 172.x.x.x ประมาณว่า
<Proxy balancer://mongrel_cluster>
BalancerMember http://172.x.x.x:8000
BalancerMember http://172.x.x.x:8001
BalancerMember http://172.x.x.x:8002
</Proxy>

ขอให้ภาระกิจราบรื่นนะครับ

--วิภัทร

> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

num

unread,
Sep 9, 2007, 12:30:07 AM9/9/07
to kv-thai
สวัสดีครับคุณวิภัทร

ในไฟล์


ไม่ทราบว่าผมแก้ถูกไฟล์หรือเปล่า

/var/www/html/kv/config/mongrel_cluster.yml

user: www-data
cwd: /var/www/html/kv
port: "8000"
environment: production
group: www-data
address: 172.xx.xx.xxx
pid_file: log/mongrel.pid
servers: 3

ต้องแก้ด้วยไหมครับ

ขอบคุณครับ
บุญนำ


On 8 ก.ย., 15:39, wipa...@psu.ac.th wrote:
> ให้แก้ไขแฟ้ม /etc/apache2/sites-available/default
> เปลี่ยนข้อมูลคำว่า localhost จากเดิม
> <Proxy balancer://mongrel_cluster>
> BalancerMemberhttp://localhost:8000
> BalancerMemberhttp://localhost:8001

> BalancerMemberhttp://localhost:8002


> </Proxy>
>
> เป็นเลข ip ที่เป็นของ server นี้ืเช่น 172.x.x.x ประมาณว่า
> <Proxy balancer://mongrel_cluster>
> BalancerMemberhttp://172.x.x.x:8000
> BalancerMemberhttp://172.x.x.x:8001

> BalancerMemberhttp://172.x.x.x:8002

> > BalancerMemberhttp://localhost:8002


> > </Proxy>
> > </VirtualHost>
>
> > รบกวนถามครับ แก้ตรงไหนบ้างครับ
>
> > ขอบคุณมากครับ
> > บุญนำ
>
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
>
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is

> believed to be clean.- ซ่อนข้อความที่ยกมา -
>
> - แสดงข้อความที่ยกมา -

wip...@psu.ac.th

unread,
Sep 9, 2007, 1:47:18 AM9/9/07
to kv-...@googlegroups.com
ต้องแก้ไขแฟ้ม /var/www/html/kv/config/mongrel_cluster.yml นี้ด้วย
ถูกต้องแล้วครับ

--วิภัทร

num

unread,
Sep 10, 2007, 2:26:42 AM9/10/07
to kv-thai
สวัสดีครับคุณวิภัทร

ผมลองเปลี่ยนแล้วครับ แต่พอใช้ FireFox เปิดโดยใช้เลข IP มันขึ้นที่หน้า
page ว่า

You are being redirected.


ไม่ทราบว่าผมต้องไปแก้ไข/อัพเดทอะไรเพิ่มหรือเปล่าครับ

* หลังจากเปลี่ยนเบอร์ localhost เป็น IP แล้วจะไม่สามารถใช้ localhost
ได้ใช่ไหมครับ


ขอบคุณครับ
บุญนำ

wip...@psu.ac.th

unread,
Sep 10, 2007, 3:44:32 AM9/10/07
to kv-...@googlegroups.com
ลองเรียกใช้ http://172.x.x.x:8000 , http://172.x.x.x:8001 ,
http://172.x.x.x:8002
ดูว่าได้มั๊ย หากไม่ได้แสดงว่ายังไม่ได้ start mongrel ใหม่ด้วย
ตามข้อ 19 ในเอกสาร http://rd.cc.psu.ac.th/content/view/98/48/ ครับ

num

unread,
Sep 10, 2007, 9:23:44 AM9/10/07
to kv-thai
ยังไม่ได้เลยครับ คุณวิภัทร

ผมลอง ทำที่ข้อ 19 ดูแล้วก็ยังไม่ได้
ถ้าผมใช้ http://localhost --->ได้ปกติครับ
แต่ใช้ http://172.xx.xx.xxx --->มัน error ตามนั้นครับ
ผมลองใส่ http://172.xx.xx.xxx:8000 ก็ไม่ได้ครับ

ขอบคุณครับ
บุญนำ

On 10 ก.ย., 14:44, wipa...@psu.ac.th wrote:
> ลองเรียกใช้http://172.x.x.x:8000,http://172.x.x.x:8001,http://172.x.x.x:8002


> ดูว่าได้มั๊ย หากไม่ได้แสดงว่ายังไม่ได้ start mongrel ใหม่ด้วย

> ตามข้อ 19 ในเอกสารhttp://rd.cc.psu.ac.th/content/view/98/48/ครับ

wip...@psu.ac.th

unread,
Sep 10, 2007, 10:18:04 PM9/10/07
to kv-...@googlegroups.com
ช่วยส่งข้อความที่แสดงบนหน้าจอ console
ที่ส่งมาจากคำสั่ง mongrel_rails cluster::start ด้วย
จะดูว่า mongrel_rails มันทำงานดีแล้วหรือยังครับ

--วิภัทร

Reply all
Reply to author
Forward
0 new messages