Welcome Guest, Not a member yet? Register   Sign In
Change localhost:8080 to custom domain CI4
#6

(This post was last modified: 11-27-2022, 06:12 AM by refs.)

(11-27-2022, 02:25 AM)JustJohnQ Wrote: If you set up Apache (for example WAMP www.wampserver.com) you can add virtual hosts. You can do this by adding a host name to the file hosts (in windows\system32\drivers\etc), for example:
Code:
127.0.0.1 mypCI4.local
Then add a virtual host in httpd-vhosts.conf :

Code:
<VirtualHost *:80>
ServerName mypCI4.local
ServerAlias www.mypCI4.local
DocumentRoot "d:/projects/mypCI4/public"
<Directory  "d:/projects/mypCI4/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
After restarting Apache you should be able to access your CI4 installation on www.mypCI4.local.
See https://noobietech.com/create-a-virtual-...p-windows/
You won't be able to use php spark serve this way, but you can setup multiple installations now.

hmm,,interesting, okay, will try it

(11-27-2022, 04:05 AM)kenjis Wrote:
(11-27-2022, 02:03 AM)refs Wrote: So, is it mean that CI4 domain will stay like "localhost:8080" if i use php spark serve ?

"php spark serve" is a server for development.
You can change hostname (=localhost) and port number (=8080).
See "php spark help serve"

But there is no way to change the URI path.
And if you change the hostname, the hostname must be resolved.
For example, you need to add it in your hosts file.

(11-27-2022, 02:03 AM)refs Wrote: and it's also mean i can't have multiple project using CI4 in same host ?

If you mean you want to server like:
http://example.com/project1/
http://example.com/project2/
You cannot use "php spark serve" because it cannot set the URI path (/project1/).

But of course you can do it with Apache.

okay, thanks for the information kenjis
Reply


Messages In This Thread
RE: Change localhost:8080 to custom domain CI4 - by refs - 11-27-2022, 06:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB