Access the same domain with different folders from the Internet
Hello,
I would like to know if there is the possibility of having a domain, which I have associated with my public IP with ddns, configured on my router.
Currently I have configured FCGI locally, so that I do have:
C:\wamp\www\project1
This go to version 7.4
Yes I have:
C:\wamp\www\project2
It will go to default version 8.2
So I have it configured like this:
On host:
::1 localhost
127.0.0.1 localhost
192.168.2.5 localhost
192.168.2.5 mydomain.ddns.net
192.168.2.5 mydomain.ddns.net:8081
192.168.2.5 project1.local
192.168.2.5 project2.local
In httpd.conf:
Defines MYPORT8081 8081
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:${MYPORT8081}
Listen [::0]:${MYPORT8081}
And in httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain.ddns.net
DocumentRoot "c:/wamp/www/project1"
<Directory "c:/wamp/www/project1/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
<IfModule fcgid_module>
Defines FCGIPHPVERSION "7.4.22"
FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
<Files ~ "\.php$">
Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
</Files>
</IfModule>
</VirtualHost>
#
<VirtualHost *:8081>
ServerName mydomain.ddns.net
DocumentRoot "c:/wamp/www/project2/public"
<Directory "c:/wamp/www/project2/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
As you can see in Servername, I would like to have the same domain that points to both sites, but when I type in the browser from the internet I can access:
- project1: mydomain.ddns.net
- project2: mydomain.ddns.net:8081
****Initially locally I have ServerName***
project1: project1.local
project2: project2.local
With the configuration that I have set, if I try to access mydomain.ddns.net it does access project1 but if I try to access mydomain.ddns.net:8081 it gives me an error
If I leave it as I have it locally and I want to access it from the internet, I would have to put it like this:
midomino.ddns.net/project1/
If you access it but project1 would have the default php configuration 8.2, so the FCGI is lost and of course my idea is to be able to access it from the internet but each project with its php version as I have it locally, but I have not been able to do it.
I have several questions:
Can you connect access from the Internet with a single domain to different folders by accessing through different ports (the example I have given in this post)?
If this is not possible, could you configure an https with svirtualhost that points to project1 (for example https) and project2 to (http)?
Would I have to contract a domain, for example mydomain.com, to be able to create subdomains and in turn be able to link with ddns to my public IP?
I have updated to the latest version of
wamp 3.3.1
Apache 2.4.57.4
php 8.2.10 by default
php 7.4.22
Sorry for the blurb, I've been using wamp for many years and I like it, but being able to configure several projects from the internet is important.
Thank you so much.
Hello,
I would like to know if there is the possibility of having a domain, which I have associated with my public IP with ddns, configured on my router.
Currently I have configured FCGI locally, so that I do have:
C:\wamp\www\project1
This go to version 7.4
Yes I have:
C:\wamp\www\project2
It will go to default version 8.2
So I have it configured like this:
On host:
::1 localhost
127.0.0.1 localhost
192.168.2.5 localhost
192.168.2.5 mydomain.ddns.net
192.168.2.5 mydomain.ddns.net:8081
192.168.2.5 project1.local
192.168.2.5 project2.local
In httpd.conf:
Defines MYPORT8081 8081
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:${MYPORT8081}
Listen [::0]:${MYPORT8081}
And in httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain.ddns.net
DocumentRoot "c:/wamp/www/project1"
<Directory "c:/wamp/www/project1/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
<IfModule fcgid_module>
Defines FCGIPHPVERSION "7.4.22"
FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
<Files ~ "\.php$">
Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
</Files>
</IfModule>
</VirtualHost>
#
<VirtualHost *:8081>
ServerName mydomain.ddns.net
DocumentRoot "c:/wamp/www/project2/public"
<Directory "c:/wamp/www/project2/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
As you can see in Servername, I would like to have the same domain that points to both sites, but when I type in the browser from the internet I can access:
- project1: mydomain.ddns.net
- project2: mydomain.ddns.net:8081
****Initially locally I have ServerName***
project1: project1.local
project2: project2.local
With the configuration that I have set, if I try to access mydomain.ddns.net it does access project1 but if I try to access mydomain.ddns.net:8081 it gives me an error
If I leave it as I have it locally and I want to access it from the internet, I would have to put it like this:
midomino.ddns.net/project1/
If you access it but project1 would have the default php configuration 8.2, so the FCGI is lost and of course my idea is to be able to access it from the internet but each project with its php version as I have it locally, but I have not been able to do it.
I have several questions:
Can you connect access from the Internet with a single domain to different folders by accessing through different ports (the example I have given in this post)?
If this is not possible, could you configure an https with svirtualhost that points to project1 (for example https) and project2 to (http)?
Would I have to contract a domain, for example mydomain.com, to be able to create subdomains and in turn be able to link with ddns to my public IP?
I have updated to the latest version of
wamp 3.3.1
Apache 2.4.57.4
php 8.2.10 by default
php 7.4.22
Sorry for the blurb, I've been using wamp for many years and I like it, but being able to configure several projects from the internet is important.
Thank you so much.