#環境
Apache/2.4.48
wordpress
#やりたいこと
apacheを再起動できるようにしたいです。
#やったこと
wordpressのサイトをxserverからawsに移植しようと思い
aws ec2 でlinuxにapacheを導入しサーバーを立てました。
その後サイトをssl化する為にcertbotを使用し以下のサイトを参考にssl化しました。
https://infltech.com/articles/N4MUGp
そしてサイトを開いたところトップページは表示されるようになったのですが下層ページが表示されません
調べてみるとmod rewriteが有効にする必要があるようなので
httpd.confに
LoadModule rewrite_module modules/mod_rewrite.soを最後尾に加えてapacheの再起動をしようとしたところ、
以下のようなエラーに出くわしました。
#出ている問題
[ec2-user@ip-10-10-9-55 conf.d]$ sudo systemctl restart httpd.service Job for httpd.service failed. See "systemctl status httpd.service" and "journalctl -xe" for details.
指示通りに
systemctl status httpd.serviceコマンドを打つと
[ec2-user@ip-10-10-9-55 conf.d]$ sudo systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/httpd.service.d mqphp-fpm.conf Active: failed (Result: protocol) since Mon 2021-10-11 03:18:33 UTC; 4min 48s ago Docs: man:httpd.service(8) Process: 13027 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS) Main PID: 13027 (code=exited, status=0/SUCCESS) Status: "Reading configuration..." Oct 11 03:18:33 ip-10-10-9-55.ap-northeast-1.compute.internal systemd[1]: Starting The Apache HTTP Server... Oct 11 03:18:33 ip-10-10-9-55.ap-northeast-1.compute.internal httpd[13027]: [Mon Oct 11 03:18:33.926124 2021] [so:warn] [pid 13027] AH01574: module rewrite_module is already loaded, skipping--- Oct 11 03:18:33 ip-10-10-9-55.ap-northeast-1.compute.internal httpd[13027]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:364 Oct 11 03:18:33 ip-10-10-9-55.ap-northeast-1.compute.internal httpd[13027]: httpd (pid 11961) already running Oct 11 03:18:33 ip-10-10-9-55.ap-northeast-1.compute.internal systemd[1]: Failed to start The Apache HTTP Server. Oct 11 03:18:33 ip-10-10-9-55.ap-northeast-1.compute.internal systemd[1]: Unit httpd.service entered failed state. Oct 11 03:18:33 ip-10-10-9-55.ap-northeast-1.compute.internal systemd[1]: httpd.service failed.
journalctl -xeと打つと
[ec2-user@ip-10-10-9-55 conf.d]$ sudo journalctl -xe ~~~~~~~~~~~同じような内容なので省略~~~~~~~~~~~~~~~~~~~~ -- Subject: Unit session-695.scope has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit session-695.scope has finished starting up. -- -- The start-up result is done. Oct 11 03:20:01 ip-10-10-9-55.ap-northeast-1.compute.internal CROND[13105]: (root) CMD (/usr/lib64/sa/sa1 1 1) Oct 11 03:20:07 ip-10-10-9-55.ap-northeast-1.compute.internal dhclient[2762]: XMT: Solicit on eth0, interval 113390ms. Oct 11 03:22:00 ip-10-10-9-55.ap-northeast-1.compute.internal dhclient[2762]: XMT: Solicit on eth0, interval 114820ms. Oct 11 03:23:22 ip-10-10-9-55.ap-northeast-1.compute.internal sudo[13274]: ec2-user : TTY=pts/0 ; PWD=/etc/httpd/conf.d ; USER=root ; COMMAND=/bin/systemctl status httpd.service Oct 11 03:23:22 ip-10-10-9-55.ap-northeast-1.compute.internal sudo[13274]: pam_unix(sudo:session): session opened for user root by ec2-user(uid=0) Oct 11 03:23:22 ip-10-10-9-55.ap-northeast-1.compute.internal sudo[13274]: pam_unix(sudo:session): session closed for user root Oct 11 03:23:55 ip-10-10-9-55.ap-northeast-1.compute.internal dhclient[2762]: XMT: Solicit on eth0, interval 114390ms. Oct 11 03:25:36 ip-10-10-9-55.ap-northeast-1.compute.internal sudo[13386]: ec2-user : TTY=pts/0 ; PWD=/etc/httpd/conf.d ; USER=root ; COMMAND=/bin/systemctl restart httpd.service Oct 11 03:25:36 ip-10-10-9-55.ap-northeast-1.compute.internal sudo[13386]: pam_unix(sudo:session): session opened for user root by ec2-user(uid=0) Oct 11 03:25:36 ip-10-10-9-55.ap-northeast-1.compute.internal systemd[1]: Starting The Apache HTTP Server... -- Subject: Unit httpd.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit httpd.service has begun starting up. Oct 11 03:25:36 ip-10-10-9-55.ap-northeast-1.compute.internal httpd[13390]: [Mon Oct 11 03:25:36.794616 2021] [so:warn] [pid 13390] AH01574: module rewrite_module is already loaded, skipping Oct 11 03:25:36 ip-10-10-9-55.ap-northeast-1.compute.internal httpd[13390]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:364 Oct 11 03:25:36 ip-10-10-9-55.ap-northeast-1.compute.internal httpd[13390]: httpd (pid 11961) already running Oct 11 03:25:36 ip-10-10-9-55.ap-northeast-1.compute.internal systemd[1]: Failed to start The Apache HTTP Server. -- Subject: Unit httpd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit httpd.service has failed. -- -- The result is failed.
とでます。
[ec2-user@ip-10-10-9-55 conf.d]$ sudo service httpd configtest [Mon Oct 11 03:33:36.340733 2021] [so:warn] [pid 13826] AH01574: module rewrite_module is already loaded, skipping AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:364 Syntax OK
構文エラーではなさそうです。
エラー文をみてもこれ以上どうすればいいのかわからず困っています。
個人的にはsslかmodrewrite周りの問題かなとは思うのですが、どうすればいいのかわからないです、、、
どうかご助力いただければ幸いです。
回答1件
あなたの回答
tips
プレビュー