CodeIgniter Forums
Codeigniter 4 on local server simultaneously for LAN and for internet - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Codeigniter 4 on local server simultaneously for LAN and for internet (/thread-78852.html)



Codeigniter 4 on local server simultaneously for LAN and for internet - Corsari - 03-18-2021

hello friends

Maybe this is a question for apache gurus, but I gently ask it here.

Given that I have a fixed public IP from my DSL provider and that if needed it could be taken a free DNS name for that public IP

I'm wondering if it is contemplated to have a local PC running an apache server that hosts a CodeIgniter 4 app that will be used simultaneously from remote and local clients

Well , in the case the answer is yes:

which is it the suggested setup?

During my development I create a virtual host in apache and set it up on my client/s the host file

but when it comes the time to share this local host ALSO for the outside world? e.g. what about site_url() ?

Thank you for any help


RE: Codeigniter 4 on local server simultaneously for LAN and for internet - John_Betong - 03-18-2021

Quote:@Corsari,
I'm wondering if it is contemplated to have a local PC running an apache server that hosts a CodeIgniter 4 app that will be used simultaneously from remote and local clients

I'm not sure of your exact requirements, anyway this is how I have my setup:
Quote:// Ubuntu desktop with apache2
/var/www/mydomain.tld/
./app/
./public_html/
./system
./writable/
.htaccess
env
RSYNC.php

// REMOTE Server is a Mirror image of local Ubuntu desktop
/var/www/mydomain.tld/

To synchronise Local and Remote servers:
file: RSYNC.php
PHP Code:
<?php 
$rsync 
'rsync -avz /var/www/mydomain.tld/ -e ssh [email protected]:/var/www/mydomain.tld/';
echo 
$rsync



RE: Codeigniter 4 on local server simultaneously for LAN and for internet - Corsari - 03-18-2021

Hi John
Thank you for the tip

Since we use that app for us only,
but since some of us maybe around the nation connecting from remote

we would like to avoid a remote host

instead we would like to use ONLY our LOCAL server

so make it working Codeigniter on THIS very local server and allow local clients and remote clients simultaneously

Is that possible? If yes:
is that matter of a mixture of apache httpd.conf .htaccess and codeigniter .env and /Config/App.php ?

Thank you


RE: Codeigniter 4 on local server simultaneously for LAN and for internet - John_Betong - 03-18-2021

Hi Corsari,

It looks as though there are three problems:

Problem: #1:
Setup CodeIgniter4 on a local server - my setup should work fine on your local server and it is a matter of gradually setting relevant paths and ensuring the "writable" directory is writable.

Problem: #2:
Allowing access from other users to access your local setup - I have no experience and recommend temporarily forgetting CodeIgniter4 and allowing access to other users to your local setup.

Problem: #3:
Allowing external access to CodeIgniter4 local setup


RE: Codeigniter 4 on local server simultaneously for LAN and for internet - Corsari - 03-19-2021

If you mean security concerns

I'll have a production environment with auth for users

The problem to me , right now, is

- if is it possible to setup a Codeigniter in a local server that works for either LAN computers and remote (through internet connection) computers

I guess that a DNS could be needed for having just one name inside the CodeIgniter's settings