{"id":218,"date":"2025-05-14T21:29:52","date_gmt":"2025-05-14T12:29:52","guid":{"rendered":"https:\/\/www.359soft.jp\/?p=218"},"modified":"2025-05-22T22:06:10","modified_gmt":"2025-05-22T13:06:10","slug":"apache2-%e3%82%92%e3%83%aa%e3%83%90%e3%83%bc%e3%82%b9%e3%83%97%e3%83%ad%e3%82%ad%e3%82%b7%e3%81%a8%e3%81%97%e3%81%a6%e4%bd%bf%e7%94%a8%e3%81%97openconnect%e3%82%92%e6%a7%8b%e6%88%90%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.359soft.jp\/?p=218","title":{"rendered":"Apache2 \u3092\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3068\u3057\u3066\u4f7f\u7528\u3057OpenConnect\u3092\u69cb\u6210\u3059\u308b"},"content":{"rendered":"\n<p>Apache2 \u3092\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3068\u3057\u3066\u4f7f\u7528\u3057\u3001\u5916\u90e8\u304b\u3089\u306e\u63a5\u7d9a\u3092\u30dd\u30fc\u30c8 <strong>443<\/strong> \u3067\u53d7\u3051\u3064\u3064\u3001\u5185\u90e8\u3067 OpenConnect \u30b5\u30fc\u30d0\u30fc\uff08ocserv\uff09\u3092\u30dd\u30fc\u30c8 <strong>4443<\/strong> \u3078\u8ee2\u9001\u3059\u308b\u8a2d\u5b9a\u3092\u884c\u3046\u5834\u5408\u3001<code>mod_proxy<\/code> \u3092\u4f7f\u3063\u305f\u8a2d\u5b9a\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>Apache2 \u306e <\/strong><code>mod_proxy<\/code><strong> \u3092\u6709\u52b9\u5316<\/strong><\/h3>\n\n\n\n<p>\u307e\u305a\u3001\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2enmod proxy proxy_http ssl\nsudo systemctl restart apache2\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>Apache2 \u306e VirtualHost \u8a2d\u5b9a<\/strong><\/h3>\n\n\n\n<p>Apache \u306e <code>sites-available<\/code> \u306b\u65b0\u3057\u3044\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/sites-available\/openconnect.conf\n<\/code><\/pre>\n\n\n\n<p>\u6b21\u306e\u3088\u3046\u306a\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\uff1a<\/p>\n\n\n\n<p>apache<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:443&gt;\n    ServerName vpn.example.com\n\n    SSLEngine on\n    SSLCertificateFile \/etc\/letsencrypt\/live\/vpn.example.com\/fullchain.pem\n    SSLCertificateKeyFile \/etc\/letsencrypt\/live\/vpn.example.com\/privkey.pem\n\n    # ocserv \u3078\u306e\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u8a2d\u5b9a\n    ProxyRequests Off\n    ProxyPass \/ https:\/\/127.0.0.1:4443\/\n    ProxyPassReverse \/ https:\/\/127.0.0.1:4443\/\n\n    # WebSocket \u306e\u5bfe\u5fdc\uff08\u5fc5\u8981\u306a\u5834\u5408\uff09\n    ProxyPass \/ws\/ ws:\/\/127.0.0.1:4443\/\n    ProxyPassReverse \/ws\/ ws:\/\/127.0.0.1:4443\/\n\n    ErrorLog ${APACHE_LOG_DIR}\/vpn_error.log\n    CustomLog ${APACHE_LOG_DIR}\/vpn_access.log combined\n&lt;\/VirtualHost&gt;\n<\/code><\/pre>\n\n\n\n<p>\u3053\u3053\u3067\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ServerName<\/strong>: VPN \u30b5\u30fc\u30d0\u30fc\u306e\u30c9\u30e1\u30a4\u30f3\u540d\uff08\u9069\u5b9c\u5909\u66f4\uff09<\/li>\n\n\n\n<li><strong>SSL \u8a2d\u5b9a<\/strong>: Let's Encrypt \u306e\u8a3c\u660e\u66f8\u3092\u4f7f\u7528\uff08\u9069\u5b9c\u5909\u66f4\uff09<\/li>\n\n\n\n<li><strong>ProxyPass \/ ProxyPassReverse<\/strong>: Apache2 \u3092\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3068\u3057\u3066 ocserv \u306b\u8ee2\u9001<\/li>\n\n\n\n<li><strong>WebSocket \u306e\u8a2d\u5b9a<\/strong>: ocserv \u306e WebSocket \u3092\u6709\u52b9\u5316\u3057\u305f\u5834\u5408\u306e\u8a2d\u5b9a<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>\u8a2d\u5b9a\u3092\u6709\u52b9\u5316<\/strong><\/h3>\n\n\n\n<p>\u4f5c\u6210\u3057\u305f\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u6709\u52b9\u5316\u3057\u3001Apache2 \u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2ensite openconnect.conf\nsudo systemctl reload apache2\n<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u69cb\u6210\u3067 <strong>443<\/strong> \u756a\u30dd\u30fc\u30c8\u306e HTTPS \u901a\u4fe1\u3092\u53d7\u3051\u3001\u5185\u90e8\u3067 <strong>4443<\/strong> \u306b\u8ee2\u9001\u3067\u304d\u307e\u3059\uff01 \u74b0\u5883\u3084\u8981\u4ef6\u306b\u3088\u3063\u3066\u8a2d\u5b9a\u3092\u8abf\u6574\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u57fa\u672c\u7684\u306a\u69cb\u6210\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache2 \u3092\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3068\u3057\u3066\u4f7f\u7528\u3057\u3001\u5916\u90e8\u304b\u3089\u306e\u63a5\u7d9a\u3092\u30dd\u30fc\u30c8 443 \u3067\u53d7\u3051\u3064\u3064\u3001\u5185\u90e8\u3067 OpenConnect \u30b5\u30fc\u30d0\u30fc\uff08ocserv\uff09\u3092\u30dd\u30fc\u30c8 4443 \u3078\u8ee2\u9001\u3059\u308b\u8a2d\u5b9a\u3092\u884c\u3046\u5834\u5408\u3001mod_proxy \u3092\u4f7f\u3063 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-218","post","type-post","status-publish","format-standard","hentry","category-server"],"_links":{"self":[{"href":"https:\/\/www.359soft.jp\/index.php?rest_route=\/wp\/v2\/posts\/218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.359soft.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.359soft.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.359soft.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.359soft.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=218"}],"version-history":[{"count":1,"href":"https:\/\/www.359soft.jp\/index.php?rest_route=\/wp\/v2\/posts\/218\/revisions"}],"predecessor-version":[{"id":219,"href":"https:\/\/www.359soft.jp\/index.php?rest_route=\/wp\/v2\/posts\/218\/revisions\/219"}],"wp:attachment":[{"href":"https:\/\/www.359soft.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.359soft.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.359soft.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}