Recent Changes - Search:

Tc

 VMwarePlayer Version 5.0.2 build 1031769
 Ssh – client PuTTY, release 0.62 http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
 SCP-client: WinSCP  http://winscp.net/
 Wget: c:\app\wget\wget.exe
 My WorkDir  c:\distr\TinyCore
 Installation scripts: C:\distr\TinyCore\setup
 Additional files:
 ·	wget.bat – запуск wget на скачивание дополнений 
 ·	_down_all.txt – список дополнений для скачивания (возможно, что-то лишнее) 
 ·	install_hdd.sh  - установка Core на HDD 
 ·	install_sshd.sh – установка openssh
 ·	install_nginx.sh – установка nginx 
 ·	gen_sertificates.sh – генератор сертификатов
 ·	nginx.conf – конфигурация nginx как прокси
 ·	openssl.cnf – конфигурация openssl 

 Preparation sdb1.vmdk
 ---------- access to the Internet--------- Begin -----------
 Download  all necessary extensions into a special dir: for example C:\distr\TinyCore\wget\src 
 cd C:\distr\TinyCore\wget\src 
 c:\app\wget\wget.exe -B ftp://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/ -i _down_all.txt
 Create new VM:  iso - TinyCore-4.7.7.iso , remove default HDD, add new IDE HDD disk (Store virtual disk as a single file –  filename: sdb1.vmdk)
 boot from cd (iso)
 click on desktop – terminal – type: tce-load -iw openssh.tcz
 wait for openssh.tcz
 type: sudo cp /usr/local/etc/ssh/sshd_config.example /usr/local/etc/ssh/sshd_config
 type: sudo /usr/local/etc/init.d/openssh start
 type: passwd – enter new password for user tc
 type: ifconfig | grep inet
 find ip-address (like 192.168.110.145)
 ----------  access to the Internet  ---------------  End -----------
 Run putty and login on 192.168.110.145 or stay in terminal (bold red – пользовательский ввод)

 tc@box:~$ sudo fdisk /dev/sda
 Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT disklabel
 Building a new DOS disklabel. Changes will remain in memory only,
 until you decide to write them. After that the previous content
 won't be recoverable. 


 The number of cylinders for this disk is set to 1044.
 There is nothing wrong with that, but this is larger than 1024,
 and could in certain setups cause problems with:
 1) software that runs at boot time (e.g., old versions of LILO)
 2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

 Command (m for help): n
 Command action
   e   extended
   p   primary partition (1-4)
 p
 Partition number (1-4): 1
 First cylinder (1-1044, default 1): <Enter> Using default value 1
 Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): <Enter> Using default value 1044

 Command (m for help): w
 The partition table has been altered.
 Calling ioctl() to re-read partition table

 tc@box:~$ sudo mkfs.ext4 /dev/sda1
 mke2fs 1.41.14 (22-Dec-2010)
 Filesystem label=
 OS type: Linux
 Block size=4096 (log=2)
 Fragment size=4096 (log=2)
 Stride=0 blocks, Stripe width=0 blocks
 524288 inodes, 2096474 blocks
 104823 blocks (5.00%) reserved for the super user
 First data block=0
 Maximum filesystem blocks=2147483648
 64 block groups
 32768 blocks per group, 32768 fragments per group
 8192 inodes per group
 Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

 Writing inode tables: done
 Creating journal (32768 blocks): done
 Writing superblocks and filesystem accounting information: done

 This filesystem will be automatically checked every 29 mounts or
 180 days, whichever comes first.  Use tune2fs -c or -i to override.

 tc@box:~$ sudo mkdir /mnt/sdb1
 tc@box:~$ sudo mount /dev/sda1 /mnt/sdb1
 tc@box:~$ sudo mkdir /mnt/sdb1/src
 tc@box:~$ mkdir /home/tc/src
 tc@box:~$ mkdir /home/tc/src/tce
 tc@box:~$ mkdir /home/tc/src/setup
 tc@box:~$ mkdir /home/tc/src/tce/optional

 Run WinSCP, connect to 192.168.110.145 via SCP
 Go to  directory src/tce/optional   in /home/tc
 Copy all downloaded extensions from C:\distr\TinyCore\wget\src  to  /home/tc/src/tce/optional
 Copy iso-images (Core-4.7.7.iso & TinyCore-4.7.7.iso) from C:\distr\TinyCore  to /home/tc/src
 Copy additional file (install_hdd.sh install_sshd.sh install_nginx.sh gen_sertificates.sh nginx.conf openssl.cnf) from C:\distr\TinyCore\setup  to /home/tc/src setup/
 Return to terminal (putty or VM)
 tc@box:~$ sudo cp -R /home/tc/src/* /mnt/sdb1/src/
 Approximately 77 MB in /mnt/sdb1/src
 Shut down VM:
 tc@box:~$ sudo poweroff
 sdb1.vmdk – эталон при помощи которого в дальнейшем производятся установки ВМ.
 Сюда же следует добавить:
 ·	программа (сделанная на vm-dev) – следующий шаг

 ·	
 DEVELOPMENT
 Create new VM (vm-dev): 2 IDE HDD, 1 CD.
 Выбрать: “I will install the operating system later” – Linux (Other Linux 2.6.x kernel) – ввести имя машины и расположение  “path_to_vm”  (например: имя vm-dev, путь C:\distr\TinyCore\vm-prd), “store virtual disk as a single file”,  Next > Finish.
 Edit virtual machine settings -> Hard Disc (SCSI)  - remove (Удалить vmdk файл.  Например, C:\distr\TinyCore\ vm-dev \ vm-dev.vmdk) 
 Copy sdb1.vmdk > “path_to_vm” (напр. C:\distr\TinyCore\ vm-dev \)
 Copy Core-4.7.7.iso > “path_to_vm”
 Edit virtual machine settings -> Add new Hard Disk > Create a new virtual disk > Next > Virtual disk type IDE > Maximum disk size (GB) 1 – Store virtual disk as a single file > Next >  Finish.
 Edit virtual machine settings -> Add new Hard Disk > Use an existing virtual disk > Browse >choose sdb1.vmdk  (созданный на предыдущем шагу)
 Virtual machine settings > CD/DVD (IDE) > Use ISO image file C:\distr\TinyCore\Core-4.7.7.iso
 Play VM.
 $ sudo mount /dev/sdb1 /mnt/sdb1
 $ tce-load –i /mnt/sdb1/src/tce/optional/tc-install.tcz
 $ sudo /usr/local/bin/tc-install.sh
 (r/c/i):i
 (Example /tm/Core-4.7.iso): /mnt/sdb1/src/Core-4.7.7.iso
 (f/h/z): f
 1. Whole Disk or 2. Partition : 1
 Select disk for core(choose sda)  – 2 
 Would you like to install bootloader? – y
 Select Formatting Option for sda (choose ext4) : 3 
 Enter boot options:
 vga=normal syslog showapps waitusb=5
 Last chance … Continue ? y
 Installation has completed (Press Enter key)
 $sudo poweroff

 Use VM settings to unmount iso image.
 Use VM settings to unmount iso image.
 Play VM vm-dev.
 $ sudo mount /dev/sdb1 /mnt/sdb1
 $ /mnt/sdb1/src/setup/install_sshd.sh

 Enter new password for user tc
 Confirm it.

 Using WinSCP upload new release of program (websrv2.tar.bz2) to /home/tc
 Using WinSCP upload new release of program (websrv2.tar.bz2) to /home/tc

 Using putty connect to host via scp.

 $ tce-load -i /mnt/sdb1/src/tce/optional/compiletc.tcz


 Make directory for program:
 $ sudo mkdir /mnt/sdb1/src/project
 $ sudo mv websrv2.tar.bz2 /mnt/sdb1/src/project/
 $ sudo chown -R tc:staff /mnt/sdb1/src/project
 $ tar -jxvf websrv2.tar.bz2
 $ cd websrv2/os
 $ make


 Проверка:

 Start the program:
 $ sudo /mnt/sdb1/src/project/websrv2/os/_bin_lin_htnum/websrv  8080

 Убедились что работает (). Потом :

 $ sudo mv /mnt/sdb1/src/project/websrv2/os/_bin_lin_htnum/websrv  /mnt/sdb1/src/setup/

 $sudo poweroff

 Тиражируем полученный эталон для рабочих систем vm-prd


 PRODUCTION
 Create new VM (vm-prd): 2 IDE HDD, 1 CD.
 Выбрать: “I will install the operating system later” – Linux (Other Linux 2.6.x kernel) – ввести имя машины и расположение  “path_to_vm”  (например: имя vm-prd, путь C:\distr\TinyCore\vm-prd), “store virtual disk as a single file”,  Next > Finish.
 Edit virtual machine settings -> Hard Disc (SCSI)  - remove (Удалить vmdk файл.  Например, C:\distr\TinyCore\ vm-prd \ vm-prd.vmdk) 
 Copy sdb1.vmdk > “path_to_vm” (напр. C:\distr\TinyCore\ vm-prd \)
 Copy Core-4.7.7.iso > “path_to_vm”
 Edit virtual machine settings -> Add new Hard Disk > Create a new virtual disk > Next > Virtual disk type IDE > Maximum disk size (GB) 0.1 – Store virtual disk as a single file > Next >  Finish.
 Edit virtual machine settings -> Add new Hard Disk > Use an existing virtual disk > Browse >choose sdb1.vmdk
 Здесь используем sdb1.vmdk, полученный на прошлом шаге (DEVELOPMENT)
 Virtual machine settings > CD/DVD (IDE) > Use ISO image file C:\distr\TinyCore\Core-4.7.7.iso
 Play VM.
 $ sudo mount /dev/sdb1 /mnt/sdb1
 $ tce-load –i /mnt/sdb1/src/tce/optional/tc-install.tcz
 $ sudo /usr/local/bin/tc-install.sh
 (r/c/i):i
 (Example /tm/Core-4.7.iso): /mnt/sdb1/src/Core-4.7.7.iso
 (f/h/z): f
 1. Whole Disk or 2. Partition : 1
 Select disk for core(choose sda)  – 2 
 Would you like to install bootloader? – y
 Select Formatting Option for sda (choose ext4) : 3 
 Enter boot options:
 vga=normal syslog showapps waitusb=5
 Last chance … Continue ? y
 Installation has completed (Press Enter key)
 $sudo poweroff

 Use VM settings to unmount iso image.

 Play VM.
 $ sudo mount /dev/sdb1 /mnt/sdb1
 # Nginx installation

 $ /mnt/sdb1/src/setup/install_nginx.sh

 # Sertificates
 tc@box:~$ /mnt/sdb1/src/setup/gen_sertificates.sh
 Generating RSA private key, 1024 bit long modulus
 .....++++++
 ..........++++++
 e is 65537 (0x10001)
 Enter pass phrase for servers.key: <Input your password>
 Verifying - Enter pass phrase for servers.key: <Input your password>
 Enter pass phrase for servers.key: <Input your password>
 writing RSA key
 You are about to be asked to enter information that will be incorporated
 into your certificate request.
 What you are about to enter is what is called a Distinguished Name or a DN.
 There are quite a few fields but you can leave some blank
 For some fields there will be a default value,
 If you enter '.', the field will be left blank.
 -----
 Country Name (2 letter code) [AU]:
 State or Province Name (full name) [SA]:
 Locality Name (eg, city) []:Adelaide
 Organization Name (eg, company) [HASQ  Ltd]:
 Organizational Unit Name (eg, section) []:websrv
 Common Name (e.g. server FQDN or YOUR name) []:localhost
 Email Address []:

 Please enter the following 'extra' attributes
 to be sent with your certificate request
 A challenge password []:
 An optional company name []:
 Signature ok
 subject=/C=AU/ST=SA/L=Adelaide/O=HASQ  Ltd/OU=websrv/CN=localhost
 Getting Private key



 На данном этапе полученная версия программы не отдает контент nginx   
 Поведение последнего релиза, что у меня есть.
 Слушает порт  только на наружном интерфейсе, с Localhost выдает message incomplete :


 -> new connection - 192.168.110.1:54006(incoming)
 -> message received - 192.168.110.1:54006
 server got [favicon.ico] from 192.168.110.1:54006
 .
 -> new connection - 127.0.0.1:54171(incoming)
 -> message incomplete - 127.0.0.1:54171
 ........ 

 Из-за этого не может работать через прокси.

 Надо отладить программу и добавить iptables как брандмауэр.
Edit - History - Print - Recent Changes - Search
Page last modified on July 02, 2013, at 06:55 AM