lost and found ( for me ? )

Showing posts with label Chrome. Show all posts
Showing posts with label Chrome. Show all posts

install chrome browser in Fedora 21 workstation

I have just finished installing Fedora 21 workstation and am trying to install chrome browser.

Here are logs when installing chrome.

# cat /etc/fedora-release
Fedora release 21 (Twenty One)

# uname -ri
3.17.4-301.fc21.x86_64 x86_64

download an RPM and install it.

# rpm -ivh google-chrome-stable_current_x86_64.rpm
warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
error: Failed dependencies:
lsb >= 4.0 is needed by google-chrome-stable-39.0.2171.95-1.x86_64
libXss.so.1()(64bit) is needed by google-chrome-stable-39.0.2171.95-1.x86_64


error.

install lsb via yum.

# yum install redhat-lsb


In what is package libXss.so.1 included?

# yum whatprovides libXss.so.1
Loaded plugins: langpacks
libXScrnSaver-1.2.2-8.fc21.i686 : X.Org X11 libXss runtime library
Repo        : fedora
Matched from:
Provides    : libXss.so.1

libXss.so.1 seems to be included in libXScrnSaver
install libXScrnSaver over yum.

# yum install libXScrnSaver -y

# rpm -ivh google-chrome-stable_current_x86_64.rpm
warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
  1:google-chrome-stable-39.0.2171.95################################# [100%]
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Resource temporarily unavailable)
error: /tmp/google.sig.r2froV: key 1 import failed.
Redirecting to /bin/systemctl start  atd.service

Okay, I was able to install chrome.

Apache : how to use mod_spdy

mod_spdy is SSL module for Apache , which enables you to browse web pages over HTTPS faster than non spdy.
To get the benefit of spdy , your browser needs to support spdy. and of course web sites support spdy.
Google Chrome ( default : enable ) and Firefox ( default : disable ) support spdy as of now.

Please check the below link if you want to know the detailed info.
http://code.google.com/p/mod-spdy/

[ install mod_spdy ]

[root@fc16-note ~]# cat /etc/fedora-release
Fedora release 16 (Verne)
[root@fc16-note ~]# uname -ri
3.3.2-6.fc16.x86_64 x86_64


install the following packages via yum
# yum install httpd at mod_ssl -y


download mod_spdy from https://developers.google.com/speed/spdy/mod_spdy/
# wget https://dl-ssl.google.com/dl/linux/direct/mod-spdy-beta_current_x86_64.rpm


before installing mod_spdy , your apache support SSL.
# apachectl start


In case of Fedora’s Apache , SSL is enabled by default
# lsof -ni:443
COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
httpd   3674   root    4u  IPv4  31309      0t0  TCP 192.168.11.150:https (LISTEN)
httpd   3675 apache    4u  IPv4  31309      0t0  TCP 192.168.11.150:https (LISTEN)
httpd   3677 apache    4u  IPv4  31309      0t0  TCP 192.168.11.150:https (LISTEN)
httpd   3679 apache    4u  IPv4  31309      0t0  TCP 192.168.11.150:https (LISTEN)


access to the Apache’s IP over HTTPS to confirm whether or not Apache supports HTTPS.

install mod_spdy
# rpm -U mod-spdy-beta_current_x86_64.rpm
Redirecting to /bin/systemctl  start atd.service


The following files will be installed.
mod_spdy is an Apache module that allows an Apache server to support the SPDY protocol for serving HTTP resources.
-rwxr-xr-x    1 root    root                    10750 Apr  1 02:10 /etc/cron.daily/mod-spdy
-rw-r--r--    1 root    root                      770 Apr  1 02:10 /etc/httpd/conf.d/load_ssl_with_npn.conf
-rw-r--r--    1 root    root                      961 Apr  1 02:10 /etc/httpd/conf.d/spdy.conf
-rw-r--r--    1 root    root                   225200 Apr  1 02:10 /usr/lib64/httpd/modules/mod_spdy.so
-rw-r--r--    1 root    root                  2047056 Apr  1 02:10 /usr/lib64/httpd/modules/mod_ssl_with_npn.so


After installing mod_spdy rpm , ssl.conf will be overwritten.
# diff ssl.conf ssl.conf.org
12c12
< #LoadModule ssl_module modules/mod_ssl.so # See load_ssl_with_npn.conf
---
> LoadModule ssl_module modules/mod_ssl.so


# egrep -v ^# load_ssl_with_npn.conf | grep -v ^$
LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl_with_npn.so


restart Apache
# apachectl restart


You can check SPDY session.

enter “chrome://net-internals/” filter spdy

or

chrome://net-internals/#events&q=type:SPDY_SESSION


t=1335370857736 [st=   0] +SPDY_SESSION  [dt=?]
                          --> host = "192.168.11.150:443"
                          --> proxy = "DIRECT"
t=1335370857736 [st=   0]    SPDY_SESSION_SYN_STREAM
                            --> flags = 1
                            --> accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                                accept-charset: Shift_JIS,utf-8;q=0.7,*;q=0.3
                                accept-encoding: gzip,deflate,sdch
                                accept-language: ja,en-US;q=0.8,en;q=0.6
                                host: 192.168.11.150
                                method: GET
                                scheme: https
                                url: /
                                user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
                                version: HTTP/1.1
                            --> id = 1
t=1335370857741 [st=   5]    SPDY_SESSION_RECV_SETTINGS
                            --> settings = ["[4:100]"]
t=1335370857743 [st=   7]    SPDY_SESSION_SYN_REPLY
                            --> flags = 0
                            --> accept-ranges: bytes
                                content-length: 4609
                                content-type: text/html; charset=UTF-8
                                status: 403
                                version: HTTP/1.1
                                x-mod-spdy: 0.9.1.5-301
                            --> id = 1
t=1335370857744 [st=   8]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 4096
                            --> stream_id = 1
t=1335370857744 [st=   8]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 513
                            --> stream_id = 1
t=1335370857744 [st=   8]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 0
                            --> stream_id = 1
t=1335370857754 [st=  18]    SPDY_SESSION_SYN_STREAM
                            --> flags = 1
                            --> accept: */*
                                accept-charset: Shift_JIS,utf-8;q=0.7,*;q=0.3
                                accept-encoding: gzip,deflate,sdch
                                accept-language: ja,en-US;q=0.8,en;q=0.6
                                host: 192.168.11.150
                                method: GET
                                referer: https://192.168.11.150/
                                scheme: https
                                url: /icons/apache_pb2.gif
                                user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
                                version: HTTP/1.1
                            --> id = 3
t=1335370857755 [st=  19]    SPDY_SESSION_SYN_STREAM
                            --> flags = 1
                            --> accept: */*
                                accept-charset: Shift_JIS,utf-8;q=0.7,*;q=0.3
                                accept-encoding: gzip,deflate,sdch
                                accept-language: ja,en-US;q=0.8,en;q=0.6
                                host: 192.168.11.150
                                method: GET
                                referer: https://192.168.11.150/
                                scheme: https
                                url: /icons/poweredby.png
                                user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
                                version: HTTP/1.1
                            --> id = 5
t=1335370857757 [st=  21]    SPDY_SESSION_SYN_REPLY
                            --> flags = 0
                            --> accept-ranges: bytes
                                content-length: 1797
                                content-type: image/gif
                                etag: "72511-705-45c91d789fac0"
                                last-modified: Wed, 26 Nov 2008 06:36:03 GMT
                                status: 200
                                version: HTTP/1.1
                                x-mod-spdy: 0.9.1.5-301
                            --> id = 3
t=1335370857757 [st=  21]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 1797
                            --> stream_id = 3
t=1335370857757 [st=  21]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 0
                            --> stream_id = 3
t=1335370857757 [st=  21]    SPDY_SESSION_SYN_REPLY
                            --> flags = 0
                            --> accept-ranges: bytes
                                content-length: 3034
                                content-type: image/png
                                etag: "6bf2-bda-485b74ec6bf80"
                                last-modified: Mon, 03 May 2010 21:30:54 GMT
                                status: 200
                                version: HTTP/1.1
                                x-mod-spdy: 0.9.1.5-301
                            --> id = 5
t=1335370857758 [st=  22]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 3034
                            --> stream_id = 5
t=1335370857758 [st=  22]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 0
                            --> stream_id = 5
t=1335370857795 [st=  59]    SPDY_SESSION_SYN_STREAM
                            --> flags = 1
                            --> accept: */*
                                accept-charset: Shift_JIS,utf-8;q=0.7,*;q=0.3
                                accept-encoding: gzip,deflate,sdch
                                accept-language: ja,en-US;q=0.8,en;q=0.6
                                host: 192.168.11.150
                                method: GET
                                scheme: https
                                url: /favicon.ico
                                user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
                                version: HTTP/1.1
                            --> id = 7
t=1335370857796 [st=  60]    SPDY_SESSION_SYN_REPLY
                            --> flags = 0
                            --> content-length: 290
                                content-type: text/html; charset=iso-8859-1
                                status: 404
                                version: HTTP/1.1
                                x-mod-spdy: 0.9.1.5-301
                            --> id = 7
t=1335370857797 [st=  61]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 290
                            --> stream_id = 7
t=1335370857797 [st=  61]    SPDY_SESSION_RECV_DATA
                            --> flags = 0
                            --> size = 0
                            --> stream_id = 7
t=1335370858736 [st=1000]    SPDY_SESSION_PING
                            --> type = "sent"
                            --> unique_id = 1
t=1335370858737 [st=1001]    SPDY_SESSION_PING
                            --> type = "received"
                            --> unique_id = 1



[ how to enable SPDY on firefox ]

enter “about;config” in URL bar and search “spdy” , enable spdy.




Here’s a comparison of number of packets when enabling/disabling spdy on Firefox 11.0 when accessing to the same page. ( Fedora’s Apache top page. I mean welcome page )

enable spdy : 46 packets
$ tshark -i p2p1 port 443 -w enable_spdy_firefox.pcap
Capturing on p2p1
46


disable spdy : 87 packets
$ tshark -i p2p1 port 443 -w non_spdy_firefox.pcap
Capturing on p2p1
87


[ tips ]

SPYD indicator is an add-on tool to check you are accessing to web sites with SPDY or not.

For Chrome
https://chrome.google.com/webstore/detail/mpbpobfflnpcgagjijhmgnchggcjblin

For firefox
https://addons.mozilla.org/ja/firefox/addon/spdy-indicator/


You browser is using SPDY.



Your browser is not using SPYD.

How to build Chromium OS n’ fly that w/ VMware Player

root@hat1:~# cat /etc/lsb-release | tail -1
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

root@hat1:~# uname -a
Linux hat1 2.6.32-24-server #43-Ubuntu SMP Thu Sep 16 16:05:42 UTC 2010 x86_64 GNU/Linux

root@hat1:~# cat /proc/cpuinfo | grep "model name" | uniq
model name      : AMD Phenom(tm) II X4 925 Processor

[ 必要なツールをインストール ]

install-build-deps.sh ( Utuntu専用 ) を使用すると自動で必要なツールをインストールしてくれる。

hattori@hat1:~$ sudo apt-get install subversion
hattori@hat1:~$ sudo apt-get install git-core

hattori@hat1:~$ wget http://src.chromium.org/svn/trunk/src/build/install-build-deps.sh
hattori@hat1:~$ sudo sh install-build-deps.sh

hattori@hat1:~$ svn co http://src.chromium.org/svn/trunk/tools/depot_tools
hattori@hat1:~$ export PATH=`pwd`/depot_tools:"$PATH"

hattori@hat1:~$ pwd
/home/hattori
hattori@hat1:~$ gclient config http://src.chromium.org/git/chromiumos.git

.glient というファイルができる。

hattori@hat1:~$ cat .gclient
solutions = [
 { "name"        : "chromiumos.git",
   "url"         : "http://src.chromium.org/git/chromiumos.git",
   "custom_deps" : {
   },
   "safesync_url": "",
 },
]

エラーになるなー。

hattori@hat1:~$ gclient sync
Syncing projects:   3% (3/94)

________ running 'git clone -b master http://src.chromium.org/git/crosutils.git /home/hattori/chromiumos.git/src/scripts' in '/home/hattori'
Initialized empty Git repository in /home/hattori/chromiumos.git/src/scripts/.git/
error: RPC failed; result=22, HTTP code = 502

gclient あきらめー。

repo でソースをゲット。

http://www.chromium.org/chromium-os/building-chromium-os/using-cros_workon#TOC-Get-the-Source

repo 、、gclient の置き換わりらしい。

--
We are using repo as our new repository overlay tool. repo is used to checkout multiple repositories and sync them. It replaces the functionality that was previously provided by gclient.
--

hattori@hat1:~$ repo init -u http://git.chromium.org/git/manifest -m minilayout.xml

1時間以上かかる。。

hattori@hat1:~$  repo sync

Initializing project chromiumos ...
remote: Counting objects: 22034, done.
remote: Compressing objects: 100% (10389/10389), done.

* [new tag]         0.8.72.3   -> 0.8.72.3
Fetching projects: 100% (8/8), done.
Checking out files: 100% (1102/1102), done.
Checking out files: 100% (89225/89225), done.iles:  26% (23725/89225)
Syncing work tree: 100% (8/8), done.

hattori@hat1:~$

src ディレクトリができる。

hattori@hat1:~$ cd src/scripts/
hattori@hat1:~/src/scripts$ ./make_chroot --replace

hattori@hat1:~/src/scripts$ ./enter_chroot.sh
INFO   : Mounting chroot environment.
INFO   : Not mounting chrome source
INFO   : Mounting depot_tools
INFO   : mounting ~/.subversion into chroot
(cros-chroot) hattori@hat1 ~/trunk/src/scripts $

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./setup_board --board=x86-generic --default

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./build_packages

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./build_image
Elapsed time: 5m54s
To copy to USB keyfob, OUTSIDE the chroot, do something like:
 ./image_to_usb.sh --from=../build/images/x86-generic/0.8.73.2010_09_24_2053-a1 --to=/dev/sdX
To convert to VMWare image, INSIDE the chroot, do something like:
 ./image_to_vm.sh --from=../build/images/x86-generic/0.8.73.2010_09_24_2053-a1 --board=x86-generic
from the scripts directory where you entered the chroot.

イメージができた

(cros-chroot) hattori@hat1 ~/trunk/src/build/images/x86-generic/0.8.73.2010_09_2
4_2053-a1 $ pwd
/home/hattori/trunk/src/build/images/x86-generic/0.8.73.2010_09_24_2053-a1

(cros-chroot) hattori@hat1 ~/trunk/src/build/images/x86-generic/0.8.73.2010_09_2
4_2053-a1 $ ls
boot.config                chromiumos_image.bin  unpack_partitions.sh
boot.desc                  config.txt
chromiumos_base_image.bin  pack_partitions.sh

vmdk イメージの作成

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./image_to_vm.sh --from=../build/images/x86-generic/0.8.73.2010_09_24_2053-a1 --board=x86-generic --make_vmx --format vmware --vmdk chromium_os_x86-generic.vmdk --vmx chromium_os_x86-generic.vmx

エラーが・

Creating final image
./image_to_vm.sh: line 254: qemu-img: command not found
(cros-chroot) hattori@hat1 ~/trunk/src/scripts $

qemu-img をインストール。

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ sudo emerge app-emulation/qemu-softmmu

再度トライ。

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./image_to_vm.sh --from=../build/images/x86-generic/0.8.73.2010_09_24_2053-a1 --board=x86-generic --make_vmx --format vmware --vmdk chromium_os_x86-generic.vmdk --vmx chromium_os_x86-generic.vmx

Wrote the following config to: /home/hattori/trunk/src/build/images/x86-generic/0.8.73.2010_09_24_2053-a1/chromium_os_x86-generic.vmx
#!/usr/bin/vmware
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "4"
memsize = "1024"
ide0:0.present = "TRUE"
ide0:0.fileName = "chromium_os_x86-generic.vmdk"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Chromium OS"
guestOS = "otherlinux"
ethernet0.addressType = "generated"
floppy0.present = "FALSE"
(cros-chroot) hattori@hat1 ~/trunk/src/scripts $

vmx , vmdk ファイルができた。

4_2053-a1 $ pwd
/home/hattori/trunk/src/build/images/x86-generic/0.8.73.2010_09_24_2053-a1

(cros-chroot) hattori@hat1 ~/trunk/src/build/images/x86-generic/0.8.73.2010_09_2
4_2053-a1 $ ls *.vm*
chromium_os_x86-generic.vmdk  chromium_os_x86-generic.vmx

chroot からぬけて、上記をコピー。

hattori@hat1:~/src/build/images/x86-generic/0.8.73.2010_09_24_2053-a1$ cp *.vm* /home/hattori/

hattori@hat1:~$ pwd
/home/hattori
hattori@hat1:~$ ls *.vm*
chromium_os_x86-generic.vmdk  chromium_os_x86-generic.vmx

vmware player で起動。

起動したー


日本語も入力できた ^_^ 。ちょっとだけさわった印象は、、Chrome ブラウザだ。。


えーと shutdown は、、

Ctrl + Alt + T でコマンドラインモードに。


rootになって、shutdown -h now 。
root になるには、sudo su