実現したいこと
app2を表示させたいです。
※ app1は表示されます。
現状出ているエラー
マルチドメイン設定を行っている片方のドメインがうまく表示されません。
nginxなどのルーティング設定が怪しいと考え、nginx -tコマンドを実行したところ、エラーが出てしまいました。
$ nginx -t nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/letsencrypt/options-ssl-apache.conf:9 nginx: configuration file /etc/nginx/nginx.conf test faile $ vi /etc/letsencrypt/options-ssl-apache.conf SSLEngine on SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 SSLHonorCipherOrder off SSLSessionTickets off SSLOptions +StrictRequire
試したこと
1.リブート
2./var/www/html/nuriemon/public/index.html
に「OK」と記載したファイルを追加
問題なく表示されました。
3.全てに;を追加した
※ 以下のエラーに変わった
nginx: [emerg] unknown directive "SSLEngine" in /etc/letsencrypt/options-ssl-apache.conf:7 nginx: configuration file /etc/nginx/nginx.conf test failed
その他情報
$ /usr/lib/systemd/system/httpd.service [Unit] Description=The Apache HTTP Server Wants=httpd-init.service After=network.target remote-fs.target nss-lookup.target httpd-init.service Documentation=man:httpd.service(8) [Service] Type=notify Environment=LANG=C ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND ExecReload=/usr/sbin/httpd $OPTIONS -k graceful # Send SIGWINCH for graceful stop KillSignal=SIGWINCH KillMode=mixed PrivateTmp=true [Install] WantedBy=multi-user.target
$ vi /etc/nginx/nginx.conf user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } }
$ vi /etc/nginx/default.d/php.conf index index.php index.html index.htm; location ~ .php$ { try_files $uri =404; fastcgi_intercept_errors on; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass php-fpm; }
$ vi /etc/httpd/conf/httpd.conf ※ コメントアウトの箇所は記載しておりません。 ServerRoot "/etc/httpd" Listen 80 <VirtualHost *:80> #ServerAdmin root@app1.com DocumentRoot /var/www/html/ZOTMAN/public ServerName app1.com #RewriteEngine on #RewriteCond %{SERVER_NAME} =app1.com #RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] RewriteEngine on RewriteCond %{SERVER_NAME} =app1.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> <VirtualHost *:80> #ServerAdmin root@app2.com DocumentRoot /var/www/html/app2/public ServerName app2.com #RewriteEngine on #RewriteCond %{SERVER_NAME} =app1.com #RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] RewriteEngine on RewriteCond %{SERVER_NAME} =app2.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@app1.com ServerName app1.com <Directory /> AllowOverride All Require all denied </Directory> DocumentRoot "/var/www/html" <Directory "/var/www"> AllowOverride All # Allow open access: Require all granted </Directory> <Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/error_log" LogLevel warn <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" </IfModule> <Directory "/var/www/cgi-bin"> AllowOverride None Options None Require all granted </Directory> <IfModule mime_module> TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 <IfModule mime_magic_module> MIMEMagicFile conf/magic </IfModule> EnableSendfile on IncludeOptional conf.d/*.conf Include /etc/httpd/conf/httpd-le-ssl.conf ~
お力添えいただけると幸いです。
回答2件
あなたの回答
tips
プレビュー