PageSourceSearch

https://docs.phpvms.net/assets/js/4f3cf9a6.0bf22898.js

js phpvms.net collected 2026-10-04 13:24:43 UTC 4,834 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkphpvms_docs=self.webpackChunkphpvms_docs||[]).push([[4685],{14618(e,n,o){o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"installation/vhost","title":"VHost Configs","description":"If you\'re configuring your own VPS/webserver, the vhosts should point to the","source":"@site/docs/installation/vhost.md","sourceDirName":"installation","slug":"/installation/vhost","permalink":"/8.x/installation/vhost","draft":false,"unlisted":false,"editUrl":"https://github.com/phpvms/docs/tree/master/docs/installation/vhost.md","tags":[],"version":"current","frontMatter":{"id":"vhost","title":"VHost Configs"},"sidebar":"docs","previous":{"title":"Download","permalink":"/8.x/installation/download"},"next":{"title":"Docker","permalink":"/8.x/installation/docker"}}');var s=o(74848),i=o(28453);const r={id:"vhost",title:"VHost Configs"},a=void 0,l={},c=[{value:"Caddy (Recommended)",id:"caddy-recommended",level:2},{value:"Apache",id:"apache",level:2},{value:"nginx",id:"nginx",level:2},{value:"More details",id:"more-details",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["If you're configuring your own VPS/webserver, the vhosts should point to the\n",(0,s.jsx)(n.code,{children:"public"})," directory."]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsx)(n.p,{children:"These are only example configurations and may require some tweaking, depending\non the software versions"})}),"\n",(0,s.jsx)(n.h2,{id:"caddy-recommended",children:"Caddy (Recommended)"}),"\n",(0,s.jsx)(n.p,{children:"If you're using Caddy as your webserver, you can use a similiar vhost file."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-caddy",children:"yourdomain.com {\n    root * /path/to/phpvms/public\n    php_fastcgi localhost:9000\n    file_server\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"apache",children:"Apache"}),"\n",(0,s.jsx)(n.p,{children:"If you're using Apache as your webserver, you can use a similiar vhost file."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-htaccess",children:'<VirtualHost *:80>\n    ServerAdmin webmaster@localhost\n    ServerName yoursite.com\n    ServerAlias www.yoursite.com\n\n    # Update these paths to the /public folder of phpvms\n    DocumentRoot /path/to/phpvms/public\n    <Directory "/path/to/phpvms/public">\n           Options FollowSymLinks\n            ReWriteEngine On\n            AllowOverride All\n    </Directory>\n\n    # Example paths to log files\n    ErrorLog /var/log/http/phpvms/error.log\n    CustomLog /var/log/http/phpvms/access.log combined\n</VirtualHost>\n'})}),"\n",(0,s.jsx)(n.h2,{id:"nginx",children:"nginx"}),"\n",(0,s.jsx)(n.p,{children:'If you\'re setting up a VPS with nginx, you can use a similiar vhost\nconfiguration. This is the vhost I use on the demo site. This passes the PHP\nfiles to the FastCGI PHP handler, as well as enables the short, "friendly" URLS\nthat Laravel requires.'}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-nginx",children:"server {\n    listen 80 default_server;\n    server_name phpvms.test;\n\n    access_log /var/log/nginx/access.log;\n    error_log /var/log/nginx/error.log;\n\n    # The vhost root should point to the /public directory of phpvms\n    root /var/www/public;\n    index index.php index.html index.htm;\n\n    location / {\n         try_files $uri $uri/ /index.php$is_args$args;\n    }\n\n    location ~ \\.php$ {\n        try_files $uri =404;\n        fastcgi_split_path_info ^(.+\\.php)(/.+)$;
1\n        fastcgi_pass 127.0.0.1:9000; # THIS DEPENDS ON YOUR SERVER AND MIGHT NEED TO CHANGE\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include /etc/nginx/fastcgi_params;\n    }\n\n    location ~ /\\.ht {\n        deny all;\n    }\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"more-details",children:"More details"}),"\n",(0,s.jsxs)(n.p,{children:["For more information, view the\n",(0,s.jsx)(n.a,{href:"https://laravel.com/docs/9.x/deployment#server-configuration",children:"Laravel Web Server Configuration Docs"})]})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},28453(e,n,o){o.d(n,{R:()=>r,x:()=>a});var t=o(96540);const s={},i=t.createContext(s);function r(e){const n=t.useContext(i);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.