---
title: "通过web方式访问linux VNC"
author: "8366"
date: "2011-05-15T10:21:16Z"
tags: []
categories: ["操作系统"]
slug: "web-linux-vnc"
draft: false
lastmod: "2011-05-15T10:21:16Z"
id: 1044524
url: "https://8366.iteye.com/blog/1044524"
---

1.首先吧项目部署在tomcat下

2.开启linux服务器的远程vnc服务

 

\[root@xhu-master 0428]# vncserver

New 'xhu-master:1 (root)' desktop is xhu-master:1

Starting applications specified in /root/.vnc/xstartup  
Log file is /root/.vnc/xhu-master:1.log

 

3.修改vnc登陆密码

 

\[root@xhu-master 0428]# vncpasswd  
Password:  
Verify:

 

4\. 查找vnc启动的端口号

 

\[root@xhu-master 0428]# ps -ef |grep vnc  
root       968     1  0 04:23 pts/1    00:00:00 Xvnc :1 -desktop xhu-master:1 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport **5901** -pn  
root      3850 22188  0 04:25 pts/1    00:00:00 grep vnc

 

5901 则是我们需要的端口号，默认的是5900，我的机器上启动了2次

 

 

5.修改 index.jsp 主要是改ip和vnc端口

 

![](http://dl.iteye.com/upload/picture/pic/90169/45c8e9b3-ba7a-3cd3-9ff8-2f379f2a7d08.jpg)

 

 

 

 

6\. tomcat vpn 技术（也许你的tomcat本身不需要配置，在open ssl-vpn 已经配置过了,需要调查一下）

 

http://www.chinabaike.com/2011/0116/166520.html