I am working on localhost right now. Suppose I have a route now at http://localhost:8000/info. Now I have a domain named www.helloyou.com.
In my project routing the routing for this info.php class is like /info.
How can I change http://localhost:8000/info to http://admin.helloyou.com/info. I am working on a Symfony environment.
In your Windows HOSTS file you can set a mapping from your domain to your localhost (127.0.0.1):
127.0.0.1 example.com
Located in C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS (On most other systems (Linux/OSX) it's under /etc/hosts)
Any requests for example.com will then go to your localhost - this is suitable for testing just on your local machine.
If you want to be able to test this from any machine on your LAN (including phones, tablets, etc.) then you can set an A record in the DNS Zone for that domain (perhaps for a localtest. subdomain) that points to the internal IP address of your server. eg. 192.168.1.20.
You need to go to your online management panel.
There you'll find something like DNS.
You add an A record from admin.helloyou.com to your public ip address.
Wait till all the caching servers are updated (can take 48 hours).
After this, your public device is visible trough admin.helloyou.com.
Now you need to go to your router (mostly 192.168.0.1).
Go to the page where you can set up NAT/PAT port forwarding (virtual server is a common name for this).
There you need to forward port 80 (public) to port 8000 (private) to your private address.
On your PC you need to allow public access to port 8000 in your firewall.
In the case that you don't have a NAT-router, but are directly connected, you cannot do this second step.
In that case you will always need to surf to port 8000, or let apache listen on port 80.
Related
Good day, I have Windows Server 2012 R2, I installed WAMP Server 3, on wamp settings I enabled the following
- Virtual host sub-menu
- Menu item: Online/Offline
when installing wamp a "my-site" folder was created, i created a index.html file in there with a
then i created a vhost using the GUI (localhost)
and the httpd-vhosts.conf looks like this
ServerName my-site.dev
DocumentRoot c:/wamp64/www/my-site
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
after this, i clicked on Put Online and disabled my windows firewall
from a different computer on the network i am trying to access to (http://29.8.14.2/my-site.dev) (IP of the windows server / folder) but i get the message
"Forbidden
You don't have permission to access /my-site.dev on this server.
Apache/2.4.17 (Win64) PHP/5.6.16 Server at 29.8.14.2 Port 80"
could you please let me know what I am doing incorrectly?
thank you.
I know I answered this over on the WAMPServer forum but I thought it may be relevant to have an answer here as well.
First you cannot use publically addressable IP Addresses for a local network. So your 29.8.14.xx address range is probably causing some or all or these problems.
There are 3 address ranges provided for Private ip address ranges for Small, Medium and Large Internal networks and they are
RFC1918 name IP address range number of addresses
24-bit block 10.0.0.0 - 10.255.255.255 16,777,216
20-bit block 172.16.0.0 - 172.31.255.255 1,048,576
16-bit block 192.168.0.0 - 192.168.255.255 65,536
Pick one that suites your clients network size, current and potential.
Your next problem will be how to get all the PC's in this network to know where mysite.dev is in the network. If its only a few PC's then you can edit the HOSTS file on each PC and add an entry like this to each, I am assuming you go for the 16-bit block address range.
192.168.1.2 mysite.dev
just like you did to the PC running WAMPServer, but pointing the domain name to the IP Address of the PC running WAMPServer and your site.
Alternatively, if your client has a local DNS Server and MANY PC's, then it would be much easier to add your site to his DNS Server and then every PC should know where to find mysite.dev
Let's say, i set the name-based virtual host for my working project in D:/xampp/htdocs/myproject with myproject.com. It runs well locally.
Then, i buy the domain name with exactly match with virtual domain : myproject.com and i want to access the live domain instead of virtual domain in the same computer while the apache is running.
Are there any ways to do that ?
Thanks
You can try to modify the host file and remove such as 127.0.0.1 myproject.com.
So you can visit myproject.com via DNS.
I am able to access my XAMPP server Dashboard in an another PC in LAN. But I am not able to access any folder other than dashboard.
I have changed my ports 80->87 SSL port 443->444. I have turned off my firewall. Also added Inbound Rules and Outbound Rules to firewall (being safer).
Update - No Access means Error:
This site can't be reached. www.172.18.5.14's server DNS address could not be found.
But I am able to go for 172.18.5.14/dashboard/
httpd-ssl.conf Link
httpd-xaamp.conf Link
httpd.conf file Link
This question already has answers here:
How do I connect to this localhost from another computer on the same network?
(8 answers)
Accessing localhost (xampp) from another computer over LAN network - how to?
(25 answers)
Closed 4 years ago.
I have installed xampp on localhost,and have installed wordpress on it(using port 8080),and have created a website on it.
I need to see that localhost wordpress site from another computer before loading it to a domain.I tried ngrok,but using that i could only get to the XAMPP welcome page.
How can I reach the wordpress site.
P.S. I access the wordpress site on my pc as localhost:8080/wordpress-trunk
Please help
You can access your local site from local network. To do that you need to assign ip to your local server. You can check these links link1 link2
To actually visit you site from internet you'll need to buy services(ip and domain name ) from your isp. Your isp will have to assign the in the dns server they are using. That is you'll have to make your own web server.
If its just for testing purpose best option is to use free hosts
Take a look on your apache configuration, looks like it allows requests only from localhost. Your config should looks like
<Directory /APP>
Allow from all
</Directory>
while now you have something like
<Directory /APP>
Allow from 127.0.0.0/8
</Directory>
* EDITED *
Accordin description, your task is to access your web site from another local computer, rather then from internet. As I can see, you can access this computer (and you can see XAMPP welcome page), so you don't need to follow Tousif Osman's answer, the problem is in your settings.
You can achieve what you want using your public IP adress, even if it's dynamic. First, you need to config a port forwarding in your router. To do this, enter in your router settings, go to port forwarding and there add the LOCAL IP adress from your XAMPP computer. Make sure to select type TCP and RANGE 80-80, because port 80 it's the default port for apache. Make sure you don't use Skype, which also use port 80.
After you did that, reset your router so the changes apply. Now, go to https-vhost.conf file and add something like this
<VirtualHost *:80>
#ServerAdmin webmaster#dummy-host.example.com
DocumentRoot "path to your wordpress directory"
ServerName your public IP
ServerAlias your public IP
</VirtualHost>
After that, go to hosts windows file (System32/Drivers/etc/) and add your IP twice. So, it should look something like this:
localhost localhost
YOUR PUBLIC IP YOUR PUBLIC IP
Don't forget to replace YOUR PUBLIC IP and path to your wordpress directory. Now, restart your apache service. I recommend you to perform a clean wordpress instalation in your wordpress directory and use YOUR PUBLIC IP for the website URL.
Briefly, this is all about it. I'm here if you have questions or problems!
I'm using httpd on Centos with name-based virtual hosts and I would like to block all traffic which attempts to access the server via its direct IP address, and only serve content if the visitor comes to a valid hostname.
E.g. let's say I host http://example.com on 1.2.3.4. If a visitor tries to visit http://1.2.3.4, the connection should time out as if the server doesn't exist or is unreachable. If they visit http://example.com, it should serve properly.
How do I configure this in httpd.conf?