「バックエンド」タグアーカイブ

httpd: Could not reliably determine the server's fully qualified domain name, using kenjimorita-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message

vim /etc/hosts

https://stackoverflow.com/questions/9541460/httpd-could-not-reliably-determine-the-servers-fully-qualified-domain-name-us

あなたのhostsファイルには、有効なFQDNが含まれていないかまたはFQDN localhostです。 FQDNは、ホスト名部分だけでなく、ドメイン名の部分を含める必要があります。たとえば、次の例は有効なFQDNです。
host.server4-245.com
FQDNを選択し、両方のIPv4上のファイルとIPv6が、使用しているアドレス(お使いの場合には、localhostまたは127.0.0.1)あなたの/ etc / hostsにその両方が含まれかつ、一致するようにhttp.cofのサーバー名を変更してね。

FQDNってのは[「Fully Qualified Domain Name」]ホスト名とドメイン名まで含めた絶対ドメイン名

上記の場合これがそれ。(.まで)
kenjimorita-MacBook-Pro.local.

/private/etc/apache2/httpd.conf
ここにある設定ファイルにサーバーネームを書けっていっているみたい

vimをいつものようにwq!で書き込んで終了しようとすると

Can't open file for writing
書き込み権限のないユーザーでファイルを編集した場合
:w !sudo tee %

:w !{cmd}で現在のバッファの内容をcmdの標準入力に送る
sudo teeでrootユーザで指定したパスへの書き込み
% は現在読み込まれているバッファのファイルへのパス
参照

shell returned 1
Press ENTER or type command to continue

強制終了したことにあるスワップファイルが残っている

うう。。これはわたしの環境に依存するところ。。

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:run (default-cli) on project moriboot: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:run failed: Unable to find a single main class from the following candidates [com.example.App, com.example.app.Application] -> [Help 1]

Spring-Boot[Error]console
Spring-Boot[Error]

上のようなエラーが出た場合
com.example.Appとcom.example.app.Applicationどっちをmainとして実行していいか分からなくなっているので片方削除してビルドをcleanしてください

Cone of volume using the OOP of php

using accesser method,property,

[php]

<?php
class Cone1{
const PI = 3.14;
private $radius;
private $height;

public function setRadius($base){
$this->radius = $base;
}
public function setHeight($height){
$this->height = $height;
}
public function getRadius(){
return $this->radius;
}
public function getHeight(){
return $this->height;
}
///
public function getVolume(){
$area = pow($this->radius,2) * self::PI;
return $area * $this->height / 3;
}
}

?>
[/php]
[html]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>The volume of the cone</title>
</head>
<body>
<h2>use OOP of PrivateAccesser</h2>
<p>
<?php
require_once 'Cone1.php';
$obj = new Cone1();
$obj->setRadius(10);
$obj->setHeight(50);
print "The bottom surface of the radius: {$obj->getRadius()}" . '<br>';
print "The height of the cone: {$obj->getHeight()}" . '<br>';

    print &quot;The volume of the cone: {$obj-&gt;getVolume()}&quot;;
   ?&gt;
&lt;/p&gt;

</body>
</html>
[/html]

[java]
pacage jp.co.example.java15;

public class Main {
public static void main(String[] args){
for (int testNumber = 2; testNumber <= 100; testNumber++){
boolean isPrimeNumber = true;//mathtic
for (int i = 2; i < testNumber; i++) {
if(testNumber % i == 0) {
isPrimeNumber = false;
break;
}
}

  if (isPrimeNumber){ //functic
    System.out.println(testNumber);
  }
}

}
}


point
What is code ,what to do
be sure function


watch out valuable
boolean isPrimeNumber
int i
int testNumber

public class Main {
public static void main(String[] args){
for (int testNumber = 2; testNumber <= 100; testNumber++){
if (isPrimeNumber){
System.out.println(testNumber);
}
}
}
private static boolean isPrimeNumber(int testNumber){
for (int i = 2; i < testNumber; i++){
if(testNumber % i == 0){
return false;
}
}
return true;
}
}

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

public class Main {
public static void main(String[] args){
for (int testNumber = 2; testNumber <= 100; testNumber++){
boolean isPrimeNumber = isPrimeNumber(testNumber);
if (isPrimeNumber){
System.out.println(testNumber);
}
}
}
private static boolean isPrimeNumber(int testNumber){
for (int i = 2; i < testNumber; i++){
if(testNumber % i == 0){
return false;
}
}
return true;
}
}

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
//individaul
public class Main {
public static void main(String[] args){
for (int testNumber = 2; testNumber <= 100; testNumber++){//functic
if (isPrimeNumber(testNumber)){
System.out.println(testNumber);
}
}
}
private static boolean isPrimeNumber(int testNumber){//mathtic
for (int i = 2; i < testNumber; i++){
if(testNumber % i == 0){
return false;
}
}
return true;
}
}

/////////////////////////////
///
///
///
public class Main {
public static void main(String[] args){
//arrange Item
Item pencil = new Item("umi-hb-001","umi HB", "yotsubisienpitsu", "120");
//view Item
System.out.println("item");

//enpitu
System.out.println(&quot;itemCode&quot; + pencil.getCode());
System.out.println(&quot;itemname&quot; + pencil.getName());
System.out.println(&quot;itemmaker&quot; + pencil.getMaker());
System.out.println(&quot;itemPrice&quot; + pencil.getPrice());

}
}

///////////////////////////////
public class Item {
private final String code;
private final String name;
private final String maker;
private final int price;
public Item(String code, String name, String maker, int price){
super();
this.code = code;
this.name = name;
this.maker = maker;
this.price = price;
}
public String getCode(){
return code;
}
public String getName(){
return name;
}
public String getMaker(){
return maker;
}
public String getPrice(){
return price;
}
}
[/java]

2日前までwebデザインの知識しかなかった芸人がサーバー構築して「サーバー構築芸人」になった話

search
AWS_Viso2 posted by (C)kanpan

わたしは算数、数学も苦手なのですが今日ミニマムでサーバー構築ができました。嬉しい。
今理解できた知識はほんの一部なんでしょうけど、それでも一般的なwebがどういうインフラ構築しててどうやってネットワークを敷いてるのか知ることができた。

あーなるほどな、通信ってこういうことだったのかって。

以下サーバー構築の環境でしたこと。
VPC内にプライベートサブネットとパブリックサブネットで分けて、
プライベート側にWebサーバー置いて、Apacheをインストール、機能を持たせて、IPアドレスをパブリックにしてインターネットゲートウェイに渡す。
ルートテーブルでパケットの仕分けした。

プライベートの方はデータベースサーバーを置いて、アクセスをパブリックサブネットからのwebサーバーだけに絞る。
ただそうするとMySqlをインストールすることもできないからプライベートサブネットからインターネットと通信できるように
NAサーバー置く。
NAサーバーはhttpとhttpsのIPアドレスをネット側に渡すようにした。DBとは一通にして。

スクラム開発で、サーバー側の人と距離が近いからちょっとでもネットワーク理解したくて、
そこから言語をやりたかった。

ここからが多分深いところでまだ「できる」と思っていないけど
「サーバーを構築した」っていうのは一旦自信を持っていいと思う(てゆーふうに鼓舞してきた)

ありがとうございました