Ubuntu fileZilla が固まった時
端末から
> killall filezilla
で、強制終了にて対応できた。
haruki のすべての投稿
Ubunt16にWordPressとレスポンシブルWebデザインテーマbizvektorを組み込んでみる
Ubunt16にWordPressと
レスポンシブルWebデザインテーマbizvektorを組み込んでみます
1,Apacheの組み込み
sudo apt -y install apache2
apache2 -v
Server version: Apache/2.4.18 (Ubuntu) Server built: 2016-07-14T12:32:26
apacheを起動する
sudo service apache2 start
Webで確認する
firefox localhost
cat <<EOF > /var/www/html/test.html <html> <hr> hello <hr> </html> EOF
bash: /var/www/html/test.html: 許可がありません
ローカルでなので、
sudo chmod 777 /var/www/html/
cat <<EOF > /var/www/html/test.html <html> <hr> hello <hr> </html> EOF curl 'http://localhost/test.html'
アクセスできた
<html> <hr> hello <hr> </html>
ブラウザでも確認
firefox localhost/test.html
2,PHPを組み込む
sudo apt -y install php
php -v
PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies
cat <<EOF > /var/www/html/phpinfo.php <?php phpinfo(); ?> EOF curl 'http://localhost/phpinfo.php'
firefoxで、アクセスしてみる
firefox localhost/phpinfo.php apacheの再起動を忘れた sudo service apache2 stop sudo service apache2 start
うまくいかない
firefox localhost/phpinfo.php パッケージを追加 sudo apt -y install libapache2-mod-php
firefox localhost/phpinfo.php
うまくいった。
3,mysqlをインストール
sudo apt -y install mysql-server php-mysql
Mysqlのrootのパスワードを聞かれるので、
入力しタブでスペースで、続行する(確認の2回あります)
mysql -u root -p
データベース(wordpress)を作成
wordpressというユーザを作成し、パスワードをwordpress2016とする
rootで入るので、先ほどのパスワードを入力する
mysql -u root -p Enter password: (先ほどのパスワード) create database wordpress; grant all privileges on wordpress.* to wordpress@localhost identified by 'wordpress2016'; flush privileges; exit;
4,WordPressをインストール
WordPressをダウンロードし
ファイルを解凍する
cd /tmp wget http://ja.wordpress.org/wordpress-3.8.1-ja.tar.gz tar zxvf wordpress-3.8.1-ja.tar.gz cp -r wordpress /var/www/html
sudo chown -R www-data:www-data /var/www/html/wordpress
firefox http://localhost/wordpress/
お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。
ライブラリィ−を追加してみる
sudo apt-get update sudo apt-get install php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc sudo service apache2 stop sudo service apache2 start firefox http://localhost/wordpress/
やはりだめ
お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。
WordPressのバージョンを上げてみる
cd /tmp sudo rm -rf /var/www/html/wordpress sudo rm -rf /tmp/wordpress wget http://ja.wordpress.org/latest-ja.tar.gz tar -xzvf latest-ja.tar.gz cp -r wordpress /var/www/html sudo chown -R www-data:www-data /var/www/html/wordpress firefox http://localhost/wordpress/
うまくいった。。。。
データベース名:wordpress
ユーザ名:wordpress
パスワード:wordpress2016
データベースのホスト名:localhost
テーブル接頭辞:wp_
「インストール続行」
サイトのタイトル:タイトル
ユーザー名:admin
パスワード:admin_password
パスワード:admin_password
メールアドレス:xxx@yyy.zz
「WordPressをインストール」
5,レスポンシブルWebデザインテーマbizvektorを組み込む
手順は
・テーマの読み込み
・推奨プラグインの読み込み(有効化)
・サンプルデータの読み込み
となります。
5.1 テーマの読み込み
BizVektor
https://bizvektor.com/
のダウンロードページ
https://bizvektor.com/bizvektor.com/about/download/
から、
Download BizVektor ver 1.8.23
を、ダウンロード
外観>テーマ>新規追加
「データのアップロード」
により
先ほど、ダウンロードしたファイルを「参照」で
指定し、
「今すぐインストール」
を、押下
外観>テーマ
選択し、
ダウンロードしたテーマ「BizVektor」
を、有効にしてください。
5.2 推奨プラグインの読み込み(有効化)
に従い、
「プラグイン」→「新規追加」画面より、『お気に入り』画面を表示。
「wordpress.orgユーザー名」のフォームに「bizvektor」と入力して、必要なプラグインをインストール。
インストールした、プラグインを有効化します
プラグインを追加する
5.3 サンプルデータの読み込み
BizVektor クイックスタート
のページの
「サンプルデータ」
を、ダウンロードする
ダウンロードしたデータを
bv_contents_corporate_v20140928.zip
解凍し、
bv_contents_corporate_v20140928.xml
のファイルを読み出す
コンテンツデータのダウンロード・インポート
に従い、コンテンツデータを、インポートする
「ツール」→「インポート」→「WordPress」でダウンロードしたxmlファイルを選択し、「ファイルをアップロードしてインポート」
これで、レスポンシブル対応のWordPressが立ち上がります。
■隘路(ポイント)
「お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。」
への対策
1,WordPressを最新にする
2,不足しているライブラィーを追加する
sudo apt-get install php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc
3,Apacheを再起動する
sudo service apache2 stop sudo service apache2 start
Redmine3.3とGitを連携する
Redmineのプラグイン
redmine_github_hook.git
を使って、GitとRedmineを連携してみました。
Redmineの配置場所を、
/var/lib/redmine
としますので、
それ以外の場合は、
/var/lib/redmine
の部分を書き換えて下さい
1,プラグインを組み込む
cd /var/lib/redmine/plugins git clone https://github.com/koppen/redmine_github_hook.git
2,Git側で、レポジトリーを作成
GitHubまたは、Gitbucketで、対象のレポジトリを作成
3,サーバ側設定
cd /var/lib/redmine/repo
GitHubの場合
git clone --bare https://github.com/<アカウント名>/<レポジトリ名>.git
Gitbucketの場合
git clone --bare https://<アカウント名>@bitbucket.org/<アカウント名>/<レポジトリ名>.git
キーを登録しSSHで接続する場合は
git clone --bare git@github.com:<アカウント名>/<レポジトリ名>.git
で、可能です。
4,Remindeの再起動し、プラグインを組み込む
cd /var/lib/redmine//tmp touch restart.txt
RedmineのWebでどこかの、画面をアクセスする(または、再表示)
(再起動しても、restart.txtは、消えない)
5,Redmineで、設定
プロジェクトの画面
設定>リポジトリ>新しいリポジトリ
バージョン管理システム:Git
識別子:わかりやすい文字を指定
リポジトリのパス:/var/lib/redmine/repo/<レポジトリ名>.git
パスのエンコーディング:UTF-8
識別子を設定により、
一つのプロジェクトで、識別子名による、切り替えができる
これにより、
Redmineから、
更新履歴、差分、コメントなどを、見ることがき、
更新内容と、Redmine内のチケットと連携(関係付ける)ことができます
6,Gitの最新の手動反映
Gitサーバ側のWebhookにより、
Gitサーバ側の更新時に、Redmineサーバの
更新内容を自動連携する方法がありますが、
以下により、手動反映ができました
cd /var/lib/redmine/repo rm -rf <レポジトリ名>.git git clone --bare https://github.com/<アカウント名>/<レポジトリ名>.git git clone --bare https://<アカウント名>@bitbucket.org/<アカウント名>/<レポジトリ名>.git
7,プラウザからGitの最新の反映
毎回端末で、接続して、反映するのが大変なため、
自動更新を行う
更新方法としては
Cronで行う方法もあるが、
ほどんど更新していないのに、
Gitサーバに問い合わせに行くのは、申し訳ない。
本来,Gitサーバ側で
Service Hooks:WebHook
で、設定を行えばいいのだが、
Redmine側から取りに行く方法で行ってみた。
phpから、Shellを起動してみる
7,1 phpのインストール
phpがあるか確認
php --version -bash: php: コマンドが見つかりません
ないので、phpのインストール
参考:
http://qiita.com/ozawan/items/caf6e7ddec7c6b31f01e
yum install --enablerepo=remi,remi-php56 php php-devel php-mbstring php-pdo php-gd /etc/rc.d/init.d/httpd stop /etc/rc.d/init.d/httpd start
7.2 phpで、shellを起動
参考:
http://php.net/manual/ja/function.shell-exec.php
cat <<EOF > /var/lib/redmine/public/ls.php <?php $output = shell_exec('ls -lart'); echo "<pre>$output</pre>"; ?> EOF
xx.xx.xx/ls.php
で、表示を確認
7.3 phpで、gitを起動するプログラムを作成
repoの所有者を変更
chown -R apache:apache /var/lib/redmine/repo
cat <<EOF > /var/lib/redmine/public/git_change.php <?php shell_exec('rm -rf /var/lib/redmine/repo/<レポジトリ名>.git'); $output = shell_exec('git clone --bare https://github.com/<アカウント名>/<レポジトリ名>.git'); shell_exec('mv /var/lib/redmine/public/<レポジトリ名>.git /var/lib/redmine/repo/<レポジトリ名>.git'); echo "<pre>$output</pre>"; ?> EOF
同期したいときに
ブラウザから
xx.xx.xx/git_change.php
で、最新情報を読み取る
8 ファイル、フォルダの日本語対応
Redmineサーバ側のGitのバージョンを上げる
CentOS 8.7
の場合、Gitのバージョンは 1.7.1
最新にバージョンを上げる
参考
バージョンを確認する
git --version git version 1.7.1
パッケージを読み込む
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker
ソースを読み込み、インストールする
cd wget https://www.kernel.org/pub/software/scm/git/git-2.4.0.tar.gz tar zxvf git-2.4.0.tar.gz cd git-2.4.0 make prefix=/usr/local all make prefix=/usr/local install . ~/.bash_profile git --version git version 2.4.0
最新を読み込み、インストールする
cd /usr/local/src/ git clone git://git.kernel.org/pub/scm/git/git.git cd git make prefix=/usr/local all make prefix=/usr/local install git --version git version 2.9.2.574.gc6b0597
Redmineを再起動する
cd /var/lib/redmine/tmp rm restart.txt touch restart.txt /etc/rc.d/init.d/httpd restart
参考
http://qiita.com/n_slender/items/54cd282c140fadbbb322
http://symfoware.blog68.fc2.com/blog-entry-1694.html
ConoHaでCentOS6.7へRedmine3.3をインストールする
1,パッケージインストール
1 |
yum -y install git gcc gcc-c++ libcurl-devel httpd httpd-devel openssl-devel readline-devel zlib-devel curl-devel mysql-server mysql-devel ImageMagick ImageMagick-devel ipa-pgothic-fonts |
2,EPELリポジトリの登録
1 |
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm |
3,開発ツール・インストール
1 |
yum -y groupinstall "Development Tools" |
4,Rubyをインストール
1 2 3 4 5 6 |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"'>> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc source ~/.bashrc mkdir ~/.rbenv/plugins cd ~/.rbenv/plugins |
1 |
git clone git://github.com/sstephenson/ruby-build.git |
10分ほどかかります。
1 |
rbenv install 2.2.5 |
1 |
rbenv shell 2.2.5 |
5,bundlerインストール
1 |
gem install bundler |
6,MySQL redmine用の設定
1 2 3 4 5 6 7 8 9 10 11 12 13 |
service mysqld start mysql -u root update mysql.user set password=password('centos') where user = 'root'; flush privileges; exit; mysql -u root -p Enter password:centos create database db_redmine default character set utf8; grant all on db_redmine.* to user_redmine@localhost identified by 'redmine'; flush privileges; exit; |
7,redmineインストール
1 2 3 |
curl -O http://www.redmine.org/releases/redmine-3.3.0.tar.gz tar zxvf redmine-3.3.0.tar.gz mv redmine-3.3.0 /var/lib/redmine |
8,DB情報設定
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
cd /var/lib/redmine/config cat <<EOF > database.yml production: adapter: mysql2 database: db_redmine host: localhost username: user_redmine password: redmine encoding: utf8 EOF cd /var/lib/redmine bundle install --without development test --path vendor/bundle bundle exec rake generate_secret_token RAILS_ENV=production bundle exec rake db:migrate RAILS_ENV=production REDMINE_LANG=ja bundle exec rake redmine:load_default_data |
9,Passengerインストール
1 2 3 4 5 6 7 |
cd /var/lib/redmine gem install passenger --no-rdoc --no-ri passenger-install-apache2-module passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf chown -R apache:apache /var/lib/redmine |
10,httpd設定
1 2 3 4 |
vim /etc/httpd/conf/httpd.conf #DocumentRoot "/var/www/html" ↓↓ DocumentRoot "/var/lib/redmine/public" |
DocumentRootで検索 /DocumentRoot
1 2 3 4 |
chown -R apache:apache /var/lib/redmine chmod o+x /root/ /etc/rc.d/init.d/httpd start |
11,Redmineへアクセス
サーバとトップへアクセス
1 |
http://xxx.xxx.xxx.xxx |
ConoHaでCentOS6.7へRedmine2.5をインストールする
1,パッケージインストール
1 |
yum -y install git gcc gcc-c++ libcurl-devel httpd httpd-devel openssl-devel readline-devel zlib-devel curl-devel mysql-server mysql-devel ImageMagick ImageMagick-devel ipa-pgothic-fonts |
2,EPELリポジトリの登録
1 |
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm |
3,開発ツール・インストール
1 |
yum -y groupinstall "Development Tools" |
4,Rubyをインストール
1 2 3 4 5 6 7 8 9 10 11 |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"'>> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc source ~/.bashrc mkdir ~/.rbenv/plugins cd ~/.rbenv/plugins git clone git://github.com/sstephenson/ruby-build.git rbenv install 2.0.0-p648 rbenv shell 2.0.0-p648 |
5,bundlerインストール
1 |
gem install bundler |
6,MySQL redmine用の設定
1 2 3 4 5 6 7 8 9 10 11 12 13 |
service mysqld start mysql -u root update mysql.user set password=password('centos') where user = 'root'; flush privileges; exit; mysql -u root -p Enter password:centos create database db_redmine default character set utf8; grant all on db_redmine.* to user_redmine@localhost identified by 'redmine'; flush privileges; exit; |
7,redmineインストール
1 2 3 |
curl -O http://www.redmine.org/releases/redmine-2.5.0.tar.gz tar zxvf redmine-2.5.0.tar.gz mv redmine-2.5.0 /var/lib/redmine |
8,DB情報設定
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
cd /var/lib/redmine/config cat <<EOF > database.yml production: adapter: mysql2 database: db_redmine host: localhost username: user_redmine password: redmine encoding: utf8 EOF cd /var/lib/redmine bundle install --without development test cd /var/lib/redmine/config bundle exec rake generate_secret_token RAILS_ENV=production bundle exec rake db:migrate |
9,Passengerインストール
1 2 3 4 5 6 7 |
cd /var/lib/redmine gem install passenger --no-rdoc --no-ri passenger-install-apache2-module passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf chown -R apache:apache /var/lib/redmine |
10,httpd設定
1 2 3 4 |
vim /etc/httpd/conf/httpd.conf #DocumentRoot "/var/www/html" ↓↓ DocumentRoot "/var/lib/redmine/public" |
DocumentRootで検索 /DocumentRoot
1 2 3 4 |
chown -R apache:apache /var/lib/redmine chmod o+x /root/ /etc/rc.d/init.d/httpd start |
11,Redmineへアクセス
サーバとトップへアクセス
1 |
http://xxx.xxx.xxx.xxx |
注意点(ポイント)
1,redmine-2.5.0の場合、Rubyのバージョンが依存する(2.0.0-p648)
2.2.3だとだめだった
2,chmod o+x /root/ をしないとダメだった
画面表示されない時はログファイルでエラーの内容を確認
find / -name error_log
cat /var/log/httpd/error_log
参考
http://j-orangepekoe.blog.so-net.ne.jp/2016-03-02
http://www.aetherworks.org/article/112066375.html
http://qiita.com/mozo/items/6ec0151dad350c051399
http://blog.redmine.jp/articles/2_5/installation_centos/
http://blog.redmine.jp/articles/3_2/install/centos/
Ubuntu16 で、漢字入力を設定する
Ubuntu16 で、漢字入力を設定する
システム設定>言語サポート
を選択する
必要な言語パッケージがインストールされる
インストールされたた、
システム設定>テキスト入力
から、
日本語を選択し
ー
ボタンで、削除する
+
ボタンで、追加を指定し
日本語(Mozc)(IBus)
を選択し、追加する
切り替えにカーソルを移動し、半角/全角
ボタンで、変換ボタンを指定する
矢印で、
日本語(Mozc)(IBus)
を、一番上にする
入力する場所で、変換ボタンを押して
入力が切り替えるのを見る(右上)
日本語変換になった時に
切り替えの表示を
クリックし、入力モードをひらがなにする
Ubuntu16 に、Chromeをインスツール
Ubuntu16 に、Chromeをインスツールします
https://www.google.co.jp/chrome/browser/desktop/
から、パッケージをダウンロードする
gdebiをダウンロードする
sudo apt -y install gdebi
ダウンロードしたフォルダーから
google-chrome-stable_current_amd64.deb
を、右クリックで、gdebiを選択して
インストールを行う
完了したら、左上のコンピュータ検索から
chrome
で検索する
ドラッグして、メニューに追加する
検索で表示されない場合には
端末から
google-chrome
で、一度、起動する
左上のコンピュータ検索から
chrome
で検索する
ドラッグして、メニューに追加する
CentOS 6.7にWordPressとレスポンシブルWebデザインテーマbizvektorを組み込んでみる
CentOS 6.7にWordPressとレスポンシブルWebデザインテーマbizvektorを組み込んでみる
CentOs に WordPressをインストールする
root権限になっていなければ、rootになる
$su パスワード: #
各種パッケージ
httpd mysql-server php php-mysql wget
をインストールする
yum -y install httpd mysql-server php php-mysql wget
apacheがインストールされたか確認
/etc/init.d/httpd status httpd は停止しています
apacheを起動する
/etc/init.d/httpd start httpd を起動中: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ]
localhostにアクセスする
curl 'http://localhost/'
firefoxで、アクセスしてみる
firefox localhost/
タイムゾーンの設定
PHPの設定ファイル(/etc/php.ini)を編集する。
vim /etc/php.ini
date.timezone =を検索(”/”は検索)
/date.timezone =
iで、挿入モードにして
#date.timezone =
date.timezone = “Asia/Tokyo”
に変更
; Defines the default timezone used by the date functions ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone #date.timezone = date.timezone = "Asia/Tokyo"
esc+:wq
で、上書き終了
apacheを再起動
/etc/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ]
Webが起動し、PHPが走っているか確認する
cat <<EOF > /var/www/html/phpinfo.php <?php phpinfo(); ?> EOF curl 'http://localhost/phpinfo.php'
firefoxで、アクセスしてみる
firefox localhost/phpinfo.php
mysqlがインストールされたか確認
/etc/init.d/mysqld status mysqld は停止しています
mysqlを起動する
/etc/init.d/mysqld start : mysqld を起動中: [ OK ]
パスワードを設定(rootにパスワードcentosと設定してみた)
mysql -u root update mysql.user set password=password('centos') where user = 'root'; flush privileges; exit;
設定したパスワードでログインできるかを確認します。
# mysql -u root -p Enter password: exit;
データベース(wordpress)を作成
wordpressというユーザを作成し、パスワードをwordpress2016とする
# mysql -u root -p Enter password: create database wordpress; grant all privileges on wordpress.* to wordpress@localhost identified by 'wordpress2016';
WordPressをインストール
WordPressをダウンロードし
ファイルを解凍し、
Apacheが読み込めるようにする。
cd /tmp wget http://ja.wordpress.org/wordpress-3.8.1-ja.tar.gz tar zxvf wordpress-3.8.1-ja.tar.gz cp -r wordpress /var/www/ chown -R apache.apache /var/www/wordpress
apacheの設定を行う
vim /etc/httpd/conf/httpd.conf
DocumentRoot “/var/www/html
DocumentRoot “/var/www/wordpress”
に変更
DocumentRoot “/var/www/htmlを検索
/DocumentRoot "/var/www/html
DocumentRoot “/var/www/wordpress”
に変更
iで、挿入モードに入る
#DocumentRoot "/var/www/html" DocumentRoot "/var/www/wordpress "
次に、
<Directory "/var/www/html">
を
<Directory "/var/www/wordpress">
に変更
一度、ESCで、コマンドモードに戻り
/<Directory "/var/www/html">
で、検索
挿入モードiで、
#<Directory "/var/www/html"> <Directory "/var/www/wordpress">
に、修正
次に、
<Directory "/var/www/wordpress">
の中の
AllowOverride None
を、
AllowOverride All
に変更
# AllowOverride None AllowOverride All
に変更
esc+:wq
を指定
apacheを再起動
/etc/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ]
fierfoxで、アクセスする
firefox localhost/
データベース名:wordpress
ユーザ名:wordpress
パスワード:wordpress2016
データベースのホスト名:localhost
テーブル接頭辞:wp_
「インストール続行」
サイトのタイトル:タイトル
ユーザー名:admin
パスワード:admin_password
パスワード:admin_password
メールアドレス:xxx@yyy.zz
「WordPressをインストール」
成功しました !
「ログイン」
にて、開始画面へ
WordPress 4.5.3 が利用可能です ! 更新してください。
とのメッセージがあるため、
WordPress 4.5.3に更新する
WordPress の新しいバージョンがあります。
「今すぐ更新」
を押下
更新の後、ログイン画面に戻るので、
ログイン後、
プラグインを「今すぐ更新」を押下
次に、レスポンシブルWebデザインテーマbizvektorを組み込んでみる
BizVektor
のダウンロードページ
から、
Download BizVektor ver 1.8.23
を、ダウンロード
外観>テーマ>新規追加
「データのアップロード」
により
先ほど、ダウンロードしたファイルを「参照」で
指定し、
「今すぐインストール」
を、押下
外観>テーマ
選択し、
ダウンロードしたテーマ「BizVektor」
を、有効にしてください。
に従い、
「プラグイン」→「新規追加」画面より、『お気に入り』画面を表示。
「wordpress.orgユーザー名」のフォームに「bizvektor」と入力して、必要なプラグインをインストール。
インストールした、プラグインを有効化します
プラグインを追加する
プラグインが、有効にならない場合、
必要なライブラィーを追加する
お使いの WP Multibyte Patch を有効化するには PHP の mbstring 関数が必要です。
yum -y install php-mbstring
apacheを再起動
/etc/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ]
コンテンツデータのダウンロード・インポート
に従い、コンテンツデータを、インポートする
「ツール」→「インポート」→「WordPress」でダウンロードしたxmlファイルを選択し、「ファイルをアップロードしてインポート」
インストール時のエラーが分からないので、
エラー表示を有効にする
vim /etc/php.ini
display_errors = Off
変更前
display_errors = On
変更後
display_errors =を検索し
/display_errors =
i挿入モードで
;display_errors = Off display_errors = On
に変更
esc+:wqで上書き終了
apacheを再起動
/etc/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ]
WordPress インポートできない時の対処方法
Fatal error: Class ‘DOMDocument’ not found
yum -y install php-xml
再度、apacheを再起動
/etc/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ]
サンプルデータが表示できた・・・
apacheとmysqlを自動起動に設定する
現状の確認
apacheは
chkconfig --list | grep httpd
offになっている
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
自動起動(on)に設定
chkconfig httpd on
onになった
chkconfig --list | grep httpd httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
mysqlの設定も
chkconfig --list | grep mysqld
offになっている
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
onにする
chkconfig mysqld on chkconfig --list | grep mysqld mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
一応chromeもインストールしておく
wget http://chrome.richardlloyd.org.uk/install_chrome.sh bash ./install_chrome.sh
テーマ、記事などを、修正削除していて、
うまく行かなくなり、削除し、再インストーツする場合。
wordpressが残っている確認する
cd /tmp ls wordpress
もし、なければ、再度、ダウンロード
cd /tmp wget http://ja.wordpress.org/wordpress-3.8.1-ja.tar.gz tar zxvf wordpress-3.8.1-ja.tar.gz
コンテンツ側(/var/www/wordpress)を削除し、
再度、複写する
rm -rf /var/www/wordpress cp -r wordpress /var/www/ chown -R apache.apache /var/www/wordpress
Webより、再度設定する
firefox localhost/
データベーステーブルの接頭辞は、
一応、wp1_に変えておく
エラー対策まとめ、
■プラグイン有効時(WP Multibyte Patch)でのエラー
[/html]
yum -y install php-mbstring
/etc/init.d/httpd restart
[/html]
■サンプルデータのインポート時に無反応
vim /etc/php.ini にて、 display_errors = On /etc/init.d/httpd restart
■サンプルデータのインポート時のエラー
yum -y install php-xml /etc/init.d/httpd restart
■サンプルデータ読み込み時の、infoエラー
をインポートできませんでした。投稿タイプ info が有効ではありません。
テーマが、「BizVektor」に切り替わっていない
外観>テーマで、
「BizVektor」を有効化
UbuntuでBootstrapを試してみる
Ubuntuの環境で、Bootstrapをインストールしてみます
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
cd mkdir bootstrap cd bootstrap wget https://github.com/twbs/bootstrap/releases/download/v3.3.6/bootstrap-3.3.6-dist.zip unzip bootstrap-3.3.6-dist.zip mv bootstrap-3.3.6-dist/* ./ cd mkdir bootstrap cd bootstrap wget https://github.com/twbs/bootstrap/releases/download/v3.3.6/bootstrap-3.3.6-dist.zip unzip bootstrap-3.3.6-dist.zip mv bootstrap-3.3.6-dist/* ./ cat <<EOF > header.txt <html> <head> <meta charset="utf-8"></meta> <link href="css/bootstrap.min.css" rel="stylesheet" /> </head> <body> EOF cat <<EOF > body.txt <div class="row"> <div class="col-sm-3" style="background: red;">Sidebar</div> <div class="col-sm-1" style="background: gray;">Sidebar</div> <div class="col-sm-8" style="background: green;">Sidebar <div class="row"> <div class="col-sm-2" style="background: yellow;">Sidebar</div> <div class="col-sm-3" style="background: violet;">Sidebar</div> <div class="col-sm-3" style="background: blue;">Sidebar</div> </div> </div> </div> EOF cat <<EOF > footer.txt <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js" type="text/javascript"></script> </body> </html> EOF cat header.txt > index.html cat body.txt >> index.html cat footer.txt >> index.html firefox ./index.html & gedit ./index.html |
■pills
ナビゲーション(錠剤:pills)
下記のような、を表示してみます。
1,を実施の後に、行って下さい。
http://getbootstrap.com/components/#nav-pills
1 2 3 4 5 6 7 8 9 10 11 12 13 |
cat <<EOF > body.txt <ul class="nav nav-pills"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="presentation"><a href="#">Messages</a></li> </ul> EOF cat header.txt > pills.html cat body.txt >> pills.html cat footer.txt >> pills.html firefox ./pills.html & gedit ./pills.html |
■tabs(タブ)
http://getbootstrap.com/components/#nav-tabs
1 2 3 4 5 6 7 8 9 10 11 12 13 |
cat <<EOF > body.txt <ul class="nav nav-tabs"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="presentation"><a href="#">Messages</a></li> </ul> EOF cat header.txt > tabs.html cat body.txt >> tabs.html cat footer.txt >> tabs.html firefox ./tabs.html & gedit ./tabs.html |
■Breadcrumbs(パンくず)
http://getbootstrap.com/components/#breadcrumbs
1 2 3 4 5 6 7 8 9 10 11 12 13 |
cat <<EOF > body.txt <ol class="breadcrumb"> <li><a href="#">Home</a></li> <li><a href="#">Library</a></li> <li class="active">Data</li> </ol> EOF cat header.txt > Breadcrumbs.html cat body.txt >> Breadcrumbs.html cat footer.txt >> Breadcrumbs.html firefox ./Breadcrumbs.html & gedit ./Breadcrumbs.html |
■pagination(ページ付け)
http://getbootstrap.com/components/#pagination-default
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
cat <<EOF > body.txt <nav> <ul class="pagination"> <li> <a href="#" aria-label="Previous"> <span aria-hidden="true">«</span> </a> </li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li> <a href="#" aria-label="Next"> <span aria-hidden="true">»</span> </a> </li> </ul> </nav> EOF cat header.txt > pagination.html cat body.txt >> pagination.html cat footer.txt >> pagination.html firefox ./pagination.html & gedit ./pagination.html |
■Pager(ページャ)
http://getbootstrap.com/components/#default-example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
cat <<EOF > body.txt <nav> <ul class="pager"> <li><a href="#">Previous</a></li> <li><a href="#">Next</a></li> </ul> </nav> EOF cat header.txt > pager.html cat body.txt >> pager.html cat footer.txt >> pager.html firefox ./pager.html & gedit ./pager.html |
■Aligned links(並べたリンク)
http://getbootstrap.com/components/#aligned-links
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
cat <<EOF > body.txt <nav> <ul class="pager"> <li class="previous"><a href="#"><span aria-hidden="true">←</span> Older</a></li> <li class="next"><a href="#">Newer <span aria-hidden="true">→</span></a></li> </ul> </nav> EOF cat header.txt > links.html cat body.txt >> links.html cat footer.txt >> links.html firefox ./links.html & gedit ./links.html |
■Available variations(各種のラベル)
http://getbootstrap.com/components/#available-variations
1 2 3 4 5 6 7 8 9 10 11 12 13 |
cat <<EOF > body.txt <span class="label label-default">Default</span> <span class="label label-primary">Primary</span> <span class="label label-success">Success</span> <span class="label label-info">Info</span> <span class="label label-warning">Warning</span> <span class="label label-danger">Danger</span> EOF cat header.txt > available.html cat body.txt >> available.html cat footer.txt >> available.html firefox ./available.html & gedit ./available.html |
■Badges(バッジ、印)
http://getbootstrap.com/components/#badges
1 2 3 4 5 6 7 8 9 10 11 12 |
cat <<EOF > body.txt <a href="#">Inbox <span class="badge">42</span></a> <button class="btn btn-primary" type="button"> Messages <span class="badge">4</span> </button> EOF cat header.txt > badges.html cat body.txt >> badges.html cat footer.txt >> badges.html firefox ./badges.html & gedit ./badges.html |
VirtualBox centos6.8で、Apache+Passenger+Sinatraでの環境構築
VirtualBox centos6.8で、Apache+Passenger+Sinatraでの環境構築
してみる
sudoを使えるようにする
使用できるか確認する
1 |
sudo ls / |
・結果表示 We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for centos: ##←パスワードを入力 centos は sudoers ファイル内にありません。この事象は記録・報告されます。 [centos@localhost ~]$
使用できない
1 |
su |
Passwordを入力
1 |
visudo |
ALL=を検索する
1 |
/ALL= |
root ALL=(ALL) ALL
の下に
ユーザー名 ALL=(ALL) ALLを追加する
1 |
centos ALL=(ALL) ALL |
vi のコマンドなので
iで、挿入モードとして
ユーザー名 ALL=(ALL) ALL
を入力し
[Esc]+:+wq+改行で上書き終了
suから抜ける
1 |
exit |
suから抜ける
もう一度ためして見る
1 |
sudo ls / |
・表示結果 [sudo] password for centos: bin dev home lib64 media mnt opt root selinux sys usr boot etc lib lost+found misc net proc sbin srv tmp var [centos@localhost ~]$
できた。
必要なアプリをインストール
1 |
sudo yum -y install git gcc gcc-c++ libcurl-devel httpd httpd-devel openssl-devel readline-devel zlib-devel |
1 2 3 4 5 6 |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"'>> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc source ~/.bashrc mkdir ~/.rbenv/plugins cd ~/.rbenv/plugins |
1 |
git clone git://github.com/sstephenson/ruby-build.git |
1 |
rbenv install 2.2.5 |
15分ぐらいかかります・・・・
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
rbenv shell 2.2.5 gem install bundler cd mkdir sina cd sina mkdir vendor mkdir vendor/bundle mkdir public mkdir tmp touch tmp/always_restart.txt bundle init echo 'gem "sinatra"' >> Gemfile echo 'gem "passenger"' >> Gemfile bundle install --path vendor/bundle |
1 |
bundle exec passenger-install-apache2-module |
・結果表示 Here's what you can expect from the installation process: 1. The Apache 2 module will be installed for you. 2. You'll learn how to configure Apache. 3. You'll learn how to deploy a Ruby on Rails application. : : Press Enter to continue, or Ctrl-C to abort. 1を、選択 ・結果表示 Use <space> to select. If the menu doesn't display correctly, press '!' ‣ ⬢ Ruby ⬢ Python ⬡ Node.js ⬡ Meteor entrで、進んで行く
1 2 3 4 5 6 7 |
echo "#coding: utf-8" >app.rb echo "require 'sinatra'" >>app.rb echo "get '/' do" >>app.rb echo "'Hello World'" >>app.rb echo "end" >>app.rb echo "require File.expand_path(File.dirname(__FILE__)) + '/app'" >config.ru echo "run Sinatra::Application" >>config.ru |
1 |
su |
1 2 |
bundle exec passenger-install-apache2-module --snippet >> /etc/httpd/conf/httpd.conf echo "DocumentRoot /home/centos/sina/public" >> /etc/httpd/conf/httpd.conf |
1 |
/etc/rc.d/init.d/httpd restart |
エラーがでます
・結果表示 [root@localhost sina]# /etc/rc.d/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: httpd: Syntax error on line 1010 of /etc/httpd/conf/httpd.conf: Cannot load /home/centos/sina/vendor/bundle/ruby/2.2.0/gems/passenger-5.0.29/buildout/apache2/mod_passenger.so into server: /home/centos/sina/vendor/bundle/ruby/2.2.0/gems/passenger-5.0.29/buildout/apache2/mod_passenger.so: cannot open shared object file: Permission denied
cannot open shared object file: Permission denied
Permission関係なので、SELinuxの設定を変えてみます
1 |
setenforce 0 |
1 |
/etc/rc.d/init.d/httpd restart |
[root@localhost sina]# /etc/rc.d/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ]
apacheの起動はできた
http://localhost/にアクセスしてみます
1 |
curl 'http://localhost/' |
エラーがでる
[root@localhost sina]# curl 'http://localhost/' <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access / on this server.</p> <hr> <address>Apache/2.2.15 (CentOS) Server at localhost Port 80</address> </body></html> [root@localhost sina]#
apacheのエラーログを調べてみる
まず、error_logのありかを調べる
1 |
find / -name error_log |
・結果表示 /var/log/httpd/error_log
エラーを表示してみる
1 |
cat /var/log/httpd/error_log |
・表示結果 : : [Sat Jun 25 05:17:15 2016] [error] [client ::1] (13)Permission denied: access to / denied
(13)Permission denied: access to / denied
で、Googleに聞いてみる
ユーザホームディレクトリのパーミッションが原因のようだ
http://dqn.sakusakutto.jp/2010/05/apache_13permission_denied_acc.html http://toybox-v2.blogspot.jp/2011/10/13permission-denied-access-to-denied.html(13)Permission denied: access to hoge denied の対処
Permissionを変えてみる
まず、現状を調べる
1 |
ls -la /home/ |
・表示結果 合計 12 drwxr-xr-x. 3 root root 4096 6月 22 05:18 2016 . dr-xr-xr-x. 25 root root 4096 6月 25 04:16 2016 .. drwx------. 33 centos centos 4096 6月 25 05:00 2016 centos
実行権限を付与する
1 2 |
chmod 755 /home/*** ls -la /home/ |
・表示結果 合計 12 drwxr-xr-x. 3 root root 4096 6月 22 05:18 2016 . dr-xr-xr-x. 25 root root 4096 6月 25 04:16 2016 .. drwxr-xr-x. 33 centos centos 4096 6月 25 05:00 2016 centos [root@localhost sina]#
実行権限が付与された
drwx------. 33 centos centos 4096 6月 25 05:00 2016 centos ↓↓ drwxr-xr-x. 33 centos centos 4096 6月 25 05:00 2016 centos
もう一度行ってみる
1 |
/etc/rc.d/init.d/httpd restart |
1 |
curl 'http://localhost/' |
[root@localhost sina]# curl 'http://localhost/' Hello World[root@localhost sina]#
うまく表示された
Firfoxからhttp://localhost/を呼んでも、うまくいった
再起動して確認してましす
必要はファイルなどは、保存後、アプリを終了しておいて、下さい。
リブートします
1 |
reboot |
SELinuxを確認
1 |
getenforce |
[centos@localhost ~]$ getenforce Enforcing [centos@localhost ~]$
Enforcing → SELinux機能、アクセス制御が有効
無効に設定する
/etc/selinux/config
ファイルの
SELINUX=enforcing
を
SELINUX=disabled
に変更します
1 |
sudo vim /etc/selinux/config |
apacheの状態を調べる
1 |
/etc/rc.d/init.d/httpd status |
httpd は停止しています [centos@localhost ~]$
1 |
chkconfig --list | grep httpd |
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
1 |
sudo chkconfig httpd on |
1 |
chkconfig --list | grep httpd |
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
レベル2から5がon(自動起動)になる
再度、リブートしてみます
1 |
reboot |
SELinuxを確認
1 |
getenforce |
[centos@localhost ~]$ getenforce Disabled [centos@localhost ~]$
無効なのでOK
apacheの状態を調べる
1 |
sudo /etc/rc.d/init.d/httpd status |
[sudo] password for centos: httpd (pid 2021) を実行中... [centos@localhost ~]$
実行中なのでOK
localhostにアクセスしてみる
1 |
curl 'http://localhost/' |
[centos@localhost ~]$ curl 'http://localhost/' Hello World[centos@localhost ~]$
接続できた
Firfox
http://localhost/
にアクセスする
Hello World
無事表示されました