質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

VPS

VPS(バーチャル・プライベート・サーバ)は、仮想化されたサーバをレンタルするサービスで、共有サーバでありながら専門サーバと同等の機能を果たします。物理的な専門サーバより安価で提供できるメリットがあります。

Q&A

1回答

2037閲覧

vagrantで作成したRailsファイルをさくらVPSで表示する方法について

退会済みユーザー

退会済みユーザー

総合スコア0

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

VPS

VPS(バーチャル・プライベート・サーバ)は、仮想化されたサーバをレンタルするサービスで、共有サーバでありながら専門サーバと同等の機能を果たします。物理的な専門サーバより安価で提供できるメリットがあります。

0グッド

0クリップ

投稿2018/07/17 05:12

編集2018/07/17 12:08

今回初めてVPSの設定を自分で行っています。設定については、

https://dotinstall.com/lessons/basic_sakura_vps

上記ドットインストールを参考に行い、Lesson#114,#1719迄完了しています。

現状として、
vim /var/www/*******.jp/public_html/index.html
にてviコマンドで文字を入力したところ、ファイルも作成され、ドメインにも文字が入力されており、無事に進行している状態です。

ただ、ここから自身でvagrantで作成したrailsファイルを具体的にどうアップロードすればいいのかがわからずに困っております。

使用しているソフトはCyberduckとなります。

試したこと

写真添付のように、crmと言うファイルまるごとをpublic_htmlにコピーして貼り付けましたが、ドメインにアクセスしても変化なし

イメージ説明

【Webサーバの設定について】
#httpd.conf

<VirtualHost :80>
ServerName .jp
DocumentRoot "/var/www/
.jp/public_html"
DirectoryIndex index.html index.php
ErrorLog /var/log/httpd/
.jp_error_log
CustomLog /var/log/httpd/
.jp_access_log combined
AddDefaultCharset UTF-8
<Directory "/var/www/
**.jp/public_html">
AllowOverride All
</Directory>
</VirtualHost>

#vim /etc/httpd/conf/httpd.conf

Last login: Tue Jul 17 14:11:57 on ttys000
kenta:~ okuyamakenta$ ssh -p 61203 smart@160.16.229.61
Last login: Tue Jul 17 17:31:30 2018 from kd111239183103.au-net.ne.jp

SAKURA Internet [Virtual Private Server SERVICE]

[smart@tk2-256-37807 ~]$ vim /etc/httpd/conf/httpd.conf
[smart@tk2-256-37807 ~]$ vim /etc/httpd/conf.d/xn--vckvb6c8fw90p7kt9m0f.jp.conf
[smart@tk2-256-37807 ~]$ vim /etc/httpd/conf/httpd.conf

Last login: Tue Jul 17 14:11:57 on ttys000 kenta:~ okuyamakenta$ ssh -p 61203 smart@160.16.229.61 Last login: Tue Jul 17 17:31:30 2018 from kd111239183103.au-net.ne.jp SAKURA Internet [Virtual Private Server SERVICE] [smart@tk2-256-37807 ~]$ vim /etc/httpd/conf/httpd.conf [smart@tk2-256-37807 ~]$ vim /etc/httpd/conf.d/xn--vckvb6c8fw90p7kt9m0f.jp.conf [smart@tk2-256-37807 ~]$ vim /etc/httpd/conf/httpd.conf

Last login: Tue Jul 17 14:11:57 on ttys000
kenta:~ okuyamakenta$ ssh -p 61203 smart@160.16.229.61
Last login: Tue Jul 17 17:31:30 2018 from kd111239183103.au-net.ne.jp

SAKURA Internet [Virtual Private Server SERVICE]

[smart@tk2-256-37807 ~]$ vim /etc/httpd/conf/httpd.conf
[smart@tk2-256-37807 ~]$ vim /etc/httpd/conf.d/xn--vckvb6c8fw90p7kt9m0f.jp.conf
[smart@tk2-256-37807 ~]$ vim /etc/httpd/conf/httpd.conf

This is the main Apache server configuration file. It contains the

configuration directives that give the server its instructions.

See URL:http://httpd.apache.org/docs/2.2/ for detailed information.

In particular, see

URL:http://httpd.apache.org/docs/2.2/mod/directives.html

for a discussion of each configuration directive.

Do NOT simply read the instructions in here without understanding

what they do. They're here only as hints or reminders. If you are unsure

consult the online docs. You have been warned.

The configuration directives are grouped into three basic sections:

1. Directives that control the operation of the Apache server process as a

whole (the 'global environment').

2. Directives that define the parameters of the 'main' or 'default' server,

which responds to requests that aren't handled by a virtual host.

These directives also provide default values for the settings

of all virtual hosts.

3. Settings for virtual hosts, which allow Web requests to be sent to

different IP addresses or hostnames and have them handled by the

same Apache server process.

Configuration and logfile names: If the filenames you specify for many

of the server's control files begin with "/" (or "drive:/" for Win32), the

server will use that explicit path. If the filenames do not begin

with "/", the value of ServerRoot is prepended -- so "logs/foo.log"

with ServerRoot set to "/etc/httpd" will be interpreted by the

server as "/etc/httpd/logs/foo.log".

Section 1: Global Environment

The directives in this section affect the overall operation of Apache,

such as the number of concurrent requests it can handle or where it

can find its configuration files.

Don't give away too much information about all the subcomponents

we are running. Comment out this line if you don't mind remote sites

finding out what major optional modules you are running

ServerTokens Prod

ServerRoot: The top of the directory tree under which the server's

configuration, error, and log files are kept.

NOTE! If you intend to place this on an NFS (or otherwise network)

-- 挿入 -- 20,1 先頭

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ドメインにアクセスしても変化なし

とのことですが、http://***.jp/ にアクセスした、ということでしょうか?
Railsアプリは /var/www/***.jp/public_html/crm/ に配置されているので、http://***.jp/crm/ にアクセスするのが正しいです。

それでなお変化が無い場合は、また別の理由があるかと思います。

投稿2018/07/17 05:31

kazto

総合スコア7196

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2018/07/17 05:38

お返事いただきありがとうございます。 上記の通りアクセスを行ったところ Forbidden You don't have permission to access /crm/ on this server. と表示がありました。 ご教示頂く事は可能でしょうか? よろしくお願い致します。
kazto

2018/07/17 05:51

Forbiddenということで、アップロード時にユーザ・パーミッションの設定に不備があり、Webサーバプロセスがファイルを参照できないことが原因かと考えられます。 ターミナルソフトでサーバにログインし、以下の2つのコマンドを実行した結果を追記お願いできますでしょうか。 $ ls -l /var/www/***.jp/public_html/index.html $ ls -ld /var/www/***.jp/public_html/crm/
退会済みユーザー

退会済みユーザー

2018/07/17 07:03

お返事いただきありがとうございます。 $ ls -l /var/www/***.jp/public_html/index.html ls: cannot access /var/www/***.jp/public_html/index.html: そのようなファイルやディレクトリはありません ※crmと言うファイルを入れる際に削除したのが理由かと思われます。 $ ls -ld /var/www/***.jp/public_html/crm/ drwxr-xr-x 12 smart smart 4096 7月 16 23:19 2018 /var/www/***.jp/public_html/crm/ 上記となります。 よろしくお願い致します。
退会済みユーザー

退会済みユーザー

2018/07/17 07:03

お返事いただきありがとうございます。 $ ls -l /var/www/***.jp/public_html/index.html ls: cannot access /var/www/***.jp/public_html/index.html: そのようなファイルやディレクトリはありません ※crmと言うファイルを入れる際に削除したのが理由かと思われます。 $ ls -ld /var/www/***.jp/public_html/crm/ drwxr-xr-x 12 smart smart 4096 7月 16 23:19 2018 /var/www/***.jp/public_html/crm/ 上記となります。 よろしくお願い致します。
kazto

2018/07/17 07:16

なるほど。ちょっと予想と違いました。 $ ls -ld /var/www/***.jp/public_html/crm/ drwx------ (以下略) とかになっていると予想していました。ディレクトリのパーミッションについては問題が無いと言えます。 次は、Webサーバの設定が怪しいかと思います。 httpd.conf のうち、crmディレクトリに関して設定を行ったかと思いますが、その部分を追記できますでしょうか。 できればコメントではなく、質問文に追記、の形の方が見やすいと思います。
退会済みユーザー

退会済みユーザー

2018/07/17 09:04

アップ致しました。 よろしくお願い致します。
kazto

2018/07/17 09:17

> DocumentRoot "/var/www/*.jp/public_html" 上記の * が、「なんとか.jp」のように日本語で記載しているということですね。 一方で、Cyberduckのスクショから、実際のパスは「/var/www/xn--vckvb6c8fw90p7kt9m0f.jp/public_html」であることがわかります。 httpd.conf内の日本語の記載(なんとか.jp)を、「xn--vckvb6c8fw90p7kt9m0f.jp」に置き換えてやる必要があります。 httpdの再起動もお忘れなく。
退会済みユーザー

退会済みユーザー

2018/07/17 09:28

ご返信いただきありがとうございます。 上記の件となりますが、既に全てで日本語ドメインは変換済みとなり、そこに対しては問題ないかと思われます。サーバー設定についても特に問題はございませんでしょうか?
kazto

2018/07/17 09:48

サーバ設定については、一部しか提示していただいてないので分かりかねます。 ひとまず、現状Forbiddenの状況に変わりありませんか? > ServerName *.jp DocumentRoot "/var/www/*.jp/public_html" 気になった点としては、上記は、ServerName と DocumentRoot が1行で書かれてしまっていますが、実際そのようになってますでしょうか。記載ミスでしょうか。
退会済みユーザー

退会済みユーザー

2018/07/17 12:03

お返事ありがとうございます。 上記店については記載ミスです。実際は行で分かれております。 サーバー設定の全文を記載致しました。 ご確認よろしくお願い致します。
退会済みユーザー

退会済みユーザー

2018/07/17 12:13

すみません。行制限か、コピーペーストがどうやってもうまく行かないようです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問