2012年8月5日日曜日

install php5 on OpenSUSE 12

# zypper install php5 php5-mysql php5-mbstring php5-gd php5-fpm
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW packages are going to be installed:
  libsqlite3-0 php5 php5-ctype php5-dom php5-fpm php5-gd php5-iconv php5-json 
  php5-mbstring php5-mysql php5-pdo php5-sqlite php5-tokenizer php5-xmlreader 
  php5-xmlwriter sqlite2 t1lib 

The following recommended packages were automatically selected:
  php5-ctype php5-dom php5-iconv php5-json php5-sqlite php5-tokenizer 
  php5-xmlreader php5-xmlwriter 

The following packages are suggested, but will not be installed:
  php5-gettext php5-pear php5-suhosin 

17 new packages to install.
Overall download size: 3.6 MiB. After the operation, additional 13.6 MiB will 
be used.
Continue? [y/n/?] (y): y
Retrieving package t1lib-5.1.2-15.7.1.x86_64 (1/17), 152.0 KiB (405.0 KiB unpacked)
Retrieving: t1lib-5.1.2-15.7.1.x86_64.rpm [done]
Retrieving package php5-5.3.8-4.24.1.x86_64 (2/17), 1.1 MiB (4.6 MiB unpacked)
Retrieving: php5-5.3.8-4.24.1.x86_64.rpm [done (7.1 MiB/s)]
Retrieving package php5-xmlwriter-5.3.8-4.24.1.x86_64 (3/17), 29.0 KiB (47.0 KiB unpacked)
Retrieving: php5-xmlwriter-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-tokenizer-5.3.8-4.24.1.x86_64 (4/17), 24.0 KiB (19.0 KiB unpacked)
Retrieving: php5-tokenizer-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-pdo-5.3.8-4.24.1.x86_64 (5/17), 54.0 KiB (120.0 KiB unpacked)
Retrieving: php5-pdo-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-mbstring-5.3.8-4.24.1.x86_64 (6/17), 402.0 KiB (2.1 MiB unpacked)
Retrieving: php5-mbstring-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-json-5.3.8-4.24.1.x86_64 (7/17), 31.0 KiB (35.0 KiB unpacked)
Retrieving: php5-json-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-iconv-5.3.8-4.24.1.x86_64 (8/17), 33.0 KiB (39.0 KiB unpacked)
Retrieving: php5-iconv-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-gd-5.3.8-4.24.1.x86_64 (9/17), 100.0 KiB (333.0 KiB unpacked)
Retrieving: php5-gd-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-fpm-5.3.8-4.24.1.x86_64 (10/17), 1.0 MiB (4.2 MiB unpacked)
Retrieving: php5-fpm-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-dom-5.3.8-4.24.1.x86_64 (11/17), 64.0 KiB (173.0 KiB unpacked)
Retrieving: php5-dom-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-ctype-5.3.8-4.24.1.x86_64 (12/17), 23.0 KiB (15.0 KiB unpacked)
Retrieving: php5-ctype-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-mysql-5.3.8-4.24.1.x86_64 (13/17), 69.0 KiB (200.0 KiB unpacked)
Retrieving: php5-mysql-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package php5-xmlreader-5.3.8-4.24.1.x86_64 (14/17), 29.0 KiB (31.0 KiB unpacked)
Retrieving: php5-xmlreader-5.3.8-4.24.1.x86_64.rpm [done]
Retrieving package libsqlite3-0-3.7.8-1.1.2.x86_64 (15/17), 262.0 KiB (798.0 KiB unpacked)
Retrieving: libsqlite3-0-3.7.8-1.1.2.x86_64.rpm [done]
Retrieving package sqlite2-2.8.17-179.1.2.x86_64 (16/17), 148.0 KiB (346.0 KiB unpacked)
Retrieving: sqlite2-2.8.17-179.1.2.x86_64.rpm [done]
Retrieving package php5-sqlite-5.3.8-4.24.1.x86_64 (17/17), 62.0 KiB (160.0 KiB unpacked)
Retrieving: php5-sqlite-5.3.8-4.24.1.x86_64.rpm [done (0 B/s)]
Installing: t1lib-5.1.2-15.7.1 [done]
Installing: php5-5.3.8-4.24.1 [done]
Installing: php5-xmlwriter-5.3.8-4.24.1 [done]
Installing: php5-tokenizer-5.3.8-4.24.1 [done]
Installing: php5-pdo-5.3.8-4.24.1 [done]
Installing: php5-mbstring-5.3.8-4.24.1 [done]
Installing: php5-json-5.3.8-4.24.1 [done]
Installing: php5-iconv-5.3.8-4.24.1 [done]
Installing: php5-gd-5.3.8-4.24.1 [done]
Installing: php5-fpm-5.3.8-4.24.1 [done]
Installing: php5-dom-5.3.8-4.24.1 [done]
Installing: php5-ctype-5.3.8-4.24.1 [done]
Installing: php5-mysql-5.3.8-4.24.1 [done]
Installing: php5-xmlreader-5.3.8-4.24.1 [done]
Installing: libsqlite3-0-3.7.8-1.1.2 [done]
Installing: sqlite2-2.8.17-179.1.2 [done]
Installing: php5-sqlite-5.3.8-4.24.1 [done]
# chkconfig php-fpm on
phpの内容を確認します。
# cd /srv/www/htdocs
# echo '<?php phpinfo(); ?>' >info.php

2012年8月4日土曜日

install nginx on OpenSUSE 12

# zypper install nginx
Loading repository data...
Reading installed packages...
'nginx' not found in package names. Trying capabilities.
Resolving package dependencies...

The following NEW packages are going to be installed:
  GeoIP libGeoIP1 libxslt1 nginx-1.0 

The following recommended package was automatically selected:
  GeoIP 

4 new packages to install.
Overall download size: 1.3 MiB. After the operation, additional 4.0 MiB will be 
used.
Continue? [y/n/?] (y): y
Retrieving package libxslt1-1.1.26-15.8.1.x86_64 (1/4), 149.0 KiB (402.0 KiB unpacked)
Retrieving: libxslt1-1.1.26-15.8.1.x86_64.rpm [done (6.2 KiB/s)]
Retrieving package libGeoIP1-1.4.7-3.1.2.x86_64 (2/4), 75.0 KiB (242.0 KiB unpacked)
Retrieving: libGeoIP1-1.4.7-3.1.2.x86_64.rpm [done]
Retrieving package GeoIP-1.4.7-3.1.2.x86_64 (3/4), 481.0 KiB (1.2 MiB unpacked)
Retrieving: GeoIP-1.4.7-3.1.2.x86_64.rpm [done]
Retrieving package nginx-1.0-1.0.10-3.4.1.x86_64 (4/4), 581.0 KiB (2.1 MiB unpacked)
Retrieving: nginx-1.0-1.0.10-3.4.1.x86_64.rpm [done]
Installing: libxslt1-1.1.26-15.8.1 [done]
Installing: libGeoIP1-1.4.7-3.1.2 [done]
Installing: GeoIP-1.4.7-3.1.2 [done]
Installing: nginx-1.0-1.0.10-3.4.1 [done]

# chkconfig nginx on
# rcnginx start
SuSEfirewall2を設定して、ポート80へのInboundを許可します。
# cd /etc/sysconfig/SuSEfirewall2.d/services
# echo 'TCP="80"' >httpd
# vi /etc/sysconfig/SuSEfirewall2
FW_CONFIGURATIONS_EXT="sshd smtp dovecot httpd"
設定を反映します。
# rcSuSEfirewall2 restart

Install MySQL on OpenSUSE 12

パッケージをインストールします。
# zypper install mysql-community-server mysql-community-client
Loading repository data...
Reading installed packages...
'mysql-community-client' not found in package names. Trying capabilities.
No provider of 'mysql-community-client' found.
Resolving package dependencies...

The following NEW packages are going to be installed:
  mysql-community-server mysql-community-server-client 
  mysql-community-server-errormessages 

3 new packages to install.
Overall download size: 8.0 MiB. After the operation, additional 60.5 MiB will 
be used.
Continue? [y/n/?] (y): y
Retrieving package mysql-community-server-errormessages-5.5.25-3.12.1.x86_64 (1/3), 146.0 KiB (1.0 MiB unpacked)
Retrieving: mysql-community-server-errormessages-5.5.25-3.12.1.x86_64.rpm [done]Retrieving package mysql-community-server-client-5.5.25-3.12.1.x86_64 (2/3), 736.0 KiB (17.1 MiB unpacked)
Retrieving: mysql-community-server-client-5.5.25-3.12.1.x86_64.rpm [done]Retrieving package mysql-community-server-5.5.25-3.12.1.x86_64 (3/3), 7.1 MiB (42.4 MiB unpacked)
Retrieving: mysql-community-server-5.5.25-3.12.1.x86_64.rpm [done]
Installing: mysql-community-server-errormessages-5.5.25-3.12.1 [done]
Installing: mysql-community-server-client-5.5.25-3.12.1 [done]
Installing: mysql-community-server-5.5.25-3.12.1 [done]
自動起動をOnにします。
# systemctl enable mysql.service
mysql.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mysql on
サービスを起動します。
# systemctl start mysql.service
Failed to issue method call: Unit mysql.service failed to load: No such file or directory. See system logs and 'systemctl status mysql.service' for details.
エラーで起動できず。。。 原因がわからないので、一旦アンインストールして、パッケージの入手からやり直すことにします。 アンインストール。
# zypper remove mysql-community-server mysql-community-server-client mysql-community-server-errormessages
パッケージをMySQLのサイトからダウンロードします。SLESを選択して、MySQL ServerとClient Utilitiesをダウンロードします。 http://dev.mysql.com/downloads/mysql/5.5.html rpmパッケージをインストールします。
# rpm -ivh MySQL-server-5.5.27-1.sles11.x86_64.rpmPreparing...                ########################################### [100%]
ls: cannot access /var/lib/mysql/*.err: No such file or directory
ls: cannot access /var/lib/mysql/*.err: No such file or directory
   1:MySQL-server           ########################################### [100%]
insserv: Service network is missed in the runlevels 2 4 to use service mysql

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

mysql                     0:off  1:off  2:on   3:on   4:on   5:on   6:off

# rpm -ivh MySQL-client-5.5.27-1.sles11.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]
セキュリティ設定用のスクリプトを実行します。
# mysql_secure_installation 




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] 
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] 
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] 
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] 
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] 
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!
お終い!

telnetでIMAPアクセス

# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=CRAM-MD5 AUTH=LOGIN AUTH=PLAIN] Dovecot ready.
1 login mascotpark@lool.jp password
1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in
2 list "" *
* LIST (\HasNoChildren) "." "INBOX"
2 OK List completed.
3 select INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $NotJunk)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $NotJunk \*)] Flags permitted.
* 1 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1342696244] UIDs valid
* OK [UIDNEXT 2] Predicted next UID
* OK [HIGHESTMODSEQ 1] Highest
3 OK [READ-WRITE] Select completed.
4 fetch 1 body[]
* 1 FETCH (BODY[] {523}
Return-Path: 
X-Original-To: mascotpark@lool.jp
Delivered-To: mascotpark@lool.jp
Received: by mail.lool.jp (Postfix, from userid 0)
 id 4B8482003D4; Sat,  4 Aug 2012 14:20:25 +0900 (JST)
Date: Sat, 04 Aug 2012 14:20:25 +0900
To: mascotpark@lool.jp
Subject: hello
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <20120804052025.4B8482003D4@mail.lool.jp>
From: root@mail.lool.jp (root)

test

)
4 OK Fetch completed.
5 logout
* BYE Logging out
5 OK Logout completed.
Connection closed by foreign host.
#